Skip to content

Commit

Permalink
Merge pull request #113 from automl/issue/112-smac-facade-class-name
Browse files Browse the repository at this point in the history
Issue/112 smac facade class name
  • Loading branch information
shukon authored Dec 27, 2019
2 parents 45e776f + 5b7d6e3 commit 01c2176
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
4 changes: 2 additions & 2 deletions pimp/evaluator/ablation.py
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ def plot_predicted_percentage(self, plot_name=None, show=True):
Method to plot a barchart of individual parameter contributions of the improvement from source to target
"""
p_names = np.array(list(self.evaluated_parameter_importance.keys())[1:-1])
p_names_short = np.array(self.shorten_unique(p_names))
p_names_short = np.array(shorten_unique(p_names))
p_importance = np.array([100 * self.evaluated_parameter_importance[p] for p in p_names])
max_to_plot = min(len(p_names), self.MAX_PARAMS_TO_PLOT)

Expand Down Expand Up @@ -579,7 +579,7 @@ def plot_predicted_performance(self, plot_name=None, show=True):
y_label = self.scenario.run_obj if self.scenario.run_obj != 'quality' else 'cost'

path = list(self.predicted_parameter_performances.keys())
path = np.array(self.shorten_unique(path))
path = np.array(shorten_unique(path))
max_to_plot = min(len(path), self.MAX_PARAMS_TO_PLOT)
performances = list(self.predicted_parameter_performances.values())
performances = np.array(performances).reshape((-1, 1))
Expand Down
3 changes: 1 addition & 2 deletions pimp/importance/importance.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
from smac.tae.execute_ta_run import StatusType
from tqdm import tqdm

from pimp.configspace import CategoricalHyperparameter, Configuration, \
impute_inactive_values
from pimp.configspace import CategoricalHyperparameter, Configuration, impute_inactive_values
from pimp.epm.base_epm import RandomForestWithInstances
from pimp.epm.unlogged_epar_x_rfwi import UnloggedEPARXrfi
from pimp.epm.unlogged_rfwi import Unloggedrfwi
Expand Down
7 changes: 6 additions & 1 deletion pimp/pimp.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
from typing import Union

import numpy as np
from smac.facade.smac_facade import SMAC
from smac.scenario.scenario import Scenario
from smac.runhistory.runhistory import RunHistory, RunKey
from smac.optimizer.objective import average_cost
Expand All @@ -21,6 +20,12 @@
from pimp.importance.importance import Importance
from pimp.utils.io.cmd_reader import CMDs

try:
from smac.facade.smac_ac_facade import SMAC4AC as SMAC
except ModuleNotFoundError:
# Backwards-compatibility for SMAC <= 0.10.0
from smac.facade.smac_facade import SMAC

__author__ = "Andre Biedenkapp"
__copyright__ = "Copyright 2016, ML4AAD"
__license__ = "3-clause BSD"
Expand Down

0 comments on commit 01c2176

Please sign in to comment.