Skip to content

Commit

Permalink
0.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
winedarksea committed Aug 7, 2023
1 parent 7895730 commit 1cb522e
Show file tree
Hide file tree
Showing 46 changed files with 950 additions and 276 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ model = AutoTS(
forecast_length=21,
frequency='infer',
prediction_interval=0.9,
ensemble=None,
ensemble='auto',
model_list="fast", # "superfast", "default", "fast_parallel"
transformer_list="fast", # "superfast",
drop_most_recent=1,
Expand Down
2 changes: 1 addition & 1 deletion TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* The most recent data will generally be the most important
* Forecasts are desired for the future immediately following the most recent data.

# 0.5.9 ♨️♨️♨️
# 0.6.0 ♨️♨️♨️
* import_best_model and fit_data
* added canberra distance to SeasonalityMotif and MetricMotif
* DatepartRegressionTransformer now handles NaN in input data
Expand Down
2 changes: 1 addition & 1 deletion autots/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
from autots.models.cassandra import Cassandra


__version__ = '0.5.9'
__version__ = '0.6.0'

TransformTS = GeneralTransformer

Expand Down
7 changes: 6 additions & 1 deletion autots/evaluator/anomaly_detector.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,12 @@ def plot_anomaly(self, kwargs={}):
self.anomaly_model.plot(**kwargs)

def plot(
self, series_name=None, include_anomalies=True, title=None, plot_kwargs={}, series=None
self,
series_name=None,
include_anomalies=True,
title=None,
plot_kwargs={},
series=None,
):
import matplotlib.pyplot as plt

Expand Down
23 changes: 16 additions & 7 deletions autots/evaluator/auto_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -733,7 +733,9 @@ def fit(self, df, future_regressor=None):
f,
)
except Exception as e:
error_msg = f"failed to write {self.current_model_file} with error {repr(e)}"
error_msg = (
f"failed to write {self.current_model_file} with error {repr(e)}"
)
try:
with open(f'{self.current_model_file}_failure.json', 'w') as f:
f.write(error_msg)
Expand All @@ -749,7 +751,9 @@ def fit(self, df, future_regressor=None):

self.transformation_runtime = datetime.datetime.now() - transformationStartTime
# from autots.evaluator.auto_model import ModelMonster
self.model = self.model.fit(df_train_transformed, future_regressor=future_regressor)
self.model = self.model.fit(
df_train_transformed, future_regressor=future_regressor
)
self._fit_complete = True
return self

Expand Down Expand Up @@ -790,7 +794,9 @@ def predict(self, forecast_length=None, future_regressor=None):
)
# CHECK Forecasts are proper length!
if df_forecast.forecast.shape[0] != self.forecast_length:
raise ValueError(f"Model {self.model_str} returned improper forecast_length")
raise ValueError(
f"Model {self.model_str} returned improper forecast_length"
)

if df_forecast.forecast.shape[1] != self.df.shape[1]:
raise ValueError("Model failed to return correct number of series.")
Expand All @@ -806,7 +812,9 @@ def predict(self, forecast_length=None, future_regressor=None):
if self.constraint is not None:
if isinstance(self.constraint, dict):
constraint_method = self.constraint.get("constraint_method", "quantile")
constraint_regularization = self.constraint.get("constraint_regularization", 1)
constraint_regularization = self.constraint.get(
"constraint_regularization", 1
)
lower_constraint = self.constraint.get("lower_constraint", 0)
upper_constraint = self.constraint.get("upper_constraint", 1)
bounds = self.constraint.get("bounds", False)
Expand Down Expand Up @@ -850,13 +858,12 @@ def predict(self, forecast_length=None, future_regressor=None):
sys.stdout.flush()

return df_forecast

def fit_data(self, df, future_regressor=None):
self.df = df
self.model.fit_data(df, future_regressor)



class TemplateEvalObject(object):
"""Object to contain all the failures!.
Expand Down Expand Up @@ -1279,7 +1286,9 @@ def model_forecast(
model_count=model_count,
)
model = model.fit(df_train_low, future_regressor_train)
return model.predict(forecast_length, future_regressor=future_regressor_forecast)
return model.predict(
forecast_length, future_regressor=future_regressor_forecast
)


def _ps_metric(per_series_metrics, metric, model_id):
Expand Down
Loading

0 comments on commit 1cb522e

Please sign in to comment.