autofuzzts 0.1.1__tar.gz → 0.1.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. {autofuzzts-0.1.1 → autofuzzts-0.1.3}/LICENSE +21 -21
  2. {autofuzzts-0.1.1 → autofuzzts-0.1.3}/PKG-INFO +161 -146
  3. {autofuzzts-0.1.1 → autofuzzts-0.1.3}/README.md +134 -119
  4. {autofuzzts-0.1.1 → autofuzzts-0.1.3}/autofuzzts/config.py +17 -17
  5. {autofuzzts-0.1.1 → autofuzzts-0.1.3}/autofuzzts/data/data_loader.py +7 -7
  6. {autofuzzts-0.1.1 → autofuzzts-0.1.3}/autofuzzts/data_validation/validate.py +41 -41
  7. {autofuzzts-0.1.1 → autofuzzts-0.1.3}/autofuzzts/models/fuzzy_classifier.py +82 -82
  8. {autofuzzts-0.1.1 → autofuzzts-0.1.3}/autofuzzts/models/mlp_nas.py +90 -90
  9. autofuzzts-0.1.1/autofuzzts/partition/fuzzy_clust_fun.py → autofuzzts-0.1.3/autofuzzts/partition/fuzzy_part_fun.py +107 -107
  10. {autofuzzts-0.1.1 → autofuzzts-0.1.3}/autofuzzts/partition/partition.py +109 -109
  11. {autofuzzts-0.1.1 → autofuzzts-0.1.3}/autofuzzts/partition/visualize_partition.py +32 -32
  12. {autofuzzts-0.1.1 → autofuzzts-0.1.3}/autofuzzts/pipeline.py +469 -469
  13. {autofuzzts-0.1.1 → autofuzzts-0.1.3}/autofuzzts/preprocess/prep_for_model.py +70 -70
  14. {autofuzzts-0.1.1 → autofuzzts-0.1.3}/autofuzzts/preprocess/preprocess.py +62 -62
  15. {autofuzzts-0.1.1 → autofuzzts-0.1.3}/autofuzzts.egg-info/PKG-INFO +161 -146
  16. {autofuzzts-0.1.1 → autofuzzts-0.1.3}/autofuzzts.egg-info/SOURCES.txt +1 -3
  17. {autofuzzts-0.1.1 → autofuzzts-0.1.3}/pyproject.toml +35 -35
  18. {autofuzzts-0.1.1 → autofuzzts-0.1.3}/setup.cfg +4 -4
  19. autofuzzts-0.1.1/autofuzzts/partition/fuzzy_clust_fun_orig.py +0 -129
  20. autofuzzts-0.1.1/autofuzzts/utils.py +0 -1
  21. {autofuzzts-0.1.1 → autofuzzts-0.1.3}/autofuzzts/__init__.py +0 -0
  22. {autofuzzts-0.1.1 → autofuzzts-0.1.3}/autofuzzts/data/__init__.py +0 -0
  23. {autofuzzts-0.1.1 → autofuzzts-0.1.3}/autofuzzts/data_validation/__init__.py +0 -0
  24. {autofuzzts-0.1.1 → autofuzzts-0.1.3}/autofuzzts/evaluation/__init__.py +0 -0
  25. {autofuzzts-0.1.1 → autofuzzts-0.1.3}/autofuzzts/models/__init__.py +0 -0
  26. {autofuzzts-0.1.1 → autofuzzts-0.1.3}/autofuzzts/partition/__init__.py +0 -0
  27. {autofuzzts-0.1.1 → autofuzzts-0.1.3}/autofuzzts/preprocess/__init__.py +0 -0
  28. {autofuzzts-0.1.1 → autofuzzts-0.1.3}/autofuzzts.egg-info/dependency_links.txt +0 -0
  29. {autofuzzts-0.1.1 → autofuzzts-0.1.3}/autofuzzts.egg-info/requires.txt +0 -0
  30. {autofuzzts-0.1.1 → autofuzzts-0.1.3}/autofuzzts.egg-info/top_level.txt +0 -0
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2025 Jan Timko
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Jan Timko
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -1,146 +1,161 @@
1
- Metadata-Version: 2.4
2
- Name: autofuzzts
3
- Version: 0.1.1
4
- Summary: 'Time series forecasting using fuzzy logic and AutoML'
5
- Author-email: Jan Timko <jantimko16@gmail.com>
6
- License: MIT
7
- Project-URL: Homepage, https://github.com/yourusername/autofuzzts
8
- Project-URL: Repository, https://github.com/yourusername/autofuzzts
9
- Requires-Python: >=3.11
10
- Description-Content-Type: text/markdown
11
- License-File: LICENSE
12
- Requires-Dist: numpy>=1.26.0
13
- Requires-Dist: pandas>=2.2.0
14
- Requires-Dist: scikit-learn>=1.5.0
15
- Requires-Dist: scipy>=1.15.0
16
- Requires-Dist: xgboost>=3.0.0
17
- Requires-Dist: lightgbm>=4.6.0
18
- Requires-Dist: tpot>=1.0.0
19
- Requires-Dist: optuna>=4.3.0
20
- Requires-Dist: matplotlib>=3.10.0
21
- Requires-Dist: seaborn>=0.13.0
22
- Requires-Dist: requests>=2.32.0
23
- Requires-Dist: PyYAML>=6.0.0
24
- Requires-Dist: joblib>=1.4.0
25
- Requires-Dist: tqdm>=4.67.0
26
- Dynamic: license-file
27
-
28
- # AutoFuzzTS
29
-
30
- Time series forecasting library using fuzzy logic and automated machine learning.
31
- Build and evaluate time series models automatically using fuzzy logic and AutoML techniques.
32
-
33
- ## Installation
34
-
35
- ```bash
36
- pip install autofuzzts
37
- ```
38
-
39
- ## 🚀 Quick Start
40
-
41
- ### Load and prepare your time series data
42
- ```python
43
- import pandas as pd
44
-
45
- # Load dataset into a pandas DataFrame
46
- data = pd.read_csv("../clean_data/ADBE_yf_hourly_cleaned.csv").head(240)
47
-
48
- # Select the target column to forecast
49
- data_column_name = "close_price"
50
- df = data[[data_column_name]].copy()
51
-
52
- # Split into train, validation, and test sets
53
- test_len = len(df) // 5
54
- val_len = len(df) // 5
55
- train_len = len(df) - test_len - val_len
56
-
57
- df_train = df[:train_len]
58
- df_val = df[train_len:(train_len + val_len)]
59
- df_test = df[(train_len + val_len):]
60
- ```
61
-
62
- ---
63
-
64
- ### Tune hyperparameters using Bayesian search
65
- ```python
66
- from autofuzzts import pipeline
67
-
68
- # Run Bayesian optimization for fuzzy pipeline configuration
69
- best_config, best_rmse = pipeline.tune_hyperparameters_bayes(
70
- train_set=df_train,
71
- val_set=df_val,
72
- n_trials=20,
73
- metric="rmse"
74
- )
75
-
76
- print(f"Best configuration: {best_config}")
77
- ```
78
-
79
- **Example output:**
80
- ```
81
- Best configuration: {'n_clusters': 19, 'number_of_lags': 2, 'fuzzy_part_func': 'Triangle'}
82
- ```
83
-
84
- ---
85
-
86
- ### Train, calibrate, and predict
87
- ```python
88
- from autofuzzts import fit_calibrate_predict
89
-
90
- # Train model, calibrate, and make one-step-ahead predictions
91
- pred_set, pred_center_points, pred_test = fit_calibrate_predict(
92
- train_set=df_train,
93
- test_set=df_test,
94
- config=best_config,
95
- model_type="xgb"
96
- )
97
- ```
98
-
99
- This returns:
100
- - `pred_set`: predicted fuzzy sets
101
- - `pred_center_points`: corresponding fuzzy center values
102
- - `pred_test`: crisp numeric predictions (one-step-ahead forecast)
103
-
104
- ---
105
-
106
- ## Function Overview
107
-
108
- ### `fit_calibrate_predict()`
109
-
110
- ```python
111
- fit_calibrate_predict(
112
- train_set: pd.DataFrame,
113
- test_set: pd.DataFrame,
114
- config: dict,
115
- model_type: Literal['xgb', 'mlp', 'tpot'] = 'xgb',
116
- number_cv_calib: int = 5,
117
- diff_type: Literal['perc', 'abs'] = 'perc',
118
- covariates: list[str] | None = None,
119
- exclude_bool: bool = False
120
- ) -> float
121
- ```
122
-
123
- Trains and calibrates a fuzzy time series model on the training set using
124
- cross-validation, then predicts on the test set and returns performance metrics.
125
-
126
- ---
127
-
128
- ## Description
129
-
130
- AutoFuzzTS automates the process of fuzzy time series modeling by:
131
- - building and testing multiple fuzzy pipelines,
132
- - tuning hyperparameters using Bayesian optimization, and
133
- - integrating tuned classification models - **XGBoost**, **MLP**, or **TPOT**.
134
-
135
- This allows for rapid experimentation and selection of optimal configurations
136
- for forecasting tasks.
137
-
138
- ---
139
-
140
-
141
- ---
142
-
143
- ## 📄 License
144
-
145
- This project is licensed under the MIT License.
146
-
1
+ Metadata-Version: 2.4
2
+ Name: autofuzzts
3
+ Version: 0.1.3
4
+ Summary: 'Time series forecasting using fuzzy logic and AutoML'
5
+ Author-email: Jan Timko <jantimko16@gmail.com>
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/jtimko16/AutoFuzzTS
8
+ Project-URL: Repository, https://github.com/jtimko16/AutoFuzzTS
9
+ Requires-Python: >=3.11
10
+ Description-Content-Type: text/markdown
11
+ License-File: LICENSE
12
+ Requires-Dist: numpy>=1.26.0
13
+ Requires-Dist: pandas>=2.2.0
14
+ Requires-Dist: scikit-learn>=1.5.0
15
+ Requires-Dist: scipy>=1.15.0
16
+ Requires-Dist: xgboost>=3.0.0
17
+ Requires-Dist: lightgbm>=4.6.0
18
+ Requires-Dist: tpot>=1.0.0
19
+ Requires-Dist: optuna>=4.3.0
20
+ Requires-Dist: matplotlib>=3.10.0
21
+ Requires-Dist: seaborn>=0.13.0
22
+ Requires-Dist: requests>=2.32.0
23
+ Requires-Dist: PyYAML>=6.0.0
24
+ Requires-Dist: joblib>=1.4.0
25
+ Requires-Dist: tqdm>=4.67.0
26
+ Dynamic: license-file
27
+
28
+ # AutoFuzzTS
29
+
30
+ Time series forecasting library using fuzzy logic and automated machine learning.
31
+ Build and evaluate time series models automatically using fuzzy logic and AutoML techniques.
32
+
33
+ The package is designed for academic benchmarking and controlled experimentation in one-step-ahead time-series forecasting. It assumes a fixed train/validation/test split and focuses on reproducible model comparison rather than real-time deployment.
34
+
35
+ ## Installation
36
+
37
+ ```bash
38
+ pip install autofuzzts
39
+ ```
40
+
41
+ ## 🚀 Quick Start
42
+
43
+ ### Load and prepare your time series data
44
+ ```python
45
+ import pandas as pd
46
+
47
+ # Load dataset into a pandas DataFrame
48
+ data = pd.read_csv('../../data/sample_datasets/NYSE.csv')
49
+ data.head(10)
50
+ ```
51
+
52
+ ```python
53
+ # Select the target column to forecast
54
+ data_column_name = "Close"
55
+ df = data[[data_column_name]].copy()
56
+
57
+ # Split into train, validation, and test sets
58
+ test_len = len(df) // 5
59
+ val_len = len(df) // 5
60
+ train_len = len(df) - test_len - val_len
61
+
62
+ df_train = df[:train_len]
63
+ df_val = df[train_len:(train_len + val_len)]
64
+ df_test = df[(train_len + val_len):]
65
+ ```
66
+
67
+ ---
68
+
69
+ ### Tune hyperparameters using Bayesian search
70
+ ```python
71
+ from autofuzzts import pipeline
72
+
73
+ # Run Bayesian optimization for fuzzy pipeline configuration
74
+ best_config, best_rmse = pipeline.tune_hyperparameters_bayes(
75
+ train_set=df_train,
76
+ val_set=df_val,
77
+ n_trials=20,
78
+ metric="rmse"
79
+ )
80
+
81
+ print(f"Best configuration: {best_config}")
82
+ ```
83
+
84
+ **Example output:**
85
+ ```
86
+ Best configuration: {'n_fuzzy_sets': 13, 'number_of_lags': 6, 'fuzzy_part_func': 'Cosine'}
87
+ ```
88
+
89
+ ---
90
+
91
+ ### Train, calibrate, and predict
92
+ ```python
93
+ from autofuzzts import fit_calibrate_predict
94
+
95
+ # Train model, calibrate, and make one-step-ahead predictions
96
+ pred_set, pred_center_points, pred_test = fit_calibrate_predict(
97
+ train_set=df_train,
98
+ test_set=df_test,
99
+ config=best_config,
100
+ model_type="xgb"
101
+ )
102
+ ```
103
+
104
+ This returns:
105
+ - `pred_set`: predicted fuzzy sets
106
+ - `pred_center_points`: corresponding fuzzy center values
107
+ - `pred_test`: crisp numeric predictions (one-step-ahead forecast)
108
+
109
+ ---
110
+
111
+ ## Function Overview
112
+
113
+ ### `fit_calibrate_predict()`
114
+
115
+ ```python
116
+ fit_calibrate_predict(
117
+ train_set: pd.DataFrame,
118
+ test_set: pd.DataFrame,
119
+ config: dict,
120
+ model_type: Literal['xgb', 'mlp', 'tpot'] = 'xgb',
121
+ number_cv_calib: int = 5,
122
+ diff_type: Literal['perc', 'abs'] = 'perc',
123
+ covariates: list[str] | None = None,
124
+ exclude_bool: bool = False
125
+ ) -> float
126
+ ```
127
+
128
+ Trains and calibrates a fuzzy time series model on the training set using
129
+ cross-validation, then predicts on the test set and returns performance metrics.
130
+
131
+ ---
132
+
133
+ ## Description
134
+
135
+ AutoFuzzTS automates the process of fuzzy time series modeling by:
136
+ - building and testing multiple fuzzy pipelines,
137
+ - tuning hyperparameters using Bayesian optimization, and
138
+ - integrating tuned classification models - **XGBoost**, **MLP**, or **TPOT**.
139
+
140
+ This allows for rapid experimentation and selection of optimal configurations
141
+ for forecasting tasks.
142
+
143
+ ---
144
+ ## 📄 Reference
145
+
146
+ This code is based on the research:
147
+
148
+ **Optimizing stock price forecasting: a hybrid approach using fuzziness and automated machine learning**
149
+ *Jan Timko, Radwa El Shawi, Stefania Tomasiello*
150
+ *Expert Systems with Applications*, Volume 259, 2025, 128844
151
+
152
+ [Read on ScienceDirect](https://www.sciencedirect.com/science/article/pii/S0957417425024613)
153
+
154
+ If you use this code in your research or projects, please cite the paper.
155
+
156
+ ---
157
+
158
+ ## 📄 License
159
+
160
+ This project is licensed under the MIT License.
161
+
@@ -1,119 +1,134 @@
1
- # AutoFuzzTS
2
-
3
- Time series forecasting library using fuzzy logic and automated machine learning.
4
- Build and evaluate time series models automatically using fuzzy logic and AutoML techniques.
5
-
6
- ## Installation
7
-
8
- ```bash
9
- pip install autofuzzts
10
- ```
11
-
12
- ## 🚀 Quick Start
13
-
14
- ### Load and prepare your time series data
15
- ```python
16
- import pandas as pd
17
-
18
- # Load dataset into a pandas DataFrame
19
- data = pd.read_csv("../clean_data/ADBE_yf_hourly_cleaned.csv").head(240)
20
-
21
- # Select the target column to forecast
22
- data_column_name = "close_price"
23
- df = data[[data_column_name]].copy()
24
-
25
- # Split into train, validation, and test sets
26
- test_len = len(df) // 5
27
- val_len = len(df) // 5
28
- train_len = len(df) - test_len - val_len
29
-
30
- df_train = df[:train_len]
31
- df_val = df[train_len:(train_len + val_len)]
32
- df_test = df[(train_len + val_len):]
33
- ```
34
-
35
- ---
36
-
37
- ### Tune hyperparameters using Bayesian search
38
- ```python
39
- from autofuzzts import pipeline
40
-
41
- # Run Bayesian optimization for fuzzy pipeline configuration
42
- best_config, best_rmse = pipeline.tune_hyperparameters_bayes(
43
- train_set=df_train,
44
- val_set=df_val,
45
- n_trials=20,
46
- metric="rmse"
47
- )
48
-
49
- print(f"Best configuration: {best_config}")
50
- ```
51
-
52
- **Example output:**
53
- ```
54
- Best configuration: {'n_clusters': 19, 'number_of_lags': 2, 'fuzzy_part_func': 'Triangle'}
55
- ```
56
-
57
- ---
58
-
59
- ### Train, calibrate, and predict
60
- ```python
61
- from autofuzzts import fit_calibrate_predict
62
-
63
- # Train model, calibrate, and make one-step-ahead predictions
64
- pred_set, pred_center_points, pred_test = fit_calibrate_predict(
65
- train_set=df_train,
66
- test_set=df_test,
67
- config=best_config,
68
- model_type="xgb"
69
- )
70
- ```
71
-
72
- This returns:
73
- - `pred_set`: predicted fuzzy sets
74
- - `pred_center_points`: corresponding fuzzy center values
75
- - `pred_test`: crisp numeric predictions (one-step-ahead forecast)
76
-
77
- ---
78
-
79
- ## Function Overview
80
-
81
- ### `fit_calibrate_predict()`
82
-
83
- ```python
84
- fit_calibrate_predict(
85
- train_set: pd.DataFrame,
86
- test_set: pd.DataFrame,
87
- config: dict,
88
- model_type: Literal['xgb', 'mlp', 'tpot'] = 'xgb',
89
- number_cv_calib: int = 5,
90
- diff_type: Literal['perc', 'abs'] = 'perc',
91
- covariates: list[str] | None = None,
92
- exclude_bool: bool = False
93
- ) -> float
94
- ```
95
-
96
- Trains and calibrates a fuzzy time series model on the training set using
97
- cross-validation, then predicts on the test set and returns performance metrics.
98
-
99
- ---
100
-
101
- ## Description
102
-
103
- AutoFuzzTS automates the process of fuzzy time series modeling by:
104
- - building and testing multiple fuzzy pipelines,
105
- - tuning hyperparameters using Bayesian optimization, and
106
- - integrating tuned classification models - **XGBoost**, **MLP**, or **TPOT**.
107
-
108
- This allows for rapid experimentation and selection of optimal configurations
109
- for forecasting tasks.
110
-
111
- ---
112
-
113
-
114
- ---
115
-
116
- ## 📄 License
117
-
118
- This project is licensed under the MIT License.
119
-
1
+ # AutoFuzzTS
2
+
3
+ Time series forecasting library using fuzzy logic and automated machine learning.
4
+ Build and evaluate time series models automatically using fuzzy logic and AutoML techniques.
5
+
6
+ The package is designed for academic benchmarking and controlled experimentation in one-step-ahead time-series forecasting. It assumes a fixed train/validation/test split and focuses on reproducible model comparison rather than real-time deployment.
7
+
8
+ ## Installation
9
+
10
+ ```bash
11
+ pip install autofuzzts
12
+ ```
13
+
14
+ ## 🚀 Quick Start
15
+
16
+ ### Load and prepare your time series data
17
+ ```python
18
+ import pandas as pd
19
+
20
+ # Load dataset into a pandas DataFrame
21
+ data = pd.read_csv('../../data/sample_datasets/NYSE.csv')
22
+ data.head(10)
23
+ ```
24
+
25
+ ```python
26
+ # Select the target column to forecast
27
+ data_column_name = "Close"
28
+ df = data[[data_column_name]].copy()
29
+
30
+ # Split into train, validation, and test sets
31
+ test_len = len(df) // 5
32
+ val_len = len(df) // 5
33
+ train_len = len(df) - test_len - val_len
34
+
35
+ df_train = df[:train_len]
36
+ df_val = df[train_len:(train_len + val_len)]
37
+ df_test = df[(train_len + val_len):]
38
+ ```
39
+
40
+ ---
41
+
42
+ ### Tune hyperparameters using Bayesian search
43
+ ```python
44
+ from autofuzzts import pipeline
45
+
46
+ # Run Bayesian optimization for fuzzy pipeline configuration
47
+ best_config, best_rmse = pipeline.tune_hyperparameters_bayes(
48
+ train_set=df_train,
49
+ val_set=df_val,
50
+ n_trials=20,
51
+ metric="rmse"
52
+ )
53
+
54
+ print(f"Best configuration: {best_config}")
55
+ ```
56
+
57
+ **Example output:**
58
+ ```
59
+ Best configuration: {'n_fuzzy_sets': 13, 'number_of_lags': 6, 'fuzzy_part_func': 'Cosine'}
60
+ ```
61
+
62
+ ---
63
+
64
+ ### Train, calibrate, and predict
65
+ ```python
66
+ from autofuzzts import fit_calibrate_predict
67
+
68
+ # Train model, calibrate, and make one-step-ahead predictions
69
+ pred_set, pred_center_points, pred_test = fit_calibrate_predict(
70
+ train_set=df_train,
71
+ test_set=df_test,
72
+ config=best_config,
73
+ model_type="xgb"
74
+ )
75
+ ```
76
+
77
+ This returns:
78
+ - `pred_set`: predicted fuzzy sets
79
+ - `pred_center_points`: corresponding fuzzy center values
80
+ - `pred_test`: crisp numeric predictions (one-step-ahead forecast)
81
+
82
+ ---
83
+
84
+ ## Function Overview
85
+
86
+ ### `fit_calibrate_predict()`
87
+
88
+ ```python
89
+ fit_calibrate_predict(
90
+ train_set: pd.DataFrame,
91
+ test_set: pd.DataFrame,
92
+ config: dict,
93
+ model_type: Literal['xgb', 'mlp', 'tpot'] = 'xgb',
94
+ number_cv_calib: int = 5,
95
+ diff_type: Literal['perc', 'abs'] = 'perc',
96
+ covariates: list[str] | None = None,
97
+ exclude_bool: bool = False
98
+ ) -> float
99
+ ```
100
+
101
+ Trains and calibrates a fuzzy time series model on the training set using
102
+ cross-validation, then predicts on the test set and returns performance metrics.
103
+
104
+ ---
105
+
106
+ ## Description
107
+
108
+ AutoFuzzTS automates the process of fuzzy time series modeling by:
109
+ - building and testing multiple fuzzy pipelines,
110
+ - tuning hyperparameters using Bayesian optimization, and
111
+ - integrating tuned classification models - **XGBoost**, **MLP**, or **TPOT**.
112
+
113
+ This allows for rapid experimentation and selection of optimal configurations
114
+ for forecasting tasks.
115
+
116
+ ---
117
+ ## 📄 Reference
118
+
119
+ This code is based on the research:
120
+
121
+ **Optimizing stock price forecasting: a hybrid approach using fuzziness and automated machine learning**
122
+ *Jan Timko, Radwa El Shawi, Stefania Tomasiello*
123
+ *Expert Systems with Applications*, Volume 259, 2025, 128844
124
+
125
+ [Read on ScienceDirect](https://www.sciencedirect.com/science/article/pii/S0957417425024613)
126
+
127
+ If you use this code in your research or projects, please cite the paper.
128
+
129
+ ---
130
+
131
+ ## 📄 License
132
+
133
+ This project is licensed under the MIT License.
134
+
@@ -1,18 +1,18 @@
1
- # config.py
2
-
3
- DEFAULT_CONFIG = {
4
- "n_clusters": 3,
5
- "number_of_lags": 5,
6
- "plot_partition": False,
7
- "pred_column": "Y",
8
- "fuzzy_part_func": "triangle",
9
- "n_rows": 0,
10
- "sigma": 1.0,
11
- "verbosity": False,
12
- }
13
-
14
- def get_config(custom_config=None):
15
- config = DEFAULT_CONFIG.copy()
16
- if custom_config:
17
- config.update(custom_config)
1
+ # config.py
2
+
3
+ DEFAULT_CONFIG = {
4
+ "n_fuzzy_sets": 3,
5
+ "number_of_lags": 5,
6
+ "plot_partition": False,
7
+ "pred_column": "Y",
8
+ "fuzzy_part_func": "triangle",
9
+ "n_rows": 0,
10
+ "sigma": 1.0,
11
+ "verbosity": False,
12
+ }
13
+
14
+ def get_config(custom_config=None):
15
+ config = DEFAULT_CONFIG.copy()
16
+ if custom_config:
17
+ config.update(custom_config)
18
18
  return config
@@ -1,7 +1,7 @@
1
- import os
2
- import pandas as pd
3
-
4
- def load_sample_data(file_name):
5
- data_path = os.path.join(os.path.dirname(__file__), 'sample_datasets', file_name)
6
- print(f"Loading data from: {data_path}") # Print the constructed path
7
- return pd.read_csv(data_path)
1
+ import os
2
+ import pandas as pd
3
+
4
+ def load_sample_data(file_name):
5
+ data_path = os.path.join(os.path.dirname(__file__), 'sample_datasets', file_name)
6
+ print(f"Loading data from: {data_path}") # Print the constructed path
7
+ return pd.read_csv(data_path)