i am trying to compare the prediction from my classifcation model and it's true label either 0 or 1.

y_true = df['status'].values

y_pred = df_pred['score'].values

cut, bins = pd.qcut(y_pred, q, retbins=True, duplicates='drop')

lift_df = pd.DataFrame({
            'bin': cut,
            'prediction_prod': y_pred,
            'ground_truth': y_true

        # Plot
fig, ax = plt.subplots(figsize=(8, 5))
lift_df.groupby('bin').mean().plot(kind='bar', ax=ax, color=['#BBC7FF', '#6882FF','#8168FF']

enter image description here

here i think what this is showing is that our model (predicted mean score) is over predicting for each bucket/decile in the bar below, whereas in reality the actual score (ground truth) is low. in an ideal model the two bars would be of equal length. would you agree on the interprettion?


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.