def LocalTabularPredictor(*args, **kwargs) -> Localizer: """ A predictor that trains an ad-hoc model for each time series that it is given to predict. The constructor arguments are the same as for ``TabularEstimator``. """ return Localizer(TabularEstimator(*args, **kwargs))
def test_localizer(): dataset = ListDataset( data_iter=[{ "start": "2012-01-01", "target": (np.zeros(20) + i * 0.1 + 0.01), "id": f"{i}", } for i in range(3)], freq="1H", ) estimator = MeanEstimator(prediction_length=10, freq="1H", num_samples=50) local_pred = Localizer(estimator=estimator) agg_metrics, _ = backtest_metrics(test_dataset=dataset, predictor=local_pred)
def test_localizer(): dataset = ListDataset( data_iter=[{ 'start': '2012-01-01', 'target': (np.zeros(20) + i * 0.1 + 0.01), 'id': f'{i}', } for i in range(3)], freq='1H', ) estimator = MeanEstimator(prediction_length=10, freq='1H', num_samples=50) local_pred = Localizer(estimator=estimator) agg_metrics, _ = backtest_metrics(train_dataset=None, test_dataset=dataset, forecaster=local_pred)
def LocalTabularPredictor(*args, **kwargs) -> Localizer: return Localizer(TabularEstimator(*args, **kwargs))