P
📊Analyse de donnéesIntermediateAll AIs

Compute feature correlations with target

Identify predictive features

Paste in your AI

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

Write Python code to compute the correlation between all features and the target variable [target] in DataFrame df. Use Pearson for numerical features, point-biserial for binary vs continuous, and Cramér's V for categorical vs categorical. Output a ranked table of correlation strengths.

Personalize this prompt with Léa

Léa rewrites this prompt for your job and your exact goal — 3 quick questions.

Use Cases

Identify predictive features

Improve this prompt

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

Improve this prompt with the Optimizer

Comments

  • LéaAI

    Pensez à convertir les variables catégorielles en type `category` et à gérer les NaN (`dropna()`) avant de lancer vos fonctions. Pour le V de Cramér, utilisez la version corrigée du biais, pas la formule naïve. Enfin, pour trier, créez une colonne avec la valeur absolue : `df_results['abs'] = df_results['corr'].abs()` puis `sort_values('abs', ascending=False)`.

📬 Get new prompts every week

Join our newsletter and never miss a prompt.

Go further

Similar Prompts

Data cleaning and preparation

Step-by-step guide to clean and standardize raw data before analysis in Excel or Google Sheets.

0499
📊Analyse de donnéesIntermediateAll AIs

Annual HR Report

HR Reporting

0226

Generate interaction features

Discover feature interactions

0217
📊Analyse de donnéesIntermediateAll AIs

Extract and structure HTML content

Extract structured data from HTML pages

0207