-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
channel filtration, knee method to rsvd, update api examples
- Loading branch information
v1docq
committed
Apr 2, 2024
1 parent
0dddde4
commit 1837164
Showing
8 changed files
with
108 additions
and
55 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
29 changes: 18 additions & 11 deletions
29
examples/automl_example/api_example/time_series/ts_regression/ts_regression_example.py
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 |
---|---|---|
@@ -1,23 +1,30 @@ | ||
from fedot.core.pipelines.pipeline_builder import PipelineBuilder | ||
|
||
from fedot_ind.api.main import FedotIndustrial | ||
from fedot_ind.tools.loader import DataLoader | ||
from sklearn.metrics import mean_squared_error, mean_absolute_percentage_error | ||
|
||
if __name__ == "__main__": | ||
dataset_name = 'AppliancesEnergy' | ||
dataset_name = 'IEEEPPG' #BeijingPM10Quality | ||
finetune = True | ||
initial_assumption = PipelineBuilder().add_node('channel_filtration').add_node('quantile_extractor').add_node('treg') | ||
|
||
industrial = FedotIndustrial(problem='regression', | ||
metric='rmse', | ||
timeout=5, | ||
initial_assumption=initial_assumption, | ||
n_jobs=2, | ||
logging_level=20) | ||
|
||
train_data, test_data = DataLoader(dataset_name=dataset_name).load_data() | ||
if finetune: | ||
model = industrial.finetune(train_data) | ||
else: | ||
model = industrial.fit(train_data) | ||
|
||
model = industrial.fit(train_data) | ||
|
||
y_predicted = industrial.predict(test_data) | ||
|
||
print('Metrics:') | ||
print( | ||
f'RMSE: {round(mean_squared_error(test_data[1], y_predicted, squared=False), 3)}') | ||
print( | ||
f'MAPE: {round(mean_absolute_percentage_error(test_data[1], y_predicted), 3)}') | ||
labels = industrial.predict(test_data) | ||
probs = industrial.predict_proba(test_data) | ||
metrics = industrial.get_metrics(target=test_data[1], | ||
rounding_order=3, | ||
metric_names=('r2', 'rmse', 'mae')) | ||
print(metrics) | ||
_ = 1 |
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