“Score de validation croisée Sklearn” Réponses codées

Score de validation croisée Sklearn

from sklearn.model_selection import cross_val_score
scores = cross_val_score(classifier_logreg, X_train, y_train, cv = 5, scoring='accuracy')
print('Cross-validation scores:{}'.format(scores))
print('Average cross-validation score: {}'.format(scores.mean()))
Xanthous Xenomorph

Score de validation croisée Sklearn

from sklearn.linear_model import RidgeClassifier
from sklearn.model_selection import cross_val_score

clf = RidgeClassifier() # estimator
score = cross_val_score(clf, X, y, cv=5)

# By default, the score computed at each CV iteration is the score
# method of the estimator. It is possible to change this by using 
# the scoring parameter:

scores = cross_val_score(clf, X, y, cv=5, scoring='f1_macro')
Arthur Elskens

Réponses similaires à “Score de validation croisée Sklearn”

Questions similaires à “Score de validation croisée Sklearn”

Plus de réponses similaires à “Score de validation croisée Sklearn” dans Python

Parcourir les réponses de code populaires par langue

Parcourir d'autres langages de code