Skip to content

Commit 8cfa03e

Browse files
committed
Merge branch 'development' of ssh://github.com/automl/auto-sklearn into development
2 parents d0ea13a + de757e6 commit 8cfa03e

File tree

10 files changed

+362
-77
lines changed

10 files changed

+362
-77
lines changed

autosklearn/estimators.py

Lines changed: 57 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,7 @@ def refit(self, X, y):
5353
def fit_ensemble(self, y, task=None, metric=None, precision='32',
5454
dataset_name=None, ensemble_nbest=None,
5555
ensemble_size=None):
56-
"""Build the ensemble.
5756

58-
This method only needs to be called in the parallel mode.
59-
60-
Returns
61-
-------
62-
self
63-
64-
"""
6557
return self._automl.fit_ensemble(y, task, metric, precision,
6658
dataset_name, ensemble_nbest,
6759
ensemble_size)
@@ -225,6 +217,16 @@ def __init__(self,
225217
an ensemble.
226218
* ``'model'`` : do not save any model files
227219
220+
configuration_mode : ``SMAC`` or ``ROAR``
221+
Defines the configuration mode as described in the paper
222+
`Sequential Model-Based Optimization for General Algorithm
223+
Configuration <http://aad.informatik.uni-freiburg.de/papers/11-LION5-SMAC.pdf>`_:
224+
225+
* ``SMAC`` (default): Sequential Model-based Algorithm
226+
Configuration, which is a Bayesian optimization algorithm
227+
* ``ROAR``: Random Online Aggressive Racing, which is basically
228+
random search
229+
228230
Attributes
229231
----------
230232
@@ -305,6 +307,46 @@ def fit(self, *args, **kwargs):
305307
def fit_ensemble(self, y, task=None, metric=None, precision='32',
306308
dataset_name=None, ensemble_nbest=None,
307309
ensemble_size=None):
310+
"""Fit an ensemble to models trained during an optimization process.
311+
312+
All parameters are ``None`` by default. If no other value is given,
313+
the default values which were set in a call to ``fit()`` are used.
314+
315+
Parameters
316+
----------
317+
y : array-like
318+
Target values.
319+
320+
task : int
321+
A constant from the module ``autosklearn.constants``. Determines
322+
the task type (binary classification, multiclass classification,
323+
multilabel classification or regression).
324+
325+
metric : callable, optional (default='acc_metric')
326+
An instance of :class:`autosklearn.metrics.Scorer` as created by
327+
:meth:`autosklearn.metrics.make_scorer`. These are the `Built-in
328+
Metrics`_.
329+
330+
precision : str
331+
Numeric precision used when loading ensemble data. Can be either
332+
``'16'``, ``'32'`` or ``'64'``.
333+
334+
dataset_name : str
335+
Name of the current data set.
336+
337+
ensemble_nbest : int
338+
Determines how many models should be considered from the ensemble
339+
building. This is inspired by a concept called library pruning
340+
introduced in `Getting Most out of Ensemble Selection`.
341+
342+
ensemble_size : int
343+
Size of the ensemble built by `Ensomble Selection`.
344+
345+
Returns
346+
-------
347+
self
348+
349+
"""
308350
if self._automl is None:
309351
self._automl = self.build_automl()
310352
return self._automl.fit_ensemble(y, task, metric, precision,
@@ -338,12 +380,17 @@ def fit(self, X, y,
338380
The target classes.
339381
340382
metric : callable, optional (default='acc_metric')
341-
An instance of ``autosklearn.metrics.Scorer``.
383+
An instance of :class:`autosklearn.metrics.Scorer` as created by
384+
:meth:`autosklearn.metrics.make_scorer`. These are the `Built-in
385+
Metrics`_.
342386
343387
feat_type : list, optional (default=None)
344388
List of str of `len(X.shape[1])` describing the attribute type.
345389
Possible types are `Categorical` and `Numerical`. `Categorical`
346-
attributes will be automatically One-Hot encoded.
390+
attributes will be automatically One-Hot encoded. The values
391+
used for a categorical attribute must be integers, obtainde for
392+
example by `sklearn.preprocessing.LabelEncoder
393+
<http://scikit-learn.org/stable/modules/generated/sklearn.preprocessing.LabelEncoder.html>`_.
347394
348395
dataset_name : str, optional (default=None)
349396
Create nicer output. If None, a string will be determined by the

autosklearn/metrics/__init__.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -137,12 +137,10 @@ def make_scorer(name, score_func, greater_is_better=True, needs_proba=False,
137137
needs_threshold=False, **kwargs):
138138
"""Make a scorer from a performance metric or loss function.
139139
140-
Factory inspired by scikit-learn which wraps scoring functions to be used in
141-
auto-sklearn. In difference to scikit-learn, auto-sklearn always needs to
142-
call ``predict_proba`` in order to have predictions on a seperate validation
143-
set to build ensembles with.
140+
Factory inspired by scikit-learn which wraps scikit-learn scoring functions
141+
to be used in auto-sklearn.
144142
145-
Paramaters
143+
Parameters
146144
----------
147145
score_func : callable
148146
Score function (or loss function) with signature

doc/api.rst

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,93 @@
55
APIs
66
****
77

8+
============
89
Main modules
910
============
1011

12+
~~~~~~~~~~~~~~
1113
Classification
1214
~~~~~~~~~~~~~~
1315

1416
.. autoclass:: autosklearn.classification.AutoSklearnClassifier
1517
:members:
1618
:inherited-members: show_models, fit_ensemble, refit
1719

20+
~~~~~~~~~~
1821
Regression
1922
~~~~~~~~~~
2023

2124
.. autoclass:: autosklearn.regression.AutoSklearnRegressor
2225
:members:
2326
:inherited-members: show_models, fit_ensemble, refit
2427

28+
=======
29+
Metrics
30+
=======
31+
32+
.. autofunction:: autosklearn.metrics.make_scorer
33+
34+
~~~~~~~~~~~~~~~~
35+
Built-in Metrics
36+
~~~~~~~~~~~~~~~~
37+
38+
Classification
39+
~~~~~~~~~~~~~~
40+
41+
.. autoclass:: autosklearn.metrics.accuracy
42+
43+
.. autoclass:: autosklearn.metrics.balanced_accuracy
44+
45+
.. autoclass:: autosklearn.metrics.f1
46+
47+
.. autoclass:: autosklearn.metrics.f1_macro
48+
49+
.. autoclass:: autosklearn.metrics.f1_micro
50+
51+
.. autoclass:: autosklearn.metrics.f1_samples
52+
53+
.. autoclass:: autosklearn.metrics.f1_weighted
54+
55+
.. autoclass:: autosklearn.metrics.roc_auc
56+
57+
.. autoclass:: autosklearn.metrics.precision
58+
59+
.. autoclass:: autosklearn.metrics.precision_macro
60+
61+
.. autoclass:: autosklearn.metrics.precision_micro
62+
63+
.. autoclass:: autosklearn.metrics.precision_samples
64+
65+
.. autoclass:: autosklearn.metrics.precision_weighted
66+
67+
.. autoclass:: autosklearn.metrics.average_precision
68+
69+
.. autoclass:: autosklearn.metrics.recall
70+
71+
.. autoclass:: autosklearn.metrics.recall_macro
72+
73+
.. autoclass:: autosklearn.metrics.recall_micro
74+
75+
.. autoclass:: autosklearn.metrics.recall_samples
76+
77+
.. autoclass:: autosklearn.metrics.recall_weighted
78+
79+
.. autoclass:: autosklearn.metrics.log_loss
80+
81+
.. autoclass:: autosklearn.metrics.pac_score
82+
83+
Regression
84+
~~~~~~~~~~
85+
86+
.. autoclass:: autosklearn.metrics.r2
87+
88+
.. autoclass:: autosklearn.metrics.mean_squared_error
89+
90+
.. autoclass:: autosklearn.metrics.mean_absolute_error
91+
92+
.. autoclass:: autosklearn.metrics.median_absolute_error
93+
94+
====================
2595
Extension Interfaces
2696
====================
2797

doc/conf.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,11 @@
131131
# be in the form [(name, page), ..]
132132
'navbar_links': [
133133
('Start', 'index'),
134+
('Releases', 'releases'),
135+
('Installation', 'installation'),
136+
('Manual', 'manual'),
134137
('API', 'api'),
135138
('Extending', 'extending'),
136-
('Manual', 'manual'),
137139
],
138140

139141
# Render the next and previous page links in navbar. (Default: true)

doc/extending.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Extending auto-sklearn
88

99
auto-sklearn can be easily extended with new classification, regression and
1010
feature preprocessing methods. In order to do so, a user has to implement a
11-
wrapper class and make it known to auto-sklearn. This manual will walk you
11+
wrapper class and register it to auto-sklearn. This manual will walk you
1212
through the process.
1313

1414

doc/index.rst

Lines changed: 5 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,7 @@ Example
3030
>>> import sklearn.model_selection
3131
>>> import sklearn.datasets
3232
>>> import sklearn.metrics
33-
>>> digits = sklearn.datasets.load_digits()
34-
>>> X = digits.data
35-
>>> y = digits.target
33+
>>> X, y = sklearn.datasets.load_digits(return_X_y=True)
3634
>>> X_train, X_test, y_train, y_test = \
3735
sklearn.model_selection.train_test_split(X, y, random_state=1)
3836
>>> automl = autosklearn.classification.AutoSklearnClassifier()
@@ -44,34 +42,12 @@ Example
4442
This will run for one hour should result in an accuracy above 0.98.
4543

4644

47-
Installation
48-
************
49-
**Prerequisities**: *auto-sklearn* is written in python and was developed
50-
with Ubuntu. It should run on other Linux distributions, but won't work on a MAC
51-
or on a windows PC. We aim to always support the two latests python versions,
52-
which are 3.4 and 3.5 at the moment. It is built around scikit-learn 0.17.1 and
53-
needs a compiler for C++ 11.
54-
55-
Please install all dependencies manually with:
56-
57-
.. code:: bash
58-
59-
curl https://raw.githubusercontent.com/automl/auto-sklearn/master/requirements.txt | xargs -n 1 -L 1 pip install
60-
61-
Then install *auto-sklearn*
62-
63-
.. code:: bash
64-
65-
pip install auto-sklearn
66-
67-
We recommend installing *auto-sklearn* into a `virtual environment
68-
<http://docs.python-guide.org/en/latest/dev/virtualenvs/>`_.
69-
7045
Manual
7146
******
7247

73-
* :ref:`API`
48+
* :ref:`installation`
7449
* :ref:`manual`
50+
* :ref:`API`
7551
* :ref:`extending`
7652

7753

@@ -108,7 +84,7 @@ references to the following paper:
10884
Contributing
10985
************
11086

111-
We appreciate all contribution to auto-sklearn, from bug reports,
87+
We appreciate all contribution to auto-sklearn, from bug reports and
11288
documentation to new features. If you want to contribute to the code, you can
11389
pick an issue from the `issue tracker <https://github.com/automl/auto-sklearn/issues>`_
11490
which is marked with `Needs contributer`.
@@ -121,24 +97,5 @@ which is marked with `Needs contributer`.
12197
.com/automl/auto-sklearn/issues>`_ before starting to work.
12298

12399
When developing new features, please create a new branch from the development
124-
branch. Prior to submitting a pull request, make sure that all tests are
100+
branch. When to submitting a pull request, make sure that all tests are
125101
still passing.
126-
127-
Contributors
128-
************
129-
130-
* Matthias Feurer
131-
* Katharina Eggensperger
132-
* Jost Tobias Springenberg
133-
* Aaron Klein
134-
* Anatolii Domashnev
135-
* Alexander Sapronov
136-
* Stefan Falkner
137-
* Manuel Blum
138-
* Hector Mendoza
139-
* Farooq Ahmed Zuberi
140-
* Frank Hutter
141-
* Diego Kobylkin
142-
* Marius Lindauer
143-
144-

0 commit comments

Comments
 (0)