AI engineering glossary · Feature engineering data prep
What is class weights?
Class weights (also called class_weight): Multipliers applied in the loss function that make mistakes on rare classes cost more, so the model pays them more attention without changing the data. A common choice is weight proportional to 1 / class frequency.
Class weights: an example
With 1 percent fraud, giving fraud a weight of 99 makes one missed fraud cost as much as 99 missed non-frauds.
Related terms
More Feature engineering data prep terms
- Column transformer
- Constant feature
- Constant imputation
- Cook's distance
- Correlation filter
- Count vectorizer
- Cyclical encoding
- Datetime features
Where you learn it
Class weights is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.