Untitled

 avatar
unknown
plain_text
9 months ago
508 B
13
Indexable
import numpy 
from sklearn import linear_model 
 
X = numpy.array([3.78, 2.44, 2.09, 0.14, 1.72, 1.65, 4.92, 4.37, 4.96, 4.52, 3.69, 5.88]).reshape(-1,1) 
y = numpy.array([0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1]) 

logr = linear_model.LogisticRegression() 
logr.fit(X,y) 

predicted = logr.predict(numpy.array([3.46]).reshape(-1,1)) 
print(predicted) 
[0] 
 
import numpy as np 
arr = np.array([1, 2, 3
                , 4, 5, 6, 7, 8, 9, 10, 11, 12]) 
newarr = arr.reshape(4, 3) 
print(newarr) 
Editor is loading...
Leave a Comment