Skip to main content

Neural netork models for time-series-predictor.

Project description

Time series models

PyPI version travis codecov GitHub license Requirements Status

Description

Time series neural network models for Time series predictor

Installation

pip install time-series-models

Usage example

from time_series_models import BenchmarkLSTM
from skorch.callbacks import EarlyStopping
from skorch.dataset import CVSplit
from torch.optim import Adam
from flights_time_series_dataset import FlightSeriesDataset
from time_series_predictor import TimeSeriesPredictor

tsp = TimeSeriesPredictor(
    BenchmarkLSTM(),
    lr = 1e-3,
    lambda1=1e-8,
    optimizer__weight_decay=1e-8,
    iterator_train__shuffle=True,
    early_stopping=EarlyStopping(patience=50),
    max_epochs=250,
    train_split=CVSplit(10),
    optimizer=Adam
)

past_pattern_length = 24
future_pattern_length = 12
pattern_length = past_pattern_length + future_pattern_length
fsd = FlightSeriesDataset(pattern_length, past_pattern_length, pattern_length, stride=1)
tsp.fit(fsd)
mean_r2_score = tsp.score(tsp.dataset)
print(f"Achieved R2 score: {mean_r2_score}")
assert mean_r2_score > -20

Oze dataset history

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

time-series-models-0.3.9.tar.gz (5.0 kB view hashes)

Uploaded Source

Built Distribution

time_series_models-0.3.9-py3-none-any.whl (6.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page