Skip to content

Commit df3c137

Browse files
committed
address comments from shuhei
1 parent 02d4b37 commit df3c137

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

autoPyTorch/pipeline/components/preprocessing/tabular_preprocessing/feature_preprocessing/LibLinearSVCPreprocessor.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
from ConfigSpace.hyperparameters import (
99
CategoricalHyperparameter,
1010
UniformFloatHyperparameter,
11-
UniformIntegerHyperparameter
1211
)
1312

1413
import numpy as np
@@ -31,7 +30,7 @@ class LibLinearSVCPreprocessor(autoPyTorchFeaturePreprocessingComponent):
3130
def __init__(self, dual: bool = False, penalty: str = "l1",
3231
loss: str = "squared_hinge", tol: float = 1e-4,
3332
C: float = 1, multi_class: str = "ovr",
34-
intercept_scaling: int = 1, fit_intercept: bool = True,
33+
intercept_scaling: float = 1, fit_intercept: bool = True,
3534
random_state: Optional[np.random.RandomState] = None):
3635

3736
self.dual = dual
@@ -66,6 +65,7 @@ def get_components_kwargs(self) -> Dict[str, Any]:
6665

6766
def fit(self, X: Dict[str, Any], y: Any = None) -> BaseEstimator:
6867

68+
self.check_requirements(X, y)
6969
# TODO: add class_weights
7070
estimator = LinearSVC(**self.get_components_kwargs())
7171

@@ -77,7 +77,7 @@ def fit(self, X: Dict[str, Any], y: Any = None) -> BaseEstimator:
7777
@staticmethod
7878
def get_properties(dataset_properties: Optional[Dict[str, BaseDatasetPropertiesType]] = None) -> Dict[str, Any]:
7979
return {'shortname': 'LinearSVC Preprocessor',
80-
'name': 'Liblinear Support Vector Classification Preprocessing',
80+
'name': 'linear Support Vector Classification Preprocessing',
8181
'handles_sparse': True,
8282
'handles_classification': True,
8383
'handles_regression': False
@@ -129,7 +129,7 @@ def get_hyperparameter_search_space(
129129
add_hyperparameter(cs, dual, CategoricalHyperparameter)
130130
add_hyperparameter(cs, tol, UniformFloatHyperparameter)
131131
add_hyperparameter(cs, C, UniformFloatHyperparameter)
132-
add_hyperparameter(cs, intercept_scaling, UniformIntegerHyperparameter)
132+
add_hyperparameter(cs, intercept_scaling, UniformFloatHyperparameter)
133133

134134
cs.add_hyperparameters([loss_hp, penalty_hp])
135135
if "l1" in penalty_hp.choices and "hinge" in loss_hp.choices:

0 commit comments

Comments
 (0)