Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compatibility fixes for newer sklearn and configspace #6

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
2 changes: 0 additions & 2 deletions openmlpimp/plot/kde.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@
import openmlpimp
import os
import matplotlib.pyplot as plt
import warnings

from scipy.stats import rv_discrete

import autosklearn.constants
from ConfigSpace.hyperparameters import CategoricalHyperparameter, NumericalHyperparameter
from autosklearn.util.pipeline import get_configuration_space

Expand Down
6 changes: 3 additions & 3 deletions openmlpimp/utils/config_space.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ def get_config_space_casualnames(classifier, fixed_parameters=None):
continue

if isinstance(hyperparameter, ConfigSpace.CategoricalHyperparameter):
config_space_prime.add_hyperparameter(ConfigSpace.CategoricalHyperparameter(casualname, hyperparameter.choices, default=hyperparameter.default))
config_space_prime.add_hyperparameter(ConfigSpace.CategoricalHyperparameter(casualname, hyperparameter.choices, default_value=hyperparameter.default_value))
elif isinstance(hyperparameter, ConfigSpace.UniformIntegerHyperparameter):
config_space_prime.add_hyperparameter(ConfigSpace.UniformIntegerHyperparameter(casualname, hyperparameter.lower, hyperparameter.upper, log=hyperparameter.log, default=hyperparameter.default))
config_space_prime.add_hyperparameter(ConfigSpace.UniformIntegerHyperparameter(casualname, hyperparameter.lower, hyperparameter.upper, log=hyperparameter.log, default_value=hyperparameter.default_value))
elif isinstance(hyperparameter, ConfigSpace.UniformFloatHyperparameter):
config_space_prime.add_hyperparameter(ConfigSpace.UniformFloatHyperparameter(casualname, hyperparameter.lower, hyperparameter.upper, log=hyperparameter.log, default=hyperparameter.default))
config_space_prime.add_hyperparameter(ConfigSpace.UniformFloatHyperparameter(casualname, hyperparameter.lower, hyperparameter.upper, log=hyperparameter.log, default_value=hyperparameter.default_value))
else:
raise ValueError()
return config_space_prime
2 changes: 1 addition & 1 deletion openmlpimp/utils/connect.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

from openml.exceptions import OpenMLServerException

from ConfigSpace.io.pcs_new import write
from ConfigSpace.read_and_write.pcs_new import write
from ConfigSpace.hyperparameters import CategoricalHyperparameter, UniformFloatHyperparameter, \
UniformIntegerHyperparameter

Expand Down
2 changes: 1 addition & 1 deletion openmlpimp/utils/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from sklearn.model_selection._split import check_cv
from sklearn.model_selection._validation import _fit_and_score
from sklearn.externals.joblib import Parallel, delayed
from sklearn.utils.fixes import rankdata
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is deprecated and probably shouldn't be used. Why are you using this? You want to support old versions of scipy? That seems odd...

from sklearn.utils.stats import rankdata
from sklearn.utils.fixes import MaskedArray
from sklearn.utils.validation import indexable
from sklearn.metrics.scorer import check_scoring
Expand Down