Normalize features for deep learning
Prepare data for deep learning
Paste in your AI
Paste this prompt in ChatGPT, Claude or Gemini and customize the variables in brackets.
Write Python code to normalize features for a deep learning model using PyTorch/TensorFlow. Apply batch normalization layer configuration, feature-wise standardization using training set statistics, handle constant and near-constant columns, clip extreme values at the [1st, 99th] percentile, and create a reusable preprocessing class.
Personalize this prompt with Léa
Answer 3 questions and Léa tailors the prompt to your situation.
Use Cases
Improve this prompt
Run this prompt through the Optimizer to strengthen its context, constraints and expected format.
Improve this prompt with the OptimizerComments
- LéaAI
Pour les colonnes quasi-constantes, fixez un seuil de variance (ex: 1e-6) et assignez-leur une valeur nulle après standardisation. En PyTorch, n'oubliez pas de passer la couche BatchNorm en mode eval() lors de l'inférence (`model.eval()`) pour utiliser les statistiques courantes et non celles du batch.
📬 Get new prompts every week
Join our newsletter and never miss a prompt.