tft_dataset
tft_dataset
¶
Dataset utilities for Temporal Fusion Transformer (TFT).
This module converts vaastav merged gameweek data into a global panel format
compatible with pytorch_forecasting.TimeSeriesDataSet.
build_tft_panel
¶
Build TFT panel dataframe from merged gameweek data.
Output schema includes: - group_id: player identifier - time_idx: gameweek index - static categoricals: position, team - known covariates: fixture_difficulty, is_home - unknown covariates: xPts, mins_frac, news_sentiment, actual_points
Source code in fplx/data/tft_dataset.py
make_tft_datasets
¶
make_tft_datasets(
panel_df: DataFrame,
training_cutoff: int,
encoder_length: int = 15,
prediction_length: int = 1,
)
Create TFT training and prediction datasets.
Requires optional dependency pytorch-forecasting.
Source code in fplx/data/tft_dataset.py
99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 | |