-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
create new operation type - atomized
- Loading branch information
1 parent
0cb15ec
commit 0a5defd
Showing
15 changed files
with
137 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
from fedot.core.operations.model import Model | ||
from fedot.core.repository.operation_types_repository import OperationTypesRepository | ||
|
||
|
||
class Atomized(Model): | ||
""" | ||
Class with fit/predict methods defining the atomized strategy for the task | ||
:param operation_type: name of the model | ||
""" | ||
|
||
def __init__(self, operation_type: str): | ||
super().__init__(operation_type=operation_type) | ||
self.operations_repo = OperationTypesRepository('atomized') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import warnings | ||
from typing import Optional | ||
|
||
from fedot.core.data.data import InputData, OutputData | ||
from fedot.core.operations.evaluation.evaluation_interfaces import EvaluationStrategy, SkLearnEvaluationStrategy | ||
from fedot.core.operations.evaluation.operation_implementations.data_operations.decompose \ | ||
import DecomposerRegImplementation | ||
from fedot.core.operations.evaluation.operation_implementations.data_operations.sklearn_filters \ | ||
import IsolationForestRegImplementation | ||
from fedot.core.operations.evaluation.operation_implementations. \ | ||
data_operations.sklearn_filters import LinearRegRANSACImplementation, NonLinearRegRANSACImplementation | ||
from fedot.core.operations.evaluation.operation_implementations. \ | ||
data_operations.sklearn_selectors import LinearRegFSImplementation, NonLinearRegFSImplementation | ||
from fedot.core.operations.evaluation.operation_implementations.models.atomized.atomized_ts_differ import \ | ||
AtomizedTimeSeriesDiffer | ||
from fedot.core.operations.evaluation.operation_implementations.models.atomized.atomized_ts_sampler import \ | ||
AtomizedTimeSeriesSampler | ||
from fedot.core.operations.evaluation.operation_implementations.models.atomized.atomized_ts_scaler import \ | ||
AtomizedTimeSeriesScaler | ||
from fedot.core.operations.evaluation.operation_implementations.models.knn import FedotKnnRegImplementation | ||
from fedot.core.operations.operation_parameters import OperationParameters | ||
from fedot.utilities.random import ImplementationRandomStateHandler | ||
|
||
warnings.filterwarnings("ignore", category=UserWarning) | ||
|
||
|
||
class FedotAtomizedStrategy(EvaluationStrategy): | ||
_operations_by_types = { | ||
'atomized_ts_differ': AtomizedTimeSeriesDiffer, | ||
'atomized_ts_scaler': AtomizedTimeSeriesScaler, | ||
'atomized_ts_sampler': AtomizedTimeSeriesSampler | ||
} | ||
|
||
def __init__(self, operation_type: str, params: Optional[OperationParameters] = None): | ||
self.operation_impl = self._convert_to_operation(operation_type) | ||
super().__init__(operation_type, params) | ||
|
||
def fit(self, train_data: InputData): | ||
model = self.operation_impl(self.params_for_fit.get('pipeline')) | ||
return model.fit(train_data) | ||
|
||
def predict(self, trained_operation, predict_data: InputData) -> OutputData: | ||
prediction = trained_operation.predict(predict_data) | ||
return prediction | ||
|
||
def predict_for_fit(self, trained_operation, predict_data: InputData) -> OutputData: | ||
prediction = trained_operation.predict_for_fit(predict_data) | ||
return prediction |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.