What do you want to save?
Add Code snippet
New code examples
-
Python 2022-02-28 15:50:09
how to find the accuracy of linear regression model
# Simple Linear Regression # Importing the libraries import numpy as np import matplotlib.pyplot as plt import pandas as pd # Importing the dataset dataset = pd.read_csv('Salary_Data.csv') X = dataset.iloc[:, :-1].values y = dataset.iloc[:, 1].values # Sp... Add solution -
Python 2022-01-29 10:07:17
regression model
knn=KNeighborsRegressor() svr=SVR() lr=LinearRegression() dt=DecisionTreeRegressor() gbm=GradientBoostingRegressor() ada=AdaBoostRegressor() rfr=RandomForestRegressor() xgb=XGBRegressor() -------------------------------------------------------------------... Add solution -
Python 2021-10-14 08:23:17
how to do forward feature selection in python
#importing the necessary libraries from mlxtend.feature_selection import SequentialFeatureSelector as SFS from sklearn.linear_model import LinearRegression # Sequential Forward Selection(sfs) sfs = SFS(LinearRegression(), k_features=11, ... Add solution -
Python 2021-08-29 11:30:01
scikit learn linear regression
from sklearn.linear_model import LinearRegression X = np.array([[1, 1], [1, 2], [2, 2], [2, 3]]) y = np.dot(X, np.array([1, 2])) + 3 reg = LinearRegression().fit(X, y) reg.score(X, y) reg.coef_ reg.intercept_ reg.predict(np.array([[3, 5]])) Add solution