There is a way to set the threshold cross_val_score sklearn?
I've trained a model, then I adjust the threshold to 0.22. The model in the following below :
# Try with Threshold
pred_proba = LGBM_Model.predict_proba(X_test)
# Adjust threshold for predictions proba
prediction_with_threshold = []
for item in pred_proba[:,0]:
if item > 0.22 :
prediction_with_threshold.append(0)
else:
prediction_with_threshold.append(1)
print(classification_report(y_test,prediction_with_threshold))
then I want to validate this model using cross_val_score. I've searched but can't find the method to set threshold for cross_val_score. The cross_val_score that I've used like the following below :
F1Scores = cross_val_score(LGBMClassifier(random_state=101,learning_rate=0.01,max_depth=-1,min_data_in_leaf=60,num_iterations=200,num_leaves=70),X,y,cv=5,scoring='f1')
F1Scores
### how to adjust threshold to 0.22 ??
Or there is other method to validate this model using threshold?