Skip to content

Commit 292023e

Browse files
committed
incorporate pieter's feedback
1 parent dfe864a commit 292023e

3 files changed

Lines changed: 18 additions & 1 deletion

File tree

openml/runs/trace.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,12 @@ def merge_traces(cls, traces: List['OpenMLRunTrace']) -> 'OpenMLRunTrace':
369369
list(iteration.parameters.keys()),
370370
)
371371
)
372+
373+
if key in merged_trace:
374+
raise ValueError(
375+
"Cannot merge traces because key '{}' was encountered twice".format(key)
376+
)
377+
372378
merged_trace[key] = iteration
373379
previous_iteration = key
374380

openml/tasks/task.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,12 @@ def get_X_and_y(
119119
) -> Union[np.ndarray, pd.DataFrame, scipy.sparse.spmatrix]:
120120
"""Get data associated with the current task.
121121
122+
Parameters
123+
----------
124+
dataset_format : str
125+
Data structure of the returned data. See :meth:`openml.datasets.OpenMLDataset.get_data`
126+
for possible options.
127+
122128
Returns
123129
-------
124130
tuple - X and y
@@ -191,6 +197,12 @@ def get_X(
191197
) -> Union[np.ndarray, pd.DataFrame, scipy.sparse.spmatrix]:
192198
"""Get data associated with the current task.
193199
200+
Parameters
201+
----------
202+
dataset_format : str
203+
Data structure of the returned data. See :meth:`openml.datasets.OpenMLDataset.get_data`
204+
for possible options.
205+
194206
Returns
195207
-------
196208
tuple - X and y

tests/test_extensions/test_sklearn_extension/test_sklearn_extension.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1442,7 +1442,6 @@ def predict_proba(*args, **kwargs):
14421442
np.testing.assert_array_equal(pred_1, pred_2)
14431443
np.testing.assert_array_almost_equal(np.sum(proba_1, axis=1), np.ones(X_test.shape[0]))
14441444
# Test that there are predictions other than ones and zeros
1445-
print(proba_1, proba_2)
14461445
self.assertLess(
14471446
np.sum(proba_1 == 0) + np.sum(proba_1 == 1),
14481447
X_test.shape[0] * len(task.class_labels),

0 commit comments

Comments
 (0)