Advertisement
Guest User

Untitled

a guest
Oct 17th, 2019
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. # Figure out the class distribution percentage and round it to 3 decimal places
  2.  
  3. print('Percentage of negative class is {} %'.format(
  4. round(df[target_class_name].value_counts()[0]/len(df) * 100,3)))
  5.  
  6. print('Percentage of Positive class is {} %'.format(
  7. round(df[target_class_name].value_counts()[1]/len(df) * 100,3)))
  8.  
  9. # Watch out for situations where the percentage of one class is really small compared to the other
  10. # In such a scenario we would need to use SMOTE or other balancing techniques
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement