|
65 | 65 | ) |
66 | 66 | from autots.models.arch import ARCH |
67 | 67 | 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 | +) |
69 | 77 |
|
70 | 78 |
|
71 | 79 | def create_model_id( |
@@ -1906,25 +1914,108 @@ def _eval_prediction_for_template( |
1906 | 1914 | }, |
1907 | 1915 | }, # best on daily, competition, mae |
1908 | 1916 | { |
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 |
1913 | 1948 | { # best on VN1 competition and MAE |
1914 | 1949 | "fillna": "cubic", |
1915 | 1950 | "transformations": {"0": "ScipyFilter", "1": "DatepartRegression"}, |
1916 | 1951 | "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 | + }, |
1921 | 1981 | { # balanced on wiki daily |
1922 | 1982 | "fillna": "cubic", |
1923 | 1983 | "transformations": {"0": "AlignLastValue", "1": "DatepartRegression"}, |
1924 | 1984 | "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 | + }, |
1928 | 2019 | ] |
1929 | 2020 |
|
1930 | 2021 |
|
@@ -2981,7 +3072,9 @@ def generate_score( |
2981 | 3072 | divisor_results = model_results |
2982 | 3073 | if num_validations is not None: |
2983 | 3074 | 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 | + ] |
2985 | 3078 | print(divisor_results["rmse"]) |
2986 | 3079 | if divisor_results.empty: |
2987 | 3080 | divisor_results = model_results |
|
0 commit comments