QuantileLossFitnessCalculator<T, TInput, TOutput>
Models & Types · AiDotNet.FitnessCalculators
A fitness calculator that uses Quantile Loss to evaluate model performance, particularly for prediction tasks where you want to estimate specific quantiles of the target distribution.
Inheritance: FitnessCalculatorBase<T, TInput, TOutput> → QuantileLossFitnessCalculator<T, TInput, TOutput>
For Beginners
This calculator helps evaluate how well your model is performing when you want to predict a specific percentile of your data rather than just the average value.
Quantile Loss is designed specifically for problems where:
- You’re interested in predicting a specific percentile (like the median or 90th percentile)
- You want to account for asymmetric risks (where over-prediction and under-prediction have different costs)
- You need to make predictions that reflect uncertainty in your data
What is a quantile? A quantile divides your data into equal portions:
- The 0.5 quantile (50th percentile) is the median - half the values are above it, half below
- The 0.9 quantile (90th percentile) is the value below which 90% of observations fall
- The 0.1 quantile (10th percentile) is the value below which 10% of observations fall
Examples of when to use Quantile Loss:
- Predicting delivery times (where late deliveries might be more costly than early ones)
- Estimating sales (where underestimating inventory needs might be worse than overestimating)
- Forecasting energy demand (where underestimating could lead to blackouts)
- Predicting financial risk (where you want to know the worst-case scenario at a certain confidence level)
How Quantile Loss works:
- It penalizes under-predictions and over-predictions differently based on the quantile you choose
- For the median (0.5 quantile), it penalizes both equally (this is also called the Mean Absolute Error)
- For higher quantiles (>0.5), it penalizes under-predictions more heavily
- For lower quantiles (<0.5), it penalizes over-predictions more heavily
Think of it like this: Imagine you’re predicting package delivery times:
- If you use the 0.5 quantile (median), you’re predicting when half the packages will arrive
- If you use the 0.9 quantile, you’re predicting a time by which 90% of packages will arrive
(useful for giving customers a “delivered by” guarantee)
- If you use the 0.1 quantile, you’re predicting when the earliest 10% of packages will arrive
Key characteristics:
- It allows for asymmetric penalties on errors
- Lower values are better (0 would be perfect predictions)
- The default quantile is 0.5 (the median)
- Different quantiles give you different insights about your predictions
Constructors
| Constructor | Summary |
|---|---|
QuantileLossFitnessCalculator(T quantile, DataSetType dataSetType) |
Initializes a new instance of the QuantileLossFitnessCalculator class. |