add tests for outlier detection and removal functions

This commit is contained in:
robcaulk
2022-08-28 12:56:39 +02:00
parent 1e41c773a0
commit dd628eb525
4 changed files with 78 additions and 5 deletions

View File

@@ -566,7 +566,7 @@ class FreqaiDataDrawer:
for training according to user defined train_period_days
metadata: dict = strategy furnished pair metadata
"""
import pytest
with self.history_lock:
corr_dataframes: Dict[Any, Any] = {}
base_dataframes: Dict[Any, Any] = {}
@@ -576,6 +576,7 @@ class FreqaiDataDrawer:
)
for tf in self.freqai_info["feature_parameters"].get("include_timeframes"):
# pytest.set_trace()
base_dataframes[tf] = dk.slice_dataframe(timerange, historic_data[pair][tf])
if pairs:
for p in pairs:

View File

@@ -657,7 +657,7 @@ class FreqaiDataKitchen:
return (x, y)
MinPts = int(len(self.data_dictionary['train_features'].index) * 0.25)
# measure pairwise distances to train_features.shape[1]*2 nearest neighbours
# measure pairwise distances to nearest neighbours
neighbors = NearestNeighbors(
n_neighbors=MinPts, n_jobs=self.thread_count)
neighbors_fit = neighbors.fit(self.data_dictionary['train_features'])