I would like to print the f1-score. I got confused about the wording f1-accuracy score and accuracy score. What is the difference of these 2 scikit-learn metrics and how can I print the f1-score out of this code?
from xgboost import XGBClassifier from sklearn.metrics import accuracy_score, classification_report from sklearn.model_selection import train_test_split import pandas as pd import numpy as np from sklearn.model_selection import train_test_split df = pd.read...path X = df.drop('pricing_class', axis=1) y = df.pricing_class X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.33, random_state=42) xgb_classification = XGBClassifier(random_state=42) xgb_classification.fit(X_train,y_train) xgb_results=xgb_classification.predict(X_test) print(classification_report(xgb_results,y_test)) print('accuracy_score',accuracy_score(xgb_results, y_test))
this is a test sample:
Question 1: There is under the column f1-score the row of accuracy. Is this the f1-score of the scikit-learn classification report? or is this the accuracy score?
I have the feeling, that this value is the rounded value of the accuracy_score the line below (when I use full dataset).
Question 2: How can I print the f1-score?