regression
regression
¶
ML regression models for FPL prediction.
RegressionModel
¶
RegressionModel(
model_type: str = "ridge",
initial_train_size: int = 10,
test_size: int = 1,
step: int = 1,
**model_kwargs
)
Bases: BaseModel
Machine learning regression model for FPL predictions.
Adapted from the MLSP project's regressor patterns.
| PARAMETER | DESCRIPTION |
|---|---|
model_type
|
Type of model: 'ridge', 'xgboost', 'lightgbm'
TYPE:
|
initial_train_size
|
Size of initial training window
TYPE:
|
test_size
|
Forecast horizon
TYPE:
|
step
|
Rolling window step size
TYPE:
|
Source code in fplx/models/regression.py
fit
¶
predict
¶
Generate predictions.
Source code in fplx/models/regression.py
fit_predict
¶
Fit model and generate predictions using rolling CV.
| PARAMETER | DESCRIPTION |
|---|---|
y
|
Target time series (points to predict)
TYPE:
|
X
|
Feature matrix
TYPE:
|
verbose
|
Print progress
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Series
|
Predictions aligned with test indices |
Source code in fplx/models/regression.py
predict_next
¶
Predict next value given features.
| PARAMETER | DESCRIPTION |
|---|---|
X
|
Feature matrix (single row for next gameweek)
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
float
|
Predicted points |
Source code in fplx/models/regression.py
get_feature_importance
¶
Get feature importance (for tree-based models).
| PARAMETER | DESCRIPTION |
|---|---|
feature_names
|
Names of features
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
DataFrame
|
Feature importance scores |
Source code in fplx/models/regression.py
evaluate
¶
Evaluate model performance.
| RETURNS | DESCRIPTION |
|---|---|
dict[str, float]
|
Dictionary of metrics |