Skip to content

Commit

Permalink
add topo to extra (#1261)
Browse files Browse the repository at this point in the history
Moved ripser to extra-dependencies
  • Loading branch information
valer1435 authored Mar 4, 2024
1 parent c17381c commit 3c2c028
Show file tree
Hide file tree
Showing 14 changed files with 36 additions and 608 deletions.
1 change: 1 addition & 0 deletions .github/workflows/unit-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ jobs:
python -m pip install --upgrade pip
pip install pytest
pip install .
pip install .[extra]
pip install pytest-cov
- name: Test with pytest
run: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ FEDOT supports bunch of dimensionality preprocessing operations that can be be a
`label_encoding`,Label Encoder, Feature encoding
`resample`,Imbalanced binary class transformation in classification, Data transformation
`topological_features`,Calculation of topological features,Time series transformation
`fast_topological_features`,Fast calculation of part of topological features,Time series transformation


.. csv-table:: Feature transformation operations implementations
Expand Down
9 changes: 3 additions & 6 deletions fedot/core/operations/evaluation/common_preprocessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,9 @@
from fedot.core.operations.evaluation.operation_implementations.data_operations.sklearn_transformations import \
ImputationImplementation, KernelPCAImplementation, NormalizationImplementation, PCAImplementation, \
PolyFeaturesImplementation, ScalingImplementation, FastICAImplementation
from fedot.core.operations.evaluation.operation_implementations.\
from fedot.core.operations.evaluation.operation_implementations. \
data_operations.topological.fast_topological_extractor import \
FastTopologicalFeaturesImplementation
from fedot.core.operations.evaluation.operation_implementations.data_operations.topological. \
topological_extractor import TopologicalFeaturesImplementation
TopologicalFeaturesImplementation
from fedot.core.operations.operation_parameters import OperationParameters
from fedot.utilities.random import ImplementationRandomStateHandler

Expand Down Expand Up @@ -50,8 +48,7 @@ class FedotPreprocessingStrategy(EvaluationStrategy):
'one_hot_encoding': OneHotEncodingImplementation,
'label_encoding': LabelEncodingImplementation,
'fast_ica': FastICAImplementation,
'topological_features': TopologicalFeaturesImplementation,
'fast_topological_features': FastTopologicalFeaturesImplementation,
'topological_features': TopologicalFeaturesImplementation
}

def __init__(self, operation_type: str, params: Optional[OperationParameters] = None):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
import logging
from itertools import chain
from typing import Optional

import numpy as np
from gph import ripser_parallel as ripser

try:
from gph import ripser_parallel as ripser
except ModuleNotFoundError:
logging.log(100,
"Topological features operation requires extra dependencies for time series forecasting, which are not"
" installed. It can infuence the performance. Please install it by 'pip install fedot[extra]'")

from joblib import Parallel, delayed

from fedot.core.data.data import InputData, OutputData
Expand All @@ -11,7 +19,7 @@
from fedot.core.operations.operation_parameters import OperationParameters


class FastTopologicalFeaturesImplementation(DataOperationImplementation):
class TopologicalFeaturesImplementation(DataOperationImplementation):
def __init__(self, params: Optional[OperationParameters] = None):
super().__init__(params)
self.window_size_as_share = params.get('window_size_as_share')
Expand Down

This file was deleted.

This file was deleted.

Loading

0 comments on commit 3c2c028

Please sign in to comment.