Skip to content

Commit 2fedc53

Browse files
committed
Add periods to docstrings of Args and Returns
1 parent d7d9291 commit 2fedc53

File tree

1 file changed

+40
-40
lines changed
  • benchmarks/domains/regression

1 file changed

+40
-40
lines changed

benchmarks/domains/regression/base.py

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ def kendall_tau_score(y_true: np.ndarray, y_pred: np.ndarray) -> float:
3333
"""Calculate Kendall's Tau correlation coefficient.
3434
3535
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.
3838
3939
Returns:
40-
Kendall's Tau correlation coefficient
40+
Kendall's Tau correlation coefficient.
4141
"""
4242
tau, _ = kendalltau(y_true, y_pred)
4343
return tau
@@ -47,11 +47,11 @@ def spearman_rho_score(y_true: np.ndarray, y_pred: np.ndarray) -> float:
4747
"""Calculate Spearman's Rho correlation coefficient.
4848
4949
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.
5252
5353
Returns:
54-
Spearman's Rho correlation coefficient
54+
Spearman's Rho correlation coefficient.
5555
"""
5656
rho, _ = spearmanr(y_true, y_pred)
5757
return rho
@@ -220,15 +220,15 @@ def _evaluate_model(
220220
"""Train a single model and evaluate its performance.
221221
222222
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.
229229
230230
Returns:
231-
Dictionary with scenario name and evaluation metrics
231+
Dictionary with scenario name and evaluation metrics.
232232
"""
233233
target_column = objective._target.name
234234
train_data_prepared = train_data.copy()
@@ -261,14 +261,14 @@ def _sample_source_data(
261261
"""Sample source data ensuring same fraction from each source task.
262262
263263
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.
269269
270270
Returns:
271-
Combined DataFrame with sampled data from all source tasks
271+
Combined DataFrame with sampled data from all source tasks.
272272
"""
273273
# Collect sampled subsets from each source task
274274
source_subsets: list[pd.DataFrame] = []
@@ -296,16 +296,16 @@ def _evaluate_naive_models(
296296
"""Evaluate both naive model baselines that do not use source data.
297297
298298
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.
306306
307307
Returns:
308-
List of evaluation results for naive baselines
308+
List of evaluation results for naive baselines.
309309
"""
310310
# Collect evaluation results for models without source data
311311
results: list[dict[str, Any]] = []
@@ -350,17 +350,17 @@ def _evaluate_transfer_learning_models(
350350
"""Evaluate all transfer learning models using source and target data.
351351
352352
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.
361361
362362
Returns:
363-
List of evaluation results for transfer learning models
363+
List of evaluation results for transfer learning models.
364364
"""
365365
# Collect evaluation results for transfer learning models
366366
results: list[dict[str, Any]] = []
@@ -392,12 +392,12 @@ def _calculate_metrics(
392392
"""Calculate regression metrics for model predictions.
393393
394394
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.
398398
399399
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.
401401
"""
402402
results = {}
403403
pred_values = predictions[f"{target_column}_mean"].values

0 commit comments

Comments
 (0)