Skip to content

Commit

Permalink
revert import statement to fix the patch
Browse files Browse the repository at this point in the history
  • Loading branch information
ravinkohli committed Jun 10, 2021
1 parent c1ac4a8 commit 6853a13
Showing 1 changed file with 18 additions and 14 deletions.
32 changes: 18 additions & 14 deletions autoPyTorch/evaluation/abstract_evaluator.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@
calculate_loss,
get_metrics,
)
from autoPyTorch.pipeline.image_classification import ImageClassificationPipeline
from autoPyTorch.pipeline.tabular_classification import TabularClassificationPipeline
from autoPyTorch.pipeline.tabular_regression import TabularRegressionPipeline
from autoPyTorch.pipeline.traditional_tabular_classification import TraditionalTabularClassificationPipeline
from autoPyTorch.pipeline.traditional_tabular_regression import TraditionalTabularRegressionPipeline
import autoPyTorch.pipeline.image_classification
import autoPyTorch.pipeline.tabular_classification
import autoPyTorch.pipeline.tabular_regression
import autoPyTorch.pipeline.traditional_tabular_classification
import autoPyTorch.pipeline.traditional_tabular_regression
from autoPyTorch.utils.common import subsampler
from autoPyTorch.utils.hyperparameter_search_space_update import HyperparameterSearchSpaceUpdates
from autoPyTorch.utils.logging_ import PicklableClientLogger, get_named_client_logger
Expand Down Expand Up @@ -80,8 +80,9 @@ def __init__(self, config: str,
self.dataset_properties = dataset_properties
self.random_state = random_state
self.init_params = init_params
self.pipeline = TraditionalTabularClassificationPipeline(dataset_properties=dataset_properties,
random_state=self.random_state)
self.pipeline = autoPyTorch.pipeline.traditional_tabular_classification. \
TraditionalTabularClassificationPipeline(dataset_properties=dataset_properties,
random_state=self.random_state)
configuration_space = self.pipeline.get_hyperparameter_search_space()
default_configuration = configuration_space.get_default_configuration().get_dictionary()
default_configuration['model_trainer:tabular_traditional_model:traditional_learner'] = config
Expand Down Expand Up @@ -119,7 +120,8 @@ def get_pipeline_representation(self) -> Dict[str, str]:

@staticmethod
def get_default_pipeline_options() -> Dict[str, Any]:
return TraditionalTabularClassificationPipeline.get_default_pipeline_options()
return autoPyTorch.pipeline.traditional_tabular_classification. \
TraditionalTabularClassificationPipeline.get_default_pipeline_options()


class MyTraditionalTabularRegressionPipeline(BaseEstimator):
Expand Down Expand Up @@ -148,8 +150,9 @@ def __init__(self, config: str,
self.dataset_properties = dataset_properties
self.random_state = random_state
self.init_params = init_params
self.pipeline = TraditionalTabularRegressionPipeline(dataset_properties=dataset_properties,
random_state=self.random_state)
self.pipeline = autoPyTorch.pipeline.traditional_tabular_regression. \
TraditionalTabularRegressionPipeline(dataset_properties=dataset_properties,
random_state=self.random_state)
configuration_space = self.pipeline.get_hyperparameter_search_space()
default_configuration = configuration_space.get_default_configuration().get_dictionary()
default_configuration['model_trainer:tabular_traditional_model:traditional_learner'] = config
Expand Down Expand Up @@ -182,7 +185,8 @@ def get_pipeline_representation(self) -> Dict[str, str]:

@staticmethod
def get_default_pipeline_options() -> Dict[str, Any]:
return TraditionalTabularRegressionPipeline.get_default_pipeline_options()
return autoPyTorch.pipeline.traditional_tabular_regression.\
TraditionalTabularRegressionPipeline.get_default_pipeline_options()


class DummyClassificationPipeline(DummyClassifier):
Expand Down Expand Up @@ -456,7 +460,7 @@ def __init__(self, backend: Backend,
elif isinstance(self.configuration, str):
self.pipeline_class = MyTraditionalTabularRegressionPipeline
elif isinstance(self.configuration, Configuration):
self.pipeline_class = TabularRegressionPipeline
self.pipeline_class = autoPyTorch.pipeline.tabular_regression.TabularRegressionPipeline
else:
raise ValueError('task {} not available'.format(self.task_type))
self.predict_function = self._predict_regression
Expand All @@ -470,9 +474,9 @@ def __init__(self, backend: Backend,
raise ValueError("Only tabular tasks are currently supported with traditional methods")
elif isinstance(self.configuration, Configuration):
if self.task_type in TABULAR_TASKS:
self.pipeline_class = TabularClassificationPipeline
self.pipeline_class = autoPyTorch.pipeline.tabular_classification.TabularClassificationPipeline
elif self.task_type in IMAGE_TASKS:
self.pipeline_class = ImageClassificationPipeline
self.pipeline_class = autoPyTorch.pipeline.image_classification.ImageClassificationPipeline
else:
raise ValueError('task {} not available'.format(self.task_type))
self.predict_function = self._predict_proba
Expand Down

0 comments on commit 6853a13

Please sign in to comment.