You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
%matplotlibinlineimportmatplotlib.pyplotaspltimportpandasaspd# Imports for Linear Regression:fromsklearn.model_selectionimporttrain_test_splitfromsklearn.linear_modelimportLinearRegression
Load the dataset:
df.pd.read_csv('Dataset/Linear.csv')
Linear Regression is very sensitive to outliers, missing values :
# Create instance of the model:model=LinearRegression(fit_intercept=True)
# Fit the model:model.fit(X, y)
# Predict for one observation:model.predict(X[0].reshape(-1, 1))
# Predict for multiple observations:model.predict([0:10])