Newbie in ML - how to
I'm writing an example code in python:

import sklearn
from sklearn.linear_model import LinearRegression
from sklearn.model_selection import train_test_split

X, y = whatever your data (X are the input variables, y are the output)
X_train, X_test, y_train, y_test = train_test_split(X, y, random_state=42)

lr = LinearRegression().fit(X_train, y_train)

print("Training set accuracy: {:.2f}".format(lr.score(X_train, y_train))
print("Test set accuracy: {:.2f}".format(lr.score(X_test, y_test))



Imported necessary packages.
Defined your input (X) and output data (y).
Shuffled the data into the training set (75%) and the test set (25%).
Defined the linear regression model and fitted the training data.
Printed training and test set accuracies.


Hope that helps!