dquant 1.2.2__tar.gz → 1.2.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.
- {dquant-1.2.2/src/DQuant.egg-info → dquant-1.2.3}/PKG-INFO +1 -1
- {dquant-1.2.2 → dquant-1.2.3}/pyproject.toml +1 -1
- {dquant-1.2.2 → dquant-1.2.3/src/DQuant.egg-info}/PKG-INFO +1 -1
- {dquant-1.2.2 → dquant-1.2.3}/src/dquant/metrics.py +1 -1
- {dquant-1.2.2 → dquant-1.2.3}/src/dquant/models.py +26 -16
- {dquant-1.2.2 → dquant-1.2.3}/LICENSE +0 -0
- {dquant-1.2.2 → dquant-1.2.3}/README.md +0 -0
- {dquant-1.2.2 → dquant-1.2.3}/setup.cfg +0 -0
- {dquant-1.2.2 → dquant-1.2.3}/src/DQuant.egg-info/SOURCES.txt +0 -0
- {dquant-1.2.2 → dquant-1.2.3}/src/DQuant.egg-info/dependency_links.txt +0 -0
- {dquant-1.2.2 → dquant-1.2.3}/src/DQuant.egg-info/requires.txt +0 -0
- {dquant-1.2.2 → dquant-1.2.3}/src/DQuant.egg-info/top_level.txt +0 -0
- {dquant-1.2.2 → dquant-1.2.3}/src/__init__.py +0 -0
- {dquant-1.2.2 → dquant-1.2.3}/src/dquant/__init__.py +0 -0
- {dquant-1.2.2 → dquant-1.2.3}/src/dquant/get_data.py +0 -0
- {dquant-1.2.2 → dquant-1.2.3}/src/dquant/visual.py +0 -0
- {dquant-1.2.2 → dquant-1.2.3}/test/test.py +0 -0
- {dquant-1.2.2 → dquant-1.2.3}/test/test_load.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: dquant
|
|
3
|
-
Version: 1.2.
|
|
3
|
+
Version: 1.2.3
|
|
4
4
|
Summary: DQuant is an open-source Python library for automated volatility forecasting of financial time series. It handles all stages of model construction, from raw prices to the final forecast.
|
|
5
5
|
Author: Denis Makarov
|
|
6
6
|
Project-URL: Homepage, https://dquant.space
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: dquant
|
|
3
|
-
Version: 1.2.
|
|
3
|
+
Version: 1.2.3
|
|
4
4
|
Summary: DQuant is an open-source Python library for automated volatility forecasting of financial time series. It handles all stages of model construction, from raw prices to the final forecast.
|
|
5
5
|
Author: Denis Makarov
|
|
6
6
|
Project-URL: Homepage, https://dquant.space
|
|
@@ -605,6 +605,7 @@ class FichEn:
|
|
|
605
605
|
valid_mask = ~pd.isna(y_h) if hasattr(y_h, 'isna') else ~np.isnan(y_h)
|
|
606
606
|
X_h = X_scaled[valid_mask]
|
|
607
607
|
y_h_clean = y_h[valid_mask]
|
|
608
|
+
y_h_clean_orig = self.scaler_y.inverse_transform(y_h_clean.reshape(-1, 1)).ravel()
|
|
608
609
|
|
|
609
610
|
if i != 1:
|
|
610
611
|
self.models[h_idx].set_params(n_estimators=i)
|
|
@@ -620,24 +621,33 @@ class FichEn:
|
|
|
620
621
|
valid_mask = ~pd.isna(y_h_v) if hasattr(y_h_v, 'isna') else ~np.isnan(y_h_v)
|
|
621
622
|
X_h_v = X_test_scaled[valid_mask]
|
|
622
623
|
y_h_v_clean = y_h_v[valid_mask]
|
|
624
|
+
y_h_v_clean_orig = self.scaler_y.inverse_transform(y_h_v_clean.reshape(-1, 1)).ravel()
|
|
623
625
|
if i != 1:
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
626
|
+
pred_train = self.models[h_idx].predict(X_h)
|
|
627
|
+
pred_val = self.models[h_idx].predict(X_h_v)
|
|
628
|
+
pred_train_orig = self.scaler_y.inverse_transform(pred_train.reshape(-1, 1)).ravel()
|
|
629
|
+
pred_val_orig = self.scaler_y.inverse_transform(pred_val.reshape(-1, 1)).ravel()
|
|
630
|
+
t_error += mean_squared_error(y_h_clean, pred_train)
|
|
631
|
+
v_error += mean_squared_error(y_h_v_clean, pred_val)
|
|
632
|
+
t_mae += mean_absolute_error(y_h_clean, pred_train)
|
|
633
|
+
v_mae += mean_absolute_error(y_h_v_clean, pred_val)
|
|
634
|
+
t_qlike += qlike_score(y_h_clean_orig, pred_train_orig)
|
|
635
|
+
v_qlike += qlike_score(y_h_v_clean_orig, pred_val_orig)
|
|
636
|
+
t_r2 += r2_score(y_h_clean, pred_train)
|
|
637
|
+
v_r2 += r2_score(y_h_v_clean, pred_val)
|
|
632
638
|
else:
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
639
|
+
pred_train = model.predict(X_h)
|
|
640
|
+
pred_val = model.predict(X_h_v)
|
|
641
|
+
pred_train_orig = self.scaler_y.inverse_transform(pred_train.reshape(-1, 1)).ravel()
|
|
642
|
+
pred_val_orig = self.scaler_y.inverse_transform(pred_val.reshape(-1, 1)).ravel()
|
|
643
|
+
t_error += mean_squared_error(y_h_clean, pred_train)
|
|
644
|
+
v_error += mean_squared_error(y_h_v_clean, pred_val)
|
|
645
|
+
t_mae += mean_absolute_error(y_h_clean, pred_train)
|
|
646
|
+
v_mae += mean_absolute_error(y_h_v_clean, pred_val)
|
|
647
|
+
t_qlike += qlike_score(y_h_clean_orig, pred_train_orig)
|
|
648
|
+
v_qlike += qlike_score(y_h_v_clean_orig, pred_val_orig)
|
|
649
|
+
t_r2 += r2_score(y_h_clean, pred_train)
|
|
650
|
+
v_r2 += r2_score(y_h_v_clean, pred_val)
|
|
641
651
|
|
|
642
652
|
|
|
643
653
|
var_test_error = float(t_error)/horizon
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|