Skip to content

Commit

Permalink
Fix linters
Browse files Browse the repository at this point in the history
  • Loading branch information
fraimondo committed May 2, 2024
1 parent 83ce5bd commit 030a439
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions julearn/model_selection/_optuna_searcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@


try:
import optuna.distributions as optd
from optuna_integration.sklearn import OptunaSearchCV
import optuna.distributions as od
except ImportError:
from sklearn.model_selection._search import BaseSearchCV

Expand Down Expand Up @@ -61,14 +61,14 @@ def _prepare_optuna_hyperparameters_distributions(
if isinstance(v, tuple) and len(v) == 3:
if v[2] == "uniform":
if isinstance(v[0], int) and isinstance(v[1], int):
out[k] = od.IntDistribution(v[0], v[1], log=False)
out[k] = optd.IntDistribution(v[0], v[1], log=False)
else:
out[k] = od.FloatDistribution(v[0], v[1], log=False)
out[k] = optd.FloatDistribution(v[0], v[1], log=False)
elif v[2] in ("loguniform", "log-uniform"):
if isinstance(v[0], int) and isinstance(v[1], int):
out[k] = od.IntDistribution(v[0], v[1], log=True)
out[k] = optd.IntDistribution(v[0], v[1], log=True)
else:
out[k] = od.FloatDistribution(v[0], v[1], log=True)
out[k] = optd.FloatDistribution(v[0], v[1], log=True)
else:
out[k] = v
else:
Expand Down
4 changes: 2 additions & 2 deletions julearn/pipeline/pipeline_creator.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
from sklearn.pipeline import Pipeline

from ..base import ColumnTypes, ColumnTypesLike, JuTransformer, WrapModel
from ..model_selection.available_searchers import get_searcher, list_searchers
from ..model_selection._optuna_searcher import (
_prepare_optuna_hyperparameters_distributions
_prepare_optuna_hyperparameters_distributions,
)
from ..model_selection.available_searchers import get_searcher, list_searchers
from ..models import get_model, list_models
from ..prepare import prepare_search_params
from ..transformers import (
Expand Down

0 comments on commit 030a439

Please sign in to comment.