import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
from sklearn.linear_model import LinearRegression,Ridge,Lasso
from sklearn.neighbors import KNeighborsRegressor
import sklearn.datasets as datasets
face = datasets.load_iris()
X = face['data']
y = face['target']
from sklearn.linear_model import LogisticRegression
lr = LogisticRegression(fit_intercept=False)
from sklearn.model_selection import train_test_split
X_train,X_test,y_train,y_test = train_test_split(X,y,test_size=0.2)
lr.fit(X_train,y_train)
y_ = lr.predict(X_test)
y_
array([0, 0, 2, 0, 1, 2, 1, 0, 0, 0, 1, 2, 0, 1, 2, 2, 0, 2, 2, 0, 2, 2, 2,
0, 2, 0, 1, 0, 2, 0])
y_test
array([0, 0, 2, 0, 1, 2, 1, 0, 0, 0, 1, 2, 0, 1, 1, 1, 0, 2, 2, 0, 2, 2, 1,
0, 2, 0, 1, 0, 2, 0])
lr.score(X_test,y_test)