Skip to content

Commit 0350603

Browse files
committed
agreed on all other points
1 parent 059bad7 commit 0350603

File tree

3 files changed

+24
-15
lines changed

3 files changed

+24
-15
lines changed

openml/flows/sklearn_converter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@ def _serialize_cross_validator(o):
533533
for key in args:
534534
# We need deprecation warnings to always be on in order to
535535
# catch deprecated param values.
536-
# This is set in utils/__init__.py.py.py but it gets overwritten
536+
# This is set in utils/__init__.py but it gets overwritten
537537
# when running under python3 somehow.
538538
warnings.simplefilter("always", DeprecationWarning)
539539
try:

openml/setups/functions.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def get_setup(setup_id):
7474
return _create_setup_from_xml(result_dict)
7575

7676

77-
def setup_list(flow=None, tag=None, offset=None, size=None):
77+
def list_setups(flow=None, tag=None, offset=None, size=None):
7878
"""List all setups matching all of the given filters.
7979
8080
Perform API call `/setup/list/{filters}
@@ -120,11 +120,11 @@ def _list_setups(api_call):
120120
% str(setups_dict))
121121
elif '@xmlns:oml' not in setups_dict['oml:setups']:
122122
raise ValueError('Error in return XML, does not contain '
123-
'"oml:runs"/@xmlns:oml: %s'
123+
'"oml:setups"/@xmlns:oml: %s'
124124
% str(setups_dict))
125125
elif setups_dict['oml:setups']['@xmlns:oml'] != 'http://openml.org/openml':
126126
raise ValueError('Error in return XML, value of '
127-
'"oml:runs"/@xmlns:oml is not '
127+
'"oml:seyups"/@xmlns:oml is not '
128128
'"http://openml.org/openml": %s'
129129
% str(setups_dict))
130130

tests/test_flows/test_flow.py

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -239,17 +239,26 @@ def get_sentinel():
239239
def test_existing_flow_exists(self):
240240
# create a flow
241241
nb = sklearn.naive_bayes.GaussianNB()
242-
flow = openml.flows.sklearn_to_flow(nb)
243-
flow, _ = self._add_sentinel_to_flow_name(flow, None)
244-
#publish the flow
245-
flow = flow.publish()
246-
#redownload the flow
247-
flow = openml.flows.get_flow(flow.flow_id)
248-
249-
# check if flow exists can find it
250-
flow = openml.flows.get_flow(flow.flow_id)
251-
downloaded_flow_id = openml.flows.flow_exists(flow.name, flow.external_version)
252-
self.assertEquals(downloaded_flow_id, flow.flow_id)
242+
243+
steps = [('imputation', sklearn.preprocessing.Imputer(strategy='median')),
244+
('hotencoding', sklearn.preprocessing.OneHotEncoder(sparse=False,
245+
handle_unknown='ignore')),
246+
('variencethreshold', sklearn.feature_selection.VarianceThreshold()),
247+
('classifier', sklearn.tree.DecisionTreeClassifier())]
248+
complicated = sklearn.pipeline.Pipeline(steps=steps)
249+
250+
for classifier in [nb, complicated]:
251+
flow = openml.flows.sklearn_to_flow(classifier)
252+
flow, _ = self._add_sentinel_to_flow_name(flow, None)
253+
#publish the flow
254+
flow = flow.publish()
255+
#redownload the flow
256+
flow = openml.flows.get_flow(flow.flow_id)
257+
258+
# check if flow exists can find it
259+
flow = openml.flows.get_flow(flow.flow_id)
260+
downloaded_flow_id = openml.flows.flow_exists(flow.name, flow.external_version)
261+
self.assertEquals(downloaded_flow_id, flow.flow_id)
253262

254263
def test_sklearn_to_upload_to_flow(self):
255264
iris = sklearn.datasets.load_iris()

0 commit comments

Comments
 (0)