Professional Documents
Culture Documents
SLR Cheat Sheet
SLR Cheat Sheet
SLR Cheat Sheet
Normalization
from sklearn.preprocessing import Normalizer
scaler = Normalizer().fit(X_train) Cross Validation Model Evaluation
normalized_X = scaler.transform(X_train) Cross_Val_Score R-Squared
normalized_X_test = scaler.transform(X_test) from sklearn.model_selection import cross_val_score from sklearn.metrics import r2_score
r_sq = r2_score(y_true, y_pred)
scores = cross_val_score(estimator = LinearRegression(),
Imputing Missing Values X = X_train, y = y_train, cv, scoring)
Prediction
y_pred = model.predict(X_test)