-2
model = XGBClassifier()
model.fit(X_train[['ps_calc_01']], y_train)
y_pred = model.predict(X_test[['ps_calc_01']])
accuracy = accuracy_score(y_test, y_pred)
print("Accuracy: %.2f%%" % (accuracy * 100.0))

I'm seeing that ('ps_calc_01') is used for training and testing. Can someone help explain the logic behind how the model is making predictions and how the accuracy is calculated? Encountered this in Data science interview questions, is this approach common or effective for classification tasks?

0 Answers0