@@ -33,11 +33,11 @@ def kendall_tau_score(y_true: np.ndarray, y_pred: np.ndarray) -> float:
33
33
"""Calculate Kendall's Tau correlation coefficient.
34
34
35
35
Args:
36
- y_true: True target values
37
- y_pred: Predicted target values
36
+ y_true: True target values.
37
+ y_pred: Predicted target values.
38
38
39
39
Returns:
40
- Kendall's Tau correlation coefficient
40
+ Kendall's Tau correlation coefficient.
41
41
"""
42
42
tau , _ = kendalltau (y_true , y_pred )
43
43
return tau
@@ -47,11 +47,11 @@ def spearman_rho_score(y_true: np.ndarray, y_pred: np.ndarray) -> float:
47
47
"""Calculate Spearman's Rho correlation coefficient.
48
48
49
49
Args:
50
- y_true: True target values
51
- y_pred: Predicted target values
50
+ y_true: True target values.
51
+ y_pred: Predicted target values.
52
52
53
53
Returns:
54
- Spearman's Rho correlation coefficient
54
+ Spearman's Rho correlation coefficient.
55
55
"""
56
56
rho , _ = spearmanr (y_true , y_pred )
57
57
return rho
@@ -220,15 +220,15 @@ def _evaluate_model(
220
220
"""Train a single model and evaluate its performance.
221
221
222
222
Args:
223
- model: The surrogate model to train
224
- train_data: Training data
225
- test_data: Test data for evaluation
226
- searchspace: Search space for the model
227
- objective: Optimization objective
228
- scenario_name: Name of the scenario for results
223
+ model: The surrogate model to train.
224
+ train_data: Training data.
225
+ test_data: Test data for evaluation.
226
+ searchspace: Search space for the model.
227
+ objective: Optimization objective.
228
+ scenario_name: Name of the scenario for results.
229
229
230
230
Returns:
231
- Dictionary with scenario name and evaluation metrics
231
+ Dictionary with scenario name and evaluation metrics.
232
232
"""
233
233
target_column = objective ._target .name
234
234
train_data_prepared = train_data .copy ()
@@ -261,14 +261,14 @@ def _sample_source_data(
261
261
"""Sample source data ensuring same fraction from each source task.
262
262
263
263
Args:
264
- source_data: DataFrame containing all source task data
265
- source_tasks: List of source task identifiers
266
- fraction_source: Fraction of data to sample from each source task
267
- task_column: Name of column containing task identifiers
268
- source_data_seed: Random seed for reproducible sampling
264
+ source_data: DataFrame containing all source task data.
265
+ source_tasks: List of source task identifiers.
266
+ fraction_source: Fraction of data to sample from each source task.
267
+ task_column: Name of column containing task identifiers.
268
+ source_data_seed: Random seed for reproducible sampling.
269
269
270
270
Returns:
271
- Combined DataFrame with sampled data from all source tasks
271
+ Combined DataFrame with sampled data from all source tasks.
272
272
"""
273
273
# Collect sampled subsets from each source task
274
274
source_subsets : list [pd .DataFrame ] = []
@@ -296,16 +296,16 @@ def _evaluate_naive_models(
296
296
"""Evaluate both naive model baselines that do not use source data.
297
297
298
298
Args:
299
- target_train: Target task training data
300
- target_test: Target task test data
301
- vanilla_searchspace: Search space without task parameter
302
- tl_searchspace: Search space with task parameter
303
- objective: Optimization objective
304
- task_column: Name of task parameter column
305
- task_value: Value for task parameter
299
+ target_train: Target task training data.
300
+ target_test: Target task test data.
301
+ vanilla_searchspace: Search space without task parameter.
302
+ tl_searchspace: Search space with task parameter.
303
+ objective: Optimization objective.
304
+ task_column: Name of task parameter column.
305
+ task_value: Value for task parameter.
306
306
307
307
Returns:
308
- List of evaluation results for naive baselines
308
+ List of evaluation results for naive baselines.
309
309
"""
310
310
# Collect evaluation results for models without source data
311
311
results : list [dict [str , Any ]] = []
@@ -350,17 +350,17 @@ def _evaluate_transfer_learning_models(
350
350
"""Evaluate all transfer learning models using source and target data.
351
351
352
352
Args:
353
- source_data: Source task data
354
- target_train: Target task training data
355
- target_test: Target task test data
356
- tl_searchspace: Search space with task parameter
357
- objective: Optimization objective
358
- fraction_source: Fraction of source data used
359
- task_column: Name of task parameter column
360
- task_value: Value for task parameter
353
+ source_data: Source task data.
354
+ target_train: Target task training data.
355
+ target_test: Target task test data.
356
+ tl_searchspace: Search space with task parameter.
357
+ objective: Optimization objective.
358
+ fraction_source: Fraction of source data used.
359
+ task_column: Name of task parameter column.
360
+ task_value: Value for task parameter.
361
361
362
362
Returns:
363
- List of evaluation results for transfer learning models
363
+ List of evaluation results for transfer learning models.
364
364
"""
365
365
# Collect evaluation results for transfer learning models
366
366
results : list [dict [str , Any ]] = []
@@ -392,12 +392,12 @@ def _calculate_metrics(
392
392
"""Calculate regression metrics for model predictions.
393
393
394
394
Args:
395
- true_values: True target values
396
- predictions: Model predictions DataFrame with mean columns
397
- target_column: Name of the target column
395
+ true_values: True target values.
396
+ predictions: Model predictions DataFrame with mean columns.
397
+ target_column: Name of the target column.
398
398
399
399
Returns:
400
- Dictionary with metric names as keys and metric values as values
400
+ Dictionary with metric names as keys and metric values as values.
401
401
"""
402
402
results = {}
403
403
pred_values = predictions [f"{ target_column } _mean" ].values
0 commit comments