Skip to content

Commit 7e97114

Browse files
committed
0.6.16
1 parent c441378 commit 7e97114

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+2263
-383
lines changed

autots/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
from autots.models.cassandra import Cassandra
2828

2929

30-
__version__ = '0.6.16b1'
30+
__version__ = '0.6.16'
3131

3232
TransformTS = GeneralTransformer
3333

autots/evaluator/anomaly_detector.py

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,12 @@ def plot(self, series_name=None, title=None, marker_size=None, plot_kwargs={}):
164164
if len(i_anom) > 0:
165165
if marker_size is None:
166166
marker_size = max(20, fig.dpi * 0.45)
167-
ax.scatter(i_anom.tolist(), self.df.loc[i_anom, :][series_name], c="red", s=marker_size)
167+
ax.scatter(
168+
i_anom.tolist(),
169+
self.df.loc[i_anom, :][series_name],
170+
c="red",
171+
s=marker_size,
172+
)
168173

169174
def fit(self, df):
170175
return self.detect(df)
@@ -375,13 +380,21 @@ def plot(
375380
i_anom = series_anom[series_anom == -1].index
376381
if len(i_anom) > 0:
377382
ax.scatter(
378-
i_anom.tolist(), self.df.loc[i_anom, :][series_name], c="red", s=marker_size
383+
i_anom.tolist(),
384+
self.df.loc[i_anom, :][series_name],
385+
c="red",
386+
s=marker_size,
379387
)
380388
# now the actual holidays
381389
i_anom = self.dates_to_holidays(self.df.index, style="series_flag")[series_name]
382390
i_anom = i_anom.index[i_anom == 1]
383391
if len(i_anom) > 0:
384-
ax.scatter(i_anom.tolist(), self.df.loc[i_anom, :][series_name], c="green", s=marker_size)
392+
ax.scatter(
393+
i_anom.tolist(),
394+
self.df.loc[i_anom, :][series_name],
395+
c="green",
396+
s=marker_size,
397+
)
385398

386399
def dates_to_holidays(self, dates, style="flag", holiday_impacts=False):
387400
"""Populate date information for a given pd.DatetimeIndex.

autots/evaluator/auto_model.py

Lines changed: 106 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,15 @@
6565
)
6666
from autots.models.arch import ARCH
6767
from autots.models.matrix_var import RRVAR, MAR, TMF, LATC, DMD
68-
from autots.models.sklearn import RollingRegression, WindowRegression, MultivariateRegression, DatepartRegression, UnivariateRegression, ComponentAnalysis, PreprocessingRegression
68+
from autots.models.sklearn import (
69+
RollingRegression,
70+
WindowRegression,
71+
MultivariateRegression,
72+
DatepartRegression,
73+
UnivariateRegression,
74+
ComponentAnalysis,
75+
PreprocessingRegression,
76+
)
6977

7078

7179
def create_model_id(
@@ -1906,25 +1914,108 @@ def _eval_prediction_for_template(
19061914
},
19071915
}, # best on daily, competition, mae
19081916
{
1909-
"fillna": "zero",
1910-
"transformations": {"0": "AnomalyRemoval", "1": "EWMAFilter", "2": "AlignLastValue"},
1911-
"transformation_params": {"0": {"method": "med_diff", "method_params": {"distribution": "norm", "alpha": 0.05}, "fillna": "rolling_mean_24", "transform_dict": {"fillna": None, "transformations": {"0": "EWMAFilter"}, "transformation_params": {"0": {"span": 7}}}, "isolated_only": False, "on_inverse": False}, "1": {"span": 7}, "2": {"rows": 1, "lag": 1, "method": "multiplicative", "strength": 1.0, "first_value_only": False, "threshold": 1, "threshold_method": "max"}}
1912-
}, # best on simple ensemble on daily
1917+
"fillna": "zero",
1918+
"transformations": {
1919+
"0": "AnomalyRemoval",
1920+
"1": "EWMAFilter",
1921+
"2": "AlignLastValue",
1922+
},
1923+
"transformation_params": {
1924+
"0": {
1925+
"method": "med_diff",
1926+
"method_params": {"distribution": "norm", "alpha": 0.05},
1927+
"fillna": "rolling_mean_24",
1928+
"transform_dict": {
1929+
"fillna": None,
1930+
"transformations": {"0": "EWMAFilter"},
1931+
"transformation_params": {"0": {"span": 7}},
1932+
},
1933+
"isolated_only": False,
1934+
"on_inverse": False,
1935+
},
1936+
"1": {"span": 7},
1937+
"2": {
1938+
"rows": 1,
1939+
"lag": 1,
1940+
"method": "multiplicative",
1941+
"strength": 1.0,
1942+
"first_value_only": False,
1943+
"threshold": 1,
1944+
"threshold_method": "max",
1945+
},
1946+
},
1947+
}, # best on simple ensemble on daily
19131948
{ # best on VN1 competition and MAE
19141949
"fillna": "cubic",
19151950
"transformations": {"0": "ScipyFilter", "1": "DatepartRegression"},
19161951
"transformation_params": {
1917-
"0": {"method": "butter", "method_args": {"N": 1, "btype": "highpass", "analog": False, "output": "sos", "Wn": 0.024390243902439025}},
1918-
"1": {"regression_model": {"model": "ElasticNet", "model_params": {"l1_ratio": 0.5, "fit_intercept": True, "selection": "cyclic", "max_iter": 1000}}, "datepart_method": ["weekdayofmonth", "common_fourier"], "polynomial_degree": None, "transform_dict": None, "holiday_countries_used": False, "lags": None, "forward_lags": None}
1919-
}
1920-
},
1952+
"0": {
1953+
"method": "butter",
1954+
"method_args": {
1955+
"N": 1,
1956+
"btype": "highpass",
1957+
"analog": False,
1958+
"output": "sos",
1959+
"Wn": 0.024390243902439025,
1960+
},
1961+
},
1962+
"1": {
1963+
"regression_model": {
1964+
"model": "ElasticNet",
1965+
"model_params": {
1966+
"l1_ratio": 0.5,
1967+
"fit_intercept": True,
1968+
"selection": "cyclic",
1969+
"max_iter": 1000,
1970+
},
1971+
},
1972+
"datepart_method": ["weekdayofmonth", "common_fourier"],
1973+
"polynomial_degree": None,
1974+
"transform_dict": None,
1975+
"holiday_countries_used": False,
1976+
"lags": None,
1977+
"forward_lags": None,
1978+
},
1979+
},
1980+
},
19211981
{ # balanced on wiki daily
19221982
"fillna": "cubic",
19231983
"transformations": {"0": "AlignLastValue", "1": "DatepartRegression"},
19241984
"transformation_params": {
1925-
"0": {"rows": 1, "lag": 7, "method": "multiplicative", "strength": 0.9, "first_value_only": False, "threshold": 3, "threshold_method": "max"},
1926-
"1": {"regression_model": {"model": "ElasticNet", "model_params": {"l1_ratio": 0.5, "fit_intercept": True, "selection": "cyclic", "max_iter": 1000}}, "datepart_method": "common_fourier", "polynomial_degree": None, "transform_dict": {"fillna": None, "transformations": {"0": "ClipOutliers"}, "transformation_params": {"0": {"method": "clip", "std_threshold": 4}}}, "holiday_countries_used": False, "lags": None, "forward_lags": None}}
1927-
}
1985+
"0": {
1986+
"rows": 1,
1987+
"lag": 7,
1988+
"method": "multiplicative",
1989+
"strength": 0.9,
1990+
"first_value_only": False,
1991+
"threshold": 3,
1992+
"threshold_method": "max",
1993+
},
1994+
"1": {
1995+
"regression_model": {
1996+
"model": "ElasticNet",
1997+
"model_params": {
1998+
"l1_ratio": 0.5,
1999+
"fit_intercept": True,
2000+
"selection": "cyclic",
2001+
"max_iter": 1000,
2002+
},
2003+
},
2004+
"datepart_method": "common_fourier",
2005+
"polynomial_degree": None,
2006+
"transform_dict": {
2007+
"fillna": None,
2008+
"transformations": {"0": "ClipOutliers"},
2009+
"transformation_params": {
2010+
"0": {"method": "clip", "std_threshold": 4}
2011+
},
2012+
},
2013+
"holiday_countries_used": False,
2014+
"lags": None,
2015+
"forward_lags": None,
2016+
},
2017+
},
2018+
},
19282019
]
19292020

19302021

@@ -2981,7 +3072,9 @@ def generate_score(
29813072
divisor_results = model_results
29823073
if num_validations is not None:
29833074
if "Runs" in model_results.columns:
2984-
divisor_results = model_results[model_results["Runs"] >= (num_validations + 1)]
3075+
divisor_results = model_results[
3076+
model_results["Runs"] >= (num_validations + 1)
3077+
]
29853078
print(divisor_results["rmse"])
29863079
if divisor_results.empty:
29873080
divisor_results = model_results

0 commit comments

Comments
 (0)