Skip to content

Commit 7efc5e2

Browse files
authored
Merge pull request #998 from automl/development
Release 0.11
2 parents 7a3f3a5 + 9e04bd8 commit 7efc5e2

File tree

625 files changed

+60818
-63014
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

625 files changed

+60818
-63014
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ matrix:
2323
- os: linux
2424
env: DISTRIB="conda" DOCPUSH="true" PYTHON="3.7" SKIP_TESTS="true"
2525
- os: linux
26-
env: DISTRIB="conda" RUN_FLAKE8="true" SKIP_TESTS="true"
26+
env: DISTRIB="conda" PYTHON="3.8" RUN_FLAKE8="true" SKIP_TESTS="true"
2727
- os: linux
28-
env: DISTRIB="conda" RUN_MYPY="true" SKIP_TESTS="true"
28+
env: DISTRIB="conda" PYTHON="3.8" RUN_MYPY="true" SKIP_TESTS="true"
2929
- os: linux
3030
env: DISTRIB="conda" COVERAGE="true" PYTHON="3.6"
3131
- os: linux

autosklearn/__version__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
"""Version information."""
22

33
# The following line *must* be the last in the module, exactly as formatted:
4-
__version__ = "0.10.0"
4+
__version__ = "0.11.0"

autosklearn/automl.py

Lines changed: 162 additions & 99 deletions
Large diffs are not rendered by default.

autosklearn/data/abstract_data_manager.py

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -75,34 +75,6 @@ def encoder(self) -> DataPreprocessor:
7575
def encoder(self, value: DataPreprocessor) -> DataPreprocessor:
7676
self._encoder = value
7777

78-
def perform1HotEncoding(self) -> None:
79-
sparse = True if self.info['is_sparse'] == 1 else False
80-
has_missing = True if self.info['has_missing'] else False
81-
to_encode = ['categorical']
82-
if has_missing:
83-
to_encode += ['binary']
84-
encoding_mask = [feat_type.lower() in to_encode
85-
for feat_type in self.feat_type]
86-
87-
data = [self.data['X_train']]
88-
if 'X_valid' in self.data:
89-
data.append(self.data['X_valid'])
90-
if 'X_test' in self.data:
91-
data.append(self.data['X_test'])
92-
data, sparse = perform_one_hot_encoding(
93-
sparse=sparse, categorical=encoding_mask,
94-
data=data)
95-
96-
self.info['is_sparse'] = 1 if sparse else 0
97-
self.data['X_train'] = data[0]
98-
if 'X_valid' in self.data and 'X_test' in self.data:
99-
self.data['X_valid'] = data[1]
100-
self.data['X_test'] = data[2]
101-
elif 'X_valid' in self.data:
102-
self.data['X_valid'] = data[1]
103-
elif 'X_test' in self.data:
104-
self.data['X_test'] = data[1]
105-
10678
def __repr__(self) -> str:
10779
return 'DataManager : ' + self.name
10880

autosklearn/data/validation.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# -*- encoding: utf-8 -*-
22

3+
import functools
34
import warnings
45
from typing import List, Optional, Tuple, Union
56

@@ -365,6 +366,25 @@ def _check_and_encode_features(
365366
assert self.feature_encoder is not None
366367
self.feature_encoder.fit(X)
367368

369+
# The column transformer reoders the feature types - we therefore need to change
370+
# it as well
371+
def comparator(cmp1, cmp2):
372+
if (
373+
cmp1 == 'categorical' and cmp2 == 'categorical'
374+
or cmp1 == 'numerical' and cmp2 == 'numerical'
375+
):
376+
return 0
377+
elif cmp1 == 'categorical' and cmp2 == 'numerical':
378+
return -1
379+
elif cmp1 == 'numerical' and cmp2 == 'categorical':
380+
return 1
381+
else:
382+
raise ValueError((cmp1, cmp2))
383+
self.feature_types = sorted(
384+
self.feature_types,
385+
key=functools.cmp_to_key(comparator)
386+
)
387+
368388
if self.feature_encoder:
369389
try:
370390
X = self.feature_encoder.transform(X)

0 commit comments

Comments
 (0)