def evaluate_model(model, X_train, y_train):
"""
Args:
model (sklearn classification model): this model from sklearn that
will be used to fit the data and to see the 10 fold cross val score of
X_train (2d numpy array): this is the feature matrix
y_train (1d numpy array): this is the array of targets
Returns:
prints information about the model's accuracy using 10
fold cross validation
model (sklearn classification model): the model that has already been
fit to the data
"""
print(np.mean(cross_val_score(model, X_train, y_train,
cv=10, n_jobs=-1, verbose=10)))
model.fit(X_train, y_train)
return model
评论列表
文章目录