Skip to content

Add quick start examples #21

@zhangzw16

Description

@zhangzw16

Currently, we only support running with a configuration file using python run.py

To make it more user-friendly for new users, we can add the ability to train and infer time-series models with just a few lines of code. For example:

# load_model by one line of code
from probts.model.forecaster.point_forecaster.units import UniTS
units = UniTS(ckpt_path='checkpoints/units/units_x128_pretrain_checkpoint.pth', target_dim=1, context_length=96, prediction_length=96, freq='H', lags_list=[])

from probts.model.forecaster.prob_forecaster.moirai import Moirai
moirai = Moirai(target_dim=1, context_length=96, prediction_length=96, freq='H', lags_list=[], patch_size=32, variate_mode='S', model_size='small')

# load data by one line of code
data_manager = DataManager("traffic", history_length=96, context_length=96, prediction_length=96, scaler='standard')
data_loader = DataLoader(data_manager.test_iter_dataset, batch_size=1)

# train and inference examples
# TODO

Metadata

Metadata

Assignees

Labels

documentationImprovements or additions to documentationenhancementNew feature or request

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions