Created
June 8, 2020 14:11
-
-
Save alabrashJr/4b534be0f35b542c860cfcbd34eae3fb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!pip install scikit-multilearn | |
!pip install scikit-learn | |
from sklearn.linear_model import LogisticRegression | |
from skmultilearn.problem_transform import LabelPowerset | |
from sklearn.metrics import f1_score,accuracy_score | |
lp_classifier = LabelPowerset(LogisticRegression()) | |
lp_classifier.fit(X_train, y_train) | |
lp_predictions = lp_classifier.predict(x_test) | |
print("Accuracy = ",accuracy_score(y_test,lp_predictions)) | |
print("F1 score = ",f1_score(y_test,lp_predictions, average="micro")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment