# SVC: support vector classifier (one of the "built-in" classifiers in scikit-learn)
# X, y: array-like representing input and target variables
# X.shape = (N, num_of_features)
# y.shape = (N, 1) in case of classification problem
from sklearn.model_selection import cross_val_score
clf = svm.SVC(kernel='linear', C=1, random_state=42)
scores = cross_val_score(clf, X, y, cv=5) # 5-fold cross validation
from sklearn.model_selection import cross_val_score
scores = cross_val_score(model # Ridge(alpha=1)
, X_train # scaler.fit_transform(x_train)
, y_train # scaler.fit_transform(y_train)
, scoring='neg_mean_squared_error' # depends on model more at https://scikit-learn.org/stable/modules/model_evaluation.html
, cv=5) # 5 fold cross validation
mean(scores) # negMSE (higher=better), adj hyper params to optimize
model.fit(x_train, y_train) # make sure to fit the model again after
y_final_test_pred = model.predict(x_test) # Final predictions
mean_squared_error(y_test, y_final_test_pred) # Final MSE on 'new' data