P
📊Analyse de donnéesIntermediateAll AIs

Handle imbalanced classes

Fix class imbalance

Paste in your AI

Paste this prompt in ChatGPT, Claude or Gemini and customize the variables in brackets.

My classification dataset df has a severe class imbalance: [class distribution]. Write Python code to address this using: SMOTE oversampling, random undersampling, and class_weight='balanced' comparison. Evaluate each approach using stratified cross-validation with F1-macro score. Target: [target_column].

Personalize this prompt with Léa

Answer 3 questions and Léa tailors the prompt to your situation.

Use Cases

Fix class imbalance

Improve this prompt

Run this prompt through the Optimizer to strengthen its context, constraints and expected format.

Improve this prompt with the Optimizer

Comments

Be the first to comment on this prompt.

📬 Get new prompts every week

Join our newsletter and never miss a prompt.

Go further

Similar Prompts

Build a recommendation system

Build recommendation systems

0105

Create an automated EDA report

Generate EDA reports automatically

0100
📊Analyse de donnéesIntermediateAll AIs

Build a feature engineering pipeline

Create reproducible preprocessing pipelines

0104
📊Analyse de donnéesIntermediateAll AIs

Statistical Power Analysis

Planning a statistical experiment

0121