Skip to content
Merged
Show file tree
Hide file tree
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
8 changes: 5 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@ env:
- TEST_DIR=/tmp/test_dir/
- MODULE=openml
matrix:
- DISTRIB="conda" PYTHON_VERSION="2.7" NUMPY_VERSION="1.11" SCIPY_VERSION="0.17.0" CYTHON_VERSION="0.21" SKLEARN_VERSION="0.18"
- DISTRIB="conda" PYTHON_VERSION="3.4" NUMPY_VERSION="1.11" SCIPY_VERSION="0.17.0" CYTHON_VERSION="0.23.4" SKLEARN_VERSION="0.18"
- DISTRIB="conda" PYTHON_VERSION="3.5" COVERAGE="true" NUMPY_VERSION="1.11" SCIPY_VERSION="0.17.0" CYTHON_VERSION="0.23.4" SKLEARN_VERSION="0.18"
- DISTRIB="conda" PYTHON_VERSION="2.7" NUMPY_VERSION="1.11" SCIPY_VERSION="0.17.0" CYTHON_VERSION="0.21" SKLEARN_VERSION="0.18.1"
- DISTRIB="conda" PYTHON_VERSION="3.4" NUMPY_VERSION="1.11" SCIPY_VERSION="0.17.0" CYTHON_VERSION="0.23.4" SKLEARN_VERSION="0.18.1"
- DISTRIB="conda" PYTHON_VERSION="3.5" NUMPY_VERSION="1.11" SCIPY_VERSION="0.17.0" CYTHON_VERSION="0.23.4" SKLEARN_VERSION="0.18.1"
- DISTRIB="conda" PYTHON_VERSION="3.6" COVERAGE="true" NUMPY_VERSION="1.12.1" SCIPY_VERSION="0.19.0" CYTHON_VERSION="0.25.2" SKLEARN_VERSION="0.18.1"

install: source ci_scripts/install.sh
script: bash ci_scripts/test.sh
after_success: source ci_scripts/success.sh
5 changes: 4 additions & 1 deletion openml/flows/sklearn_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ def sklearn_to_flow(o, parent_model=None):
rval = o
elif isinstance(o, dict):
# TODO: explain what type of parameter is here
if not isinstance(o, OrderedDict):
o = OrderedDict([(key, value) for key, value in sorted(o.items())])

rval = OrderedDict()
for key, value in o.items():
if not isinstance(key, six.string_types):
Expand Down Expand Up @@ -133,7 +136,7 @@ def flow_to_sklearn(o, **kwargs):
else:
rval = OrderedDict((flow_to_sklearn(key, **kwargs),
flow_to_sklearn(value, **kwargs))
for key, value in o.items())
for key, value in sorted(o.items()))
elif isinstance(o, (list, tuple)):
rval = [flow_to_sklearn(element, **kwargs) for element in o]
if isinstance(o, tuple):
Expand Down
3 changes: 2 additions & 1 deletion tests/test_flows/test_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,8 @@ def test_sklearn_to_upload_to_flow(self):
y = iris.target

# Test a more complicated flow
ohe = sklearn.preprocessing.OneHotEncoder(categorical_features=[1])
ohe = sklearn.preprocessing.OneHotEncoder(categorical_features=[1],
handle_unknown='ignore')
scaler = sklearn.preprocessing.StandardScaler(with_mean=False)
pca = sklearn.decomposition.TruncatedSVD()
fs = sklearn.feature_selection.SelectPercentile(
Expand Down