Collectives™ on Stack Overflow
Find centralized, trusted content and collaborate around the technologies you use most.
Learn more about Collectives
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about Teams
Ask Question
I have face this error of
pos_label
firstly I import this library
from sklearn.metrics import jaccard_similarity_score
because of Version error I again import this library
from sklearn.metrics import jaccard_score
This is my code for running:
depth_range = range(1, 10)
jaccard_similarity_score_ = []
f1_score_ = []
for d in depth_range:
dt = DecisionTreeClassifier(criterion = 'gini', max_depth = d)
dt.fit(X_train, y_train)
dt_yhat = dt.predict(X_test)
ja = jaccard_score(y_test, dt_yhat, "yes")
jaccard_similarity_score_.append(ja)
f1_score_.append(f1_score(y_test, dt_yhat, average = 'weighted'))
I get this error :
ValueError: pos_label=1 is not a valid label: array(['COLLECTION', 'PAIDOFF'], dtype='<U10')
–
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.