Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hotfix: go for FeaturesType instead of InputData in a pipeline tuning #1311

Merged
merged 3 commits into from
Jul 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions fedot/api/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,8 @@ def fit(self,
return self.current_pipeline

def tune(self,
input_data: Optional[InputData] = None,
input_data: Optional[FeaturesType] = None,
target: TargetType = 'target',
metric_name: Optional[Union[str, MetricCallable]] = None,
iterations: int = DEFAULT_TUNING_ITERATIONS_NUMBER,
timeout: Optional[float] = None,
Expand All @@ -212,7 +213,8 @@ def tune(self,
"""Method for hyperparameters tuning of current pipeline
Args:
input_data: data for tuning pipeline.
input_data: data for tuning pipeline in one of the supported formats.
target: data target values in one of the supported target formats.
metric_name: name of metric for quality tuning.
iterations: numbers of tuning iterations.
timeout: time for tuning (in minutes). If ``None`` or ``-1`` means tuning until max iteration reach.
Expand All @@ -227,7 +229,10 @@ def tune(self,
raise ValueError(NOT_FITTED_ERR_MSG)

with fedot_composer_timer.launch_tuning('post'):
input_data = input_data or self.train_data
if input_data is None:
input_data = self.train_data
else:
input_data = self.data_processor.define_data(features=input_data, target=target, is_predict=False)
cv_folds = cv_folds or self.params.get('cv_folds')
n_jobs = n_jobs or self.params.n_jobs

Expand Down
Loading