33
loading...
This website collects cookies to deliver better user experience
Machine Learning comprises of supervised learning where we know the target or past answer and unsupervised learning where there are no targets.
from sklearn.linearmodel import LinearRegression
my_model = LinearRegression()
from sklearn.model_selection import train_test_split
X = feature columns
y = target column
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.3)
my_model.fit(X_train, y_train)
prediction = my_model.predict(X_test)
from sklearn.metrics import classification_report
print(classification_report(y_test,predictions))
from sklearn.metrics import confusion_matrix
print(confusion_matrix(y_test,predictions))