Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- grid = GridSearchCV(pipe, param_grid, cv=5)
- grille=grid.fit(text_train, Y_train)
- y_pred = grille.predict(text_test)
- from sklearn import metrics
- #matrice de confusion
- print("matrice confusion")
- print(metrics.confusion_matrix(Y_test,y_pred))
- #succès en test
- print("score accuracy")
- print(metrics.accuracy_score(Y_test,y_pred))
- [[ 0 0 0 0 0 0 0 0 0 0 27 2]
- [ 0 0 0 0 0 0 0 0 0 0 88 23]
- [ 0 0 0 0 0 0 0 0 0 0 12 0]
- [ 0 0 0 0 0 0 0 0 0 0 22 4]
- [ 0 0 0 0 0 0 0 0 0 0 108 90]
- [ 0 0 0 0 0 0 0 0 0 0 28 60]
- [ 0 0 0 0 0 0 0 0 0 0 16 94]
- [ 0 0 0 0 0 0 0 0 0 0 49 424]
- [ 0 0 0 0 0 0 0 0 0 0 5 76]
- [ 0 0 0 0 0 0 0 0 0 0 78 1487]
- [ 0 0 0 0 0 0 0 0 0 0 0 0]
- [ 0 0 0 0 0 0 0 0 0 0 0 0]]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement