autofuzzts 0.1.0__tar.gz → 0.1.1__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.
- autofuzzts-0.1.1/PKG-INFO +146 -0
- autofuzzts-0.1.1/README.md +119 -0
- autofuzzts-0.1.1/autofuzzts/pipeline.py +469 -0
- autofuzzts-0.1.1/autofuzzts.egg-info/PKG-INFO +146 -0
- {autofuzzts-0.1.0 → autofuzzts-0.1.1}/autofuzzts.egg-info/SOURCES.txt +1 -4
- {autofuzzts-0.1.0 → autofuzzts-0.1.1}/pyproject.toml +4 -4
- autofuzzts-0.1.0/PKG-INFO +0 -41
- autofuzzts-0.1.0/README.md +0 -9
- autofuzzts-0.1.0/autofuzzts/pipeline.py +0 -383
- autofuzzts-0.1.0/autofuzzts.egg-info/PKG-INFO +0 -41
- autofuzzts-0.1.0/setup.py +0 -36
- autofuzzts-0.1.0/tests/test_models.py +0 -1
- autofuzzts-0.1.0/tests/test_pipeline.py +0 -1
- {autofuzzts-0.1.0 → autofuzzts-0.1.1}/LICENSE +0 -0
- {autofuzzts-0.1.0 → autofuzzts-0.1.1}/autofuzzts/__init__.py +0 -0
- {autofuzzts-0.1.0 → autofuzzts-0.1.1}/autofuzzts/config.py +0 -0
- {autofuzzts-0.1.0 → autofuzzts-0.1.1}/autofuzzts/data/__init__.py +0 -0
- {autofuzzts-0.1.0 → autofuzzts-0.1.1}/autofuzzts/data/data_loader.py +0 -0
- {autofuzzts-0.1.0 → autofuzzts-0.1.1}/autofuzzts/data_validation/__init__.py +0 -0
- {autofuzzts-0.1.0 → autofuzzts-0.1.1}/autofuzzts/data_validation/validate.py +0 -0
- {autofuzzts-0.1.0 → autofuzzts-0.1.1}/autofuzzts/evaluation/__init__.py +0 -0
- {autofuzzts-0.1.0 → autofuzzts-0.1.1}/autofuzzts/models/__init__.py +0 -0
- {autofuzzts-0.1.0 → autofuzzts-0.1.1}/autofuzzts/models/fuzzy_classifier.py +0 -0
- {autofuzzts-0.1.0 → autofuzzts-0.1.1}/autofuzzts/models/mlp_nas.py +0 -0
- {autofuzzts-0.1.0 → autofuzzts-0.1.1}/autofuzzts/partition/__init__.py +0 -0
- {autofuzzts-0.1.0 → autofuzzts-0.1.1}/autofuzzts/partition/fuzzy_clust_fun.py +0 -0
- {autofuzzts-0.1.0 → autofuzzts-0.1.1}/autofuzzts/partition/fuzzy_clust_fun_orig.py +0 -0
- {autofuzzts-0.1.0 → autofuzzts-0.1.1}/autofuzzts/partition/partition.py +0 -0
- {autofuzzts-0.1.0 → autofuzzts-0.1.1}/autofuzzts/partition/visualize_partition.py +0 -0
- {autofuzzts-0.1.0 → autofuzzts-0.1.1}/autofuzzts/preprocess/__init__.py +0 -0
- {autofuzzts-0.1.0 → autofuzzts-0.1.1}/autofuzzts/preprocess/prep_for_model.py +0 -0
- {autofuzzts-0.1.0 → autofuzzts-0.1.1}/autofuzzts/preprocess/preprocess.py +0 -0
- {autofuzzts-0.1.0 → autofuzzts-0.1.1}/autofuzzts/utils.py +0 -0
- {autofuzzts-0.1.0 → autofuzzts-0.1.1}/autofuzzts.egg-info/dependency_links.txt +0 -0
- {autofuzzts-0.1.0 → autofuzzts-0.1.1}/autofuzzts.egg-info/requires.txt +0 -0
- {autofuzzts-0.1.0 → autofuzzts-0.1.1}/autofuzzts.egg-info/top_level.txt +0 -0
- {autofuzzts-0.1.0 → autofuzzts-0.1.1}/setup.cfg +0 -0
|
@@ -0,0 +1,146 @@
|
|
|
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
|
+
|
|
@@ -0,0 +1,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
|
+
## 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
|
+
|