diff --git a/fedot_ind/core/operation/transformation/data/point_cloud.py b/fedot_ind/core/operation/transformation/data/point_cloud.py index 53e5fc212..b53313861 100644 --- a/fedot_ind/core/operation/transformation/data/point_cloud.py +++ b/fedot_ind/core/operation/transformation/data/point_cloud.py @@ -137,8 +137,8 @@ def point_cloud_to_persistent_cohomology_ripser( diagrams = [np.array([dg for dg in diag if np.isfinite(dg).all()]) for diag in diagrams] # diagrams = diagrams / max([np.array([dg for dg in diag if np.isfinite( - # dg).all()]).max() for diag in diagrams if diag.shape[0] > 0]) - + # dg).all()]).max() for diag in diagrams if diag.shape[0] > 0]) + diagrams = [d / max([np.array([dg for dg in diag if np.isfinite( dg).all()]).max() for diag in diagrams if diag.shape[0] > 0]) for d in diagrams] diff --git a/fedot_ind/core/operation/transformation/representation/statistical/quantile_extractor.py b/fedot_ind/core/operation/transformation/representation/statistical/quantile_extractor.py index 2e0f32efc..8d2ddcf6f 100644 --- a/fedot_ind/core/operation/transformation/representation/statistical/quantile_extractor.py +++ b/fedot_ind/core/operation/transformation/representation/statistical/quantile_extractor.py @@ -71,7 +71,8 @@ def generate_features_from_ts(self, ts: np.array, window_length: int = None) -> InputData: ts = ts[None, :] if len(ts.shape) == 1 else ts # sanity check for map method - statistical_representation = np.array(list(map(lambda channel: self.extract_stats_features(channel, axis=0), ts))) + statistical_representation = np.array( + list(map(lambda channel: self.extract_stats_features(channel, axis=0), ts))) return statistical_representation def generate_features_from_array(self, array: np.array) -> InputData: diff --git a/fedot_ind/core/operation/transformation/representation/topological/topological_extractor.py b/fedot_ind/core/operation/transformation/representation/topological/topological_extractor.py index 453bd7426..023a23321 100644 --- a/fedot_ind/core/operation/transformation/representation/topological/topological_extractor.py +++ b/fedot_ind/core/operation/transformation/representation/topological/topological_extractor.py @@ -7,7 +7,6 @@ import pandas as pd from fedot.core.data.data import InputData from fedot.core.operations.operation_parameters import OperationParameters -from fedot.core.repository.dataset_types import DataTypesEnum from gtda.homology import VietorisRipsPersistence from gtda.time_series import takens_embedding_optimal_parameters from scipy import stats diff --git a/tests/unit/core/operation/transformation/data/test_point_cloud.py b/tests/unit/core/operation/transformation/data/test_point_cloud.py index f09b6bbdc..01473e5c2 100644 --- a/tests/unit/core/operation/transformation/data/test_point_cloud.py +++ b/tests/unit/core/operation/transformation/data/test_point_cloud.py @@ -30,9 +30,9 @@ def test_TopologicalTransformation_time_series_rolling_betti_ripser( max_simplex_dim=1, epsilon=3, window_length=400) - + betti_sum = topological_transformer.time_series_rolling_betti_ripser(basic_periodic_data) - + assert len(betti_sum) != 0