Search is not available for this dataset
repo
stringlengths
2
152
⌀
file
stringlengths
15
239
code
stringlengths
0
58.4M
file_length
int64
0
58.4M
avg_line_length
float64
0
1.81M
max_line_length
int64
0
12.7M
extension_type
stringclasses
364 values
auto-sklearn
auto-sklearn-master/autosklearn/pipeline/components/feature_preprocessing/__init__.py
from typing import Optional, Type import os from collections import OrderedDict from ConfigSpace.configuration_space import ConfigurationSpace from ConfigSpace.hyperparameters import CategoricalHyperparameter from autosklearn.askl_typing import FEAT_TYPE_TYPE from ..base import ( AutoSklearnChoice, AutoSkle...
5,180
33.085526
87
py
auto-sklearn
auto-sklearn-master/autosklearn/pipeline/components/feature_preprocessing/densifier.py
from typing import Optional from ConfigSpace.configuration_space import ConfigurationSpace from autosklearn.askl_typing import FEAT_TYPE_TYPE from autosklearn.pipeline.components.base import AutoSklearnPreprocessingAlgorithm from autosklearn.pipeline.constants import DENSE, INPUT, SPARSE, UNSIGNED_DATA class Densif...
1,374
28.255319
82
py
auto-sklearn
auto-sklearn-master/autosklearn/pipeline/components/feature_preprocessing/extra_trees_preproc_for_classification.py
from typing import Optional from ConfigSpace.configuration_space import ConfigurationSpace from ConfigSpace.hyperparameters import ( CategoricalHyperparameter, Constant, UniformFloatHyperparameter, UniformIntegerHyperparameter, UnParametrizedHyperparameter, ) from autosklearn.askl_typing import FE...
6,035
32.910112
82
py
auto-sklearn
auto-sklearn-master/autosklearn/pipeline/components/feature_preprocessing/extra_trees_preproc_for_regression.py
from typing import Optional import numpy as np from ConfigSpace.configuration_space import ConfigurationSpace from ConfigSpace.hyperparameters import ( CategoricalHyperparameter, Constant, UniformFloatHyperparameter, UniformIntegerHyperparameter, UnParametrizedHyperparameter, ) from autosklearn.as...
5,839
32.563218
82
py
auto-sklearn
auto-sklearn-master/autosklearn/pipeline/components/feature_preprocessing/fast_ica.py
from typing import Optional import warnings from ConfigSpace.conditions import EqualsCondition from ConfigSpace.configuration_space import ConfigurationSpace from ConfigSpace.hyperparameters import ( CategoricalHyperparameter, UniformIntegerHyperparameter, ) from autosklearn.askl_typing import FEAT_TYPE_TYPE...
3,377
33.469388
85
py
auto-sklearn
auto-sklearn-master/autosklearn/pipeline/components/feature_preprocessing/feature_agglomeration.py
from typing import Optional import numpy as np from ConfigSpace.configuration_space import ConfigurationSpace from ConfigSpace.forbidden import ( ForbiddenAndConjunction, ForbiddenEqualsClause, ForbiddenInClause, ) from ConfigSpace.hyperparameters import ( CategoricalHyperparameter, UniformIntegerH...
3,144
33.184783
87
py
auto-sklearn
auto-sklearn-master/autosklearn/pipeline/components/feature_preprocessing/kernel_pca.py
from typing import Optional import warnings import numpy as np from ConfigSpace.conditions import EqualsCondition, InCondition from ConfigSpace.configuration_space import ConfigurationSpace from ConfigSpace.hyperparameters import ( CategoricalHyperparameter, UniformFloatHyperparameter, UniformIntegerHyper...
4,046
34.5
86
py
auto-sklearn
auto-sklearn-master/autosklearn/pipeline/components/feature_preprocessing/kitchen_sinks.py
from typing import Optional, Union from ConfigSpace.configuration_space import ConfigurationSpace from ConfigSpace.hyperparameters import ( UniformFloatHyperparameter, UniformIntegerHyperparameter, ) from numpy.random import RandomState from autosklearn.askl_typing import FEAT_TYPE_TYPE from autosklearn.pipel...
2,777
31.682353
87
py
auto-sklearn
auto-sklearn-master/autosklearn/pipeline/components/feature_preprocessing/liblinear_svc_preprocessor.py
from typing import Optional from ConfigSpace.configuration_space import ConfigurationSpace from ConfigSpace.forbidden import ForbiddenAndConjunction, ForbiddenEqualsClause from ConfigSpace.hyperparameters import ( CategoricalHyperparameter, Constant, UniformFloatHyperparameter, ) from autosklearn.askl_typ...
4,173
32.126984
88
py
auto-sklearn
auto-sklearn-master/autosklearn/pipeline/components/feature_preprocessing/no_preprocessing.py
from typing import Optional from ConfigSpace.configuration_space import ConfigurationSpace from autosklearn.askl_typing import FEAT_TYPE_TYPE from autosklearn.pipeline.components.base import AutoSklearnPreprocessingAlgorithm from autosklearn.pipeline.constants import DENSE, INPUT, SPARSE, UNSIGNED_DATA class NoPrep...
1,395
30.022222
82
py
auto-sklearn
auto-sklearn-master/autosklearn/pipeline/components/feature_preprocessing/nystroem_sampler.py
from typing import Optional from ConfigSpace.conditions import EqualsCondition, InCondition from ConfigSpace.configuration_space import ConfigurationSpace from ConfigSpace.hyperparameters import ( CategoricalHyperparameter, UniformFloatHyperparameter, UniformIntegerHyperparameter, ) from autosklearn.askl_...
4,578
32.918519
85
py
auto-sklearn
auto-sklearn-master/autosklearn/pipeline/components/feature_preprocessing/pca.py
from typing import Optional import numpy as np from ConfigSpace.configuration_space import ConfigurationSpace from ConfigSpace.hyperparameters import ( CategoricalHyperparameter, UniformFloatHyperparameter, ) from autosklearn.askl_typing import FEAT_TYPE_TYPE from autosklearn.pipeline.components.base import A...
2,404
31.945205
82
py
auto-sklearn
auto-sklearn-master/autosklearn/pipeline/components/feature_preprocessing/polynomial.py
from typing import Optional from ConfigSpace.configuration_space import ConfigurationSpace from ConfigSpace.hyperparameters import ( CategoricalHyperparameter, UniformIntegerHyperparameter, ) from autosklearn.askl_typing import FEAT_TYPE_TYPE from autosklearn.pipeline.components.base import AutoSklearnPreproc...
2,590
33.092105
82
py
auto-sklearn
auto-sklearn-master/autosklearn/pipeline/components/feature_preprocessing/random_trees_embedding.py
from typing import Optional from ConfigSpace.configuration_space import ConfigurationSpace from ConfigSpace.hyperparameters import ( CategoricalHyperparameter, Constant, UniformIntegerHyperparameter, UnParametrizedHyperparameter, ) from autosklearn.askl_typing import FEAT_TYPE_TYPE from autosklearn.pi...
4,586
33.488722
84
py
auto-sklearn
auto-sklearn-master/autosklearn/pipeline/components/feature_preprocessing/select_percentile.py
class SelectPercentileBase(object): def fit(self, X, y): import sklearn.feature_selection self.preprocessor = sklearn.feature_selection.SelectPercentile( score_func=self.score_func, percentile=self.percentile ) self.preprocessor.fit(X, y) return self def tr...
590
30.105263
82
py
auto-sklearn
auto-sklearn-master/autosklearn/pipeline/components/feature_preprocessing/select_percentile_classification.py
from typing import Optional from functools import partial from ConfigSpace.configuration_space import ConfigurationSpace from ConfigSpace.hyperparameters import ( CategoricalHyperparameter, Constant, UniformFloatHyperparameter, ) from autosklearn.askl_typing import FEAT_TYPE_TYPE from autosklearn.pipelin...
4,591
32.518248
85
py
auto-sklearn
auto-sklearn-master/autosklearn/pipeline/components/feature_preprocessing/select_percentile_regression.py
from typing import Optional from functools import partial from ConfigSpace.configuration_space import ConfigurationSpace from ConfigSpace.hyperparameters import ( CategoricalHyperparameter, UniformFloatHyperparameter, ) from autosklearn.askl_typing import FEAT_TYPE_TYPE from autosklearn.pipeline.components.b...
2,527
33.630137
85
py
auto-sklearn
auto-sklearn-master/autosklearn/pipeline/components/feature_preprocessing/select_rates_classification.py
from typing import Optional from functools import partial from ConfigSpace import NotEqualsCondition from ConfigSpace.configuration_space import ConfigurationSpace from ConfigSpace.hyperparameters import ( CategoricalHyperparameter, UniformFloatHyperparameter, ) from autosklearn.askl_typing import FEAT_TYPE_...
5,098
32.768212
86
py
auto-sklearn
auto-sklearn-master/autosklearn/pipeline/components/feature_preprocessing/select_rates_regression.py
from typing import Optional from functools import partial from ConfigSpace import NotEqualsCondition from ConfigSpace.configuration_space import ConfigurationSpace from ConfigSpace.hyperparameters import ( CategoricalHyperparameter, UniformFloatHyperparameter, ) from autosklearn.askl_typing import FEAT_TYPE_...
4,039
32.94958
86
py
auto-sklearn
auto-sklearn-master/autosklearn/pipeline/components/feature_preprocessing/truncatedSVD.py
from typing import Optional from ConfigSpace.configuration_space import ConfigurationSpace from ConfigSpace.hyperparameters import UniformIntegerHyperparameter from autosklearn.askl_typing import FEAT_TYPE_TYPE from autosklearn.pipeline.components.base import AutoSklearnPreprocessingAlgorithm from autosklearn.pipelin...
2,229
34.396825
102
py
auto-sklearn
auto-sklearn-master/autosklearn/pipeline/components/regression/__init__.py
from typing import Type import os from collections import OrderedDict from ConfigSpace.configuration_space import ConfigurationSpace from ConfigSpace.hyperparameters import CategoricalHyperparameter from autosklearn.askl_typing import FEAT_TYPE_TYPE from ..base import ( AutoSklearnChoice, AutoSklearnRegress...
5,353
32.049383
83
py
auto-sklearn
auto-sklearn-master/autosklearn/pipeline/components/regression/adaboost.py
from typing import Optional from ConfigSpace.configuration_space import ConfigurationSpace from ConfigSpace.hyperparameters import ( CategoricalHyperparameter, UniformFloatHyperparameter, UniformIntegerHyperparameter, ) from autosklearn.askl_typing import FEAT_TYPE_TYPE from autosklearn.pipeline.component...
3,133
33.43956
88
py
auto-sklearn
auto-sklearn-master/autosklearn/pipeline/components/regression/ard_regression.py
from typing import Optional from ConfigSpace.configuration_space import ConfigurationSpace from ConfigSpace.hyperparameters import ( UniformFloatHyperparameter, UnParametrizedHyperparameter, ) from autosklearn.askl_typing import FEAT_TYPE_TYPE from autosklearn.pipeline.components.base import AutoSklearnRegres...
4,454
28.7
79
py
auto-sklearn
auto-sklearn-master/autosklearn/pipeline/components/regression/decision_tree.py
from typing import Optional import numpy as np from ConfigSpace.configuration_space import ConfigurationSpace from ConfigSpace.hyperparameters import ( CategoricalHyperparameter, Constant, UniformFloatHyperparameter, UniformIntegerHyperparameter, UnParametrizedHyperparameter, ) from autosklearn.as...
4,904
34.035714
84
py
auto-sklearn
auto-sklearn-master/autosklearn/pipeline/components/regression/extra_trees.py
from typing import Optional from ConfigSpace.configuration_space import ConfigurationSpace from ConfigSpace.hyperparameters import ( CategoricalHyperparameter, UniformFloatHyperparameter, UniformIntegerHyperparameter, UnParametrizedHyperparameter, ) from autosklearn.askl_typing import FEAT_TYPE_TYPE f...
6,625
31.965174
84
py
auto-sklearn
auto-sklearn-master/autosklearn/pipeline/components/regression/gaussian_process.py
from typing import Optional from ConfigSpace.configuration_space import ConfigurationSpace from ConfigSpace.hyperparameters import UniformFloatHyperparameter from autosklearn.askl_typing import FEAT_TYPE_TYPE from autosklearn.pipeline.components.base import AutoSklearnRegressionAlgorithm from autosklearn.pipeline.con...
2,850
31.770115
84
py
auto-sklearn
auto-sklearn-master/autosklearn/pipeline/components/regression/gradient_boosting.py
from typing import Optional import numpy as np from ConfigSpace.conditions import EqualsCondition, InCondition from ConfigSpace.configuration_space import ConfigurationSpace from ConfigSpace.hyperparameters import ( CategoricalHyperparameter, Constant, UniformFloatHyperparameter, UniformIntegerHyperpar...
8,105
33.202532
85
py
auto-sklearn
auto-sklearn-master/autosklearn/pipeline/components/regression/k_nearest_neighbors.py
from typing import Optional from ConfigSpace.configuration_space import ConfigurationSpace from ConfigSpace.hyperparameters import ( CategoricalHyperparameter, UniformIntegerHyperparameter, ) from autosklearn.askl_typing import FEAT_TYPE_TYPE from autosklearn.pipeline.components.base import AutoSklearnRegress...
2,378
31.148649
84
py
auto-sklearn
auto-sklearn-master/autosklearn/pipeline/components/regression/liblinear_svr.py
from typing import Optional from ConfigSpace.configuration_space import ConfigurationSpace from ConfigSpace.forbidden import ForbiddenAndConjunction, ForbiddenEqualsClause from ConfigSpace.hyperparameters import ( CategoricalHyperparameter, Constant, UniformFloatHyperparameter, ) from autosklearn.askl_typ...
3,916
31.106557
88
py
auto-sklearn
auto-sklearn-master/autosklearn/pipeline/components/regression/libsvm_svr.py
from typing import Optional import resource import sys from ConfigSpace.conditions import EqualsCondition, InCondition from ConfigSpace.configuration_space import ConfigurationSpace from ConfigSpace.hyperparameters import ( CategoricalHyperparameter, UniformFloatHyperparameter, UniformIntegerHyperparamete...
6,771
31.401914
86
py
auto-sklearn
auto-sklearn-master/autosklearn/pipeline/components/regression/mlp.py
from typing import Optional import numpy as np from ConfigSpace.conditions import InCondition from ConfigSpace.configuration_space import ConfigurationSpace from ConfigSpace.hyperparameters import ( CategoricalHyperparameter, Constant, UniformFloatHyperparameter, UniformIntegerHyperparameter, UnPar...
11,159
34.205047
87
py
auto-sklearn
auto-sklearn-master/autosklearn/pipeline/components/regression/random_forest.py
from typing import Optional from ConfigSpace.configuration_space import ConfigurationSpace from ConfigSpace.hyperparameters import ( CategoricalHyperparameter, UniformFloatHyperparameter, UniformIntegerHyperparameter, UnParametrizedHyperparameter, ) from autosklearn.askl_typing import FEAT_TYPE_TYPE f...
6,151
31.723404
86
py
auto-sklearn
auto-sklearn-master/autosklearn/pipeline/components/regression/sgd.py
from typing import Optional from ConfigSpace.conditions import EqualsCondition, InCondition from ConfigSpace.configuration_space import ConfigurationSpace from ConfigSpace.hyperparameters import ( CategoricalHyperparameter, UniformFloatHyperparameter, UnParametrizedHyperparameter, ) from autosklearn.askl_...
8,916
32.025926
87
py
auto-sklearn
auto-sklearn-master/autosklearn/pipeline/implementations/CategoryShift.py
import numpy as np from scipy import sparse from sklearn.base import BaseEstimator, TransformerMixin from sklearn.utils import check_array class CategoryShift(BaseEstimator, TransformerMixin): """Add 3 to every category.""" def __init__(self, random_state=None): self.random_state = random_state ...
1,516
36
86
py
auto-sklearn
auto-sklearn-master/autosklearn/pipeline/implementations/MinorityCoalescer.py
import numpy as np from scipy import sparse from sklearn.base import BaseEstimator, TransformerMixin class MinorityCoalescer(BaseEstimator, TransformerMixin): """Group together categories which occurence is less than a specified minimum fraction. Coalesced categories get index of one. """ def __init_...
2,861
34.775
82
py
auto-sklearn
auto-sklearn-master/autosklearn/pipeline/implementations/SparseOneHotEncoder.py
import numpy as np from scipy import sparse from sklearn.base import BaseEstimator, TransformerMixin from sklearn.utils import check_array class SparseOneHotEncoder(BaseEstimator, TransformerMixin): """Encode categorical integer features using a one-hot aka one-of-K scheme. The input to this transformer shou...
4,492
34.944
87
py
auto-sklearn
auto-sklearn-master/autosklearn/pipeline/implementations/__init__.py
__author__ = "feurerm"
23
11
22
py
auto-sklearn
auto-sklearn-master/autosklearn/pipeline/implementations/util.py
import numpy as np def softmax(df): if len(df.shape) == 1: df[df > 20] = 20 df[df < -20] = -20 ppositive = 1 / (1 + np.exp(-df)) ppositive[ppositive > 0.999999] = 1 ppositive[ppositive < 0.0000001] = 0 return np.transpose(np.array((1 - ppositive, ppositive))) el...
2,697
34.973333
82
py
auto-sklearn
auto-sklearn-master/autosklearn/util/__init__.py
# -*- encoding: utf-8 -*- import re SUBPATTERN = r"((?P<operation%d>==|>=|>|<)(?P<version%d>(\d+)?(\.[a-zA-Z0-9]+)?(\.[a-zA-Z0-9]+)?))" # noqa: E501 RE_PATTERN = re.compile( r"^(?P<name>[\w\-]+)%s?(,%s)?$" % (SUBPATTERN % (1, 1), SUBPATTERN % (2, 2)) )
259
31.5
113
py
auto-sklearn
auto-sklearn-master/autosklearn/util/common.py
# -*- encoding: utf-8 -*- import os import warnings import numpy as np __all__ = ["check_pid", "warn_if_not_float"] def warn_if_not_float(X: np.ndarray, estimator: str = "This algorithm") -> bool: """Warning utility function to check that data type is floating point. Returns True if a warning was raised (i...
1,407
21.709677
80
py
auto-sklearn
auto-sklearn-master/autosklearn/util/dask.py
""" Provides simplified 2 use cases of dask that we consider 1. A UserDask is when a user supplies a dask client, in which case we don't close this down and leave it up to the user to control its lifetime. 2. A LocalDask is one we use when no user dask is supplied. In this case we make sure to spin up and close down ...
3,972
26.783217
81
py
auto-sklearn
auto-sklearn-master/autosklearn/util/data.py
from typing import ( Any, Dict, Iterator, List, Mapping, Optional, Sequence, Tuple, Type, Union, cast, ) import warnings import numpy as np import pandas as pd from scipy.sparse import spmatrix from sklearn.model_selection import train_test_split from autosklearn.evaluatio...
16,587
32.176
88
py
auto-sklearn
auto-sklearn-master/autosklearn/util/dependencies.py
from typing import List, Optional, Union, no_type_check import importlib from distutils.version import LooseVersion import pkg_resources from autosklearn.util import RE_PATTERN def verify_packages(packages: Optional[Union[str, List[str]]]) -> None: if not packages: return if isinstance(packages, st...
3,271
29.867925
81
py
auto-sklearn
auto-sklearn-master/autosklearn/util/disk.py
from __future__ import annotations from typing import Any import math import shutil import tempfile import uuid from pathlib import Path sizes = { "B": 0, "KB": 1, "MB": 2, "GB": 3, "TB": 4, } def sizeof(path: Path | str, unit: str = "B") -> float: """Get the size of some path object P...
2,506
23.105769
78
py
auto-sklearn
auto-sklearn-master/autosklearn/util/functional.py
from __future__ import annotations from typing import Callable, Hashable, Iterable, Iterator, TypeVar from functools import reduce from itertools import chain, cycle, islice, tee T = TypeVar("T") def intersection(*items: Iterable[T]) -> set[T]: """Does an intersection over all collection of items ..code::...
5,970
22.143411
88
py
auto-sklearn
auto-sklearn-master/autosklearn/util/logging.yaml
--- version: 1 disable_existing_loggers: False formatters: simple: format: '[%(levelname)s] [%(asctime)s:%(name)s] %(message)s' handlers: console: class: logging.StreamHandler level: WARNING formatter: simple stream: ext://sys.stdout file_handler: class: logging.FileHandler level: DE...
1,182
18.716667
64
yaml
auto-sklearn
auto-sklearn-master/autosklearn/util/logging_.py
""" For accessing a logger, please default to using `get_named_client_logger(name, host, port)` """ from typing import Any, Dict, Iterator, Optional, TextIO, Type, cast import logging import logging.config import logging.handlers import multiprocessing import os import pickle import random import select import sockets...
13,236
32.767857
115
py
auto-sklearn
auto-sklearn-master/autosklearn/util/multiobjective.py
import operator import numpy as np def pareto_front(values: np.ndarray, *, is_loss: bool = True) -> np.ndarray: """Calculate the pareto front source from: https://stackoverflow.com/a/40239615 Note ---- Works on the assumption that every value is either something to minimize or something to ...
1,061
24.902439
84
py
auto-sklearn
auto-sklearn-master/autosklearn/util/parallel.py
import multiprocessing import sys def preload_modules(context: multiprocessing.context.BaseContext) -> None: all_loaded_modules = sys.modules.keys() preload = [ loaded_module for loaded_module in all_loaded_modules if loaded_module.split(".")[0] in ( "smac", ...
581
23.25
74
py
auto-sklearn
auto-sklearn-master/autosklearn/util/pipeline.py
# -*- encoding: utf-8 -*- from typing import Dict, List, Optional, Union import numpy as np from ConfigSpace.configuration_space import ConfigurationSpace from autosklearn.constants import ( BINARY_CLASSIFICATION, MULTICLASS_CLASSIFICATION, MULTILABEL_CLASSIFICATION, MULTIOUTPUT_REGRESSION, REGRES...
5,289
31.654321
87
py
auto-sklearn
auto-sklearn-master/autosklearn/util/single_thread_client.py
import typing from typing import Any from pathlib import Path import dask.distributed class DummyFuture(dask.distributed.Future): """ A class that mimics a distributed Future, the outcome of performing submit on a distributed client. """ def __init__(self, result: typing.Any) -> None: s...
2,925
24.008547
76
py
auto-sklearn
auto-sklearn-master/autosklearn/util/smac_wrap.py
from __future__ import annotations from typing import Callable, Union from smac.callbacks import IncorporateRunResultCallback from smac.optimizer.smbo import SMBO from smac.runhistory.runhistory import RunInfo, RunValue SMACCallback = Callable[[SMBO, RunInfo, RunValue, float], Union[bool, None]] class SmacRunCallb...
1,078
23.522727
76
py
auto-sklearn
auto-sklearn-master/autosklearn/util/stopwatch.py
from __future__ import annotations from typing import Iterator, Mapping, Optional, Tuple import sys import time from contextlib import contextmanager from itertools import repeat from typing_extensions import Literal class TimingTask: """A task to start""" def __init__(self, name: str): """ ...
6,853
27.558333
86
py
auto-sklearn
auto-sklearn-master/doc/conf.py
# -*- coding: utf-8 -*- # # AutoSklearn documentation build configuration file, created by # sphinx-quickstart on Thu May 21 13:40:42 2015. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. #...
14,434
32.726636
124
py
auto-sklearn
auto-sklearn-master/doc/_templates/layout.html
{% extends "!layout.html" %} {# Custom CSS overrides #} {# set bootswatch_css_custom = ['_static/my-styles.css'] #} {# Add github banner (from: https://github.com/blog/273-github-ribbons). #} {% block header %} {{ super() }} <a href="https://github.com/automl/auto-sklearn" class="visible-desktop hidden-xs"><...
720
29.041667
77
html
auto-sklearn
auto-sklearn-master/examples/20_basic/example_classification.py
# -*- encoding: utf-8 -*- """ ============== Classification ============== The following example shows how to fit a simple classification model with *auto-sklearn*. """ from pprint import pprint import sklearn.datasets import sklearn.metrics import autosklearn.classification #######################################...
1,616
27.875
77
py
auto-sklearn
auto-sklearn-master/examples/20_basic/example_multilabel_classification.py
""" ========================== Multi-label Classification ========================== This examples shows how to format the targets for a multilabel classification problem. Details on multilabel classification can be found `here <https://scikit-learn.org/stable/modules/multiclass.html>`_. """ import numpy as np from pp...
2,866
32.729412
84
py
auto-sklearn
auto-sklearn-master/examples/20_basic/example_multioutput_regression.py
# -*- encoding: utf-8 -*- """ ======================= Multi-output Regression ======================= The following example shows how to fit a multioutput regression model with *auto-sklearn*. """ import numpy as numpy from pprint import pprint from sklearn.datasets import make_regression from sklearn.metrics import ...
1,963
29.215385
83
py
auto-sklearn
auto-sklearn-master/examples/20_basic/example_regression.py
# -*- encoding: utf-8 -*- """ ========== Regression ========== The following example shows how to fit a simple regression model with *auto-sklearn*. """ from pprint import pprint import sklearn.datasets import sklearn.metrics import autosklearn.regression import matplotlib.pyplot as plt ############################...
2,721
31.795181
100
py
auto-sklearn
auto-sklearn-master/examples/40_advanced/__init__.py
0
0
0
py
auto-sklearn
auto-sklearn-master/examples/40_advanced/custom_metrics.py
"""Custom metrics to be used by example_metrics.py They reside in a different file so they can be used by Auto-sklearn.""" import numpy as np ############################################################################ # Custom metrics definition # ========================= def accuracy(solution, prediction): ...
895
26.151515
76
py
auto-sklearn
auto-sklearn-master/examples/40_advanced/example_calc_multiple_metrics.py
# -*- encoding: utf-8 -*- """ ======= Metrics ======= In *Auto-sklearn*, model is optimized over a metric, either built-in or custom metric. Moreover, it is also possible to calculate multiple metrics per run. The following examples show how to calculate metrics built-in and self-defined metrics for a classification p...
2,178
29.263889
81
py
auto-sklearn
auto-sklearn-master/examples/40_advanced/example_debug_logging.py
# -*- encoding: utf-8 -*- """ ===================== Logging and debugging ===================== This example shows how to provide a custom logging configuration to *auto-sklearn*. We will be fitting 2 pipelines and showing any INFO-level msg on console. Even if you do not provide a logging_configuration, autosklearn c...
3,537
32.695238
102
py
auto-sklearn
auto-sklearn-master/examples/40_advanced/example_early_stopping_and_callbacks.py
""" ============================ Early stopping and Callbacks ============================ The example below shows how we can use the ``get_trials_callback`` parameter of auto-sklearn to implement an early-stopping mechanism through a callback. These callbacks give access to the result of each model + hyperparameter ...
2,818
33.378049
88
py
auto-sklearn
auto-sklearn-master/examples/40_advanced/example_feature_types.py
# -*- encoding: utf-8 -*- """ ============= Feature Types ============= In *auto-sklearn* it is possible to specify the feature types of a dataset when calling the method :meth:`fit() <autosklearn.classification.AutoSklearnClassifier.fit>` by specifying the argument ``feat_type``. The following example demonstrates a ...
2,362
35.353846
88
py
auto-sklearn
auto-sklearn-master/examples/40_advanced/example_get_pipeline_components.py
# -*- encoding: utf-8 -*- """ ====================== Obtain run information ====================== The following example shows how to obtain information from a finished Auto-sklearn run. In particular, it shows: * how to query which models were evaluated by Auto-sklearn * how to query the models in the final ensemble ...
7,965
39.232323
129
py
auto-sklearn
auto-sklearn-master/examples/40_advanced/example_inspect_predictions.py
# -*- encoding: utf-8 -*- """ ================= Model Explanation ================= The following example shows how to fit a simple classification model with *auto-sklearn* and use the `inspect module <https://scikit-learn.org/stable/inspection.html>`_ from scikit-learn to understand what affects the predictions. """ ...
4,767
37.451613
103
py
auto-sklearn
auto-sklearn-master/examples/40_advanced/example_interpretable_models.py
# -*- encoding: utf-8 -*- """ ==================== Interpretable models ==================== The following example shows how to inspect the models which *auto-sklearn* optimizes over and how to restrict them to an interpretable subset. """ from pprint import pprint import autosklearn.classification import sklearn.dat...
2,894
32.662791
77
py
auto-sklearn
auto-sklearn-master/examples/40_advanced/example_metrics.py
# -*- encoding: utf-8 -*- """ ======= Metrics ======= *Auto-sklearn* supports various built-in metrics, which can be found in the :ref:`metrics section in the API <api:Built-in Metrics>`. However, it is also possible to define your own metric and use it to fit and evaluate your model. The following examples show how t...
6,895
28.982609
88
py
auto-sklearn
auto-sklearn-master/examples/40_advanced/example_multi_objective.py
# -*- encoding: utf-8 -*- """ ============== Classification ============== The following example shows how to fit *auto-sklearn* to optimize for two competing metrics: `precision` and `recall` (read more on this tradeoff in the `scikit-learn docs <https://scikit-learn.org/stable/auto_examples/model_selection/plot_prec...
3,229
34.494505
121
py
auto-sklearn
auto-sklearn-master/examples/40_advanced/example_pandas_train_test.py
# -*- encoding: utf-8 -*- """ ========================== Performance-over-time plot ========================== This example shows, how to use the *performance_over_time_* attribute to plot the performance over train time. *performance_over_time_* can contain multiple metrics within a pandas dataframe, namely: - e...
4,289
37.303571
106
py
auto-sklearn
auto-sklearn-master/examples/40_advanced/example_resampling.py
""" ===================== Resampling Strategies ===================== In *auto-sklearn* it is possible to use different resampling strategies by specifying the arguments ``resampling_strategy`` and ``resampling_strategy_arguments``. The following example shows common settings for the ``AutoSklearnClassifier``. """ im...
4,994
36.556391
97
py
auto-sklearn
auto-sklearn-master/examples/40_advanced/example_single_configuration.py
# -*- encoding: utf-8 -*- """ ========================== Fit a single configuration ========================== *Auto-sklearn* searches for the best combination of machine learning algorithms and their hyper-parameter configuration for a given task, using Scikit-Learn Pipelines. To further improve performance, this pip...
3,441
35.231579
114
py
auto-sklearn
auto-sklearn-master/examples/40_advanced/example_text_preprocessing.py
# -*- encoding: utf-8 -*- """ ================== Text preprocessing ================== The following example shows how to fit a simple NLP problem with *auto-sklearn*. For an introduction to text preprocessing you can follow these links: 1. https://scikit-learn.org/stable/tutorial/text_analytics/working_with_text...
3,241
37.595238
99
py
auto-sklearn
auto-sklearn-master/examples/60_search/example_parallel_manual_spawning_cli.py
# -*- encoding: utf-8 -*- """ ====================================================== Parallel Usage: Spawning workers from the command line ====================================================== *Auto-sklearn* uses `dask.distributed <https://distributed.dask.org/en/latest/index.html>`_ for parallel optimization. This...
7,869
33.217391
96
py
auto-sklearn
auto-sklearn-master/examples/60_search/example_parallel_manual_spawning_python.py
# -*- encoding: utf-8 -*- """ =================================================== Parallel Usage: Spawning workers from within Python =================================================== **NOTE**: Disabled due to issue https://github.com/dask/distributed/issues/5627 *Auto-sklearn* uses `dask.distributed <https://distr...
6,040
36.75625
93
py
auto-sklearn
auto-sklearn-master/examples/60_search/example_parallel_n_jobs.py
# -*- encoding: utf-8 -*- """ =================================== Parallel Usage on a single machine =================================== *Auto-sklearn* uses `dask.distributed <https://distributed.dask.org/en/latest/index.html`>_ for parallel optimization. This example shows how to start *Auto-sklearn* to use multipl...
1,775
31.290909
76
py
auto-sklearn
auto-sklearn-master/examples/60_search/example_random_search.py
""" ============= Random Search ============= A crucial feature of *auto-sklearn* is automatically optimizing the hyperparameters through SMAC, introduced `here <https://ml.informatik.uni-freiburg.de/papers/11-LION5-SMAC.pdf>`_. Additionally, it is possible to use `random search <https://www.jmlr.org/papers/v13/bergst...
4,942
31.953333
121
py
auto-sklearn
auto-sklearn-master/examples/60_search/example_sequential.py
""" ================ Sequential Usage ================ By default, *auto-sklearn* fits the machine learning models and build their ensembles in parallel. However, it is also possible to run the two processes sequentially. The example below shows how to first fit the models and build the ensembles afterwards. """ from ...
2,195
34.419355
79
py
auto-sklearn
auto-sklearn-master/examples/60_search/example_successive_halving.py
""" ================== Successive Halving ================== This advanced example illustrates how to interact with the SMAC callback and get relevant information from the run, like the number of iterations. Particularly, it exemplifies how to select the intensification strategy to use in smac, in this case: `Success...
10,244
36.665441
138
py
auto-sklearn
auto-sklearn-master/examples/80_extending/example_extending_classification.py
""" ==================================================== Extending Auto-Sklearn with Classification Component ==================================================== The following example demonstrates how to create a new classification component for using in auto-sklearn. """ from typing import Optional from pprint impor...
5,576
31.236994
83
py
auto-sklearn
auto-sklearn-master/examples/80_extending/example_extending_data_preprocessor.py
""" ======================================================= Extending Auto-Sklearn with Data Preprocessor Component ======================================================= The following example demonstrates how to turn off data preprocessing step in auto-skearn. """ from typing import Optional from pprint import pprin...
3,470
35.15625
90
py
auto-sklearn
auto-sklearn-master/examples/80_extending/example_extending_preprocessor.py
""" ================================================== Extending Auto-Sklearn with Preprocessor Component ================================================== The following example demonstrates how to create a wrapper around the linear discriminant analysis (LDA) algorithm from sklearn and use it as a preprocessor in au...
4,807
33.589928
85
py
auto-sklearn
auto-sklearn-master/examples/80_extending/example_extending_regression.py
""" ================================================ Extending Auto-Sklearn with Regression Component ================================================ The following example demonstrates how to create a new regression component for using in auto-sklearn. """ from typing import Optional from pprint import pprint from C...
5,223
32.063291
79
py
auto-sklearn
auto-sklearn-master/examples/80_extending/example_restrict_number_of_hyperparameters.py
""" =================================================================== Restricting the number of hyperparameters for an existing component =================================================================== The following example demonstrates how to replace an existing component with a new component, implementing the ...
5,275
35.136986
100
py
auto-sklearn
auto-sklearn-master/misc/create_hyperparameter_table.py
from argparse import ArgumentParser from collections import OrderedDict import os import shlex import subprocess import ConfigSpace.hyperparameters import autosklearn.pipeline.classification import autosklearn.pipeline.regression # Some macros COND = "conditional" CAT = "categorical" CONT = "continuous" CONST = "cons...
8,184
28.336918
110
py
auto-sklearn
auto-sklearn-master/misc/create_list_of_potential_models.py
import os import glob import inspect import importlib import sklearn.base files = glob.glob( os.path.join(os.path.dirname(sklearn.__file__), "**/*.py"), recursive=True ) def find_all(cls): found = set() for file in files: parts = file.split("/") parts[-1] = parts[-1].replace(".py", "") ...
942
24.486486
78
py
auto-sklearn
auto-sklearn-master/scripts/01_create_commands.py
import argparse import itertools import os import sys import openml sys.path.append(".") from update_metadata_util import classification_tasks, regression_tasks parser = argparse.ArgumentParser() parser.add_argument("--working-directory", type=str, required=True) parser.add_argument("--test", action="store_true") a...
1,815
32.62963
85
py
auto-sklearn
auto-sklearn-master/scripts/02_retrieve_metadata.py
from argparse import ArgumentParser import csv import glob import itertools import json import os import arff import numpy as np from ConfigSpace.configuration_space import Configuration from ConfigSpace.util import deactivate_inactive_hyperparameters from autosklearn.data.abstract_data_manager import AbstractDataMa...
9,379
32.862816
90
py
auto-sklearn
auto-sklearn-master/scripts/03_calculate_metafeatures.py
from argparse import ArgumentParser from collections import defaultdict, OrderedDict import copy import logging import os import sys import unittest.mock import tempfile import arff import joblib import numpy as np import pandas as pd from autosklearn.constants import ( BINARY_CLASSIFICATION, MULTICLASS_CLASS...
9,709
34.567766
87
py
auto-sklearn
auto-sklearn-master/scripts/04_create_aslib_files.py
from argparse import ArgumentParser import itertools import os import arff from autosklearn.constants import * from autosklearn.metrics import CLASSIFICATION_METRICS, REGRESSION_METRICS if __name__ == "__main__": parser = ArgumentParser() parser.add_argument("--working-directory", type=str, required=True) ...
5,742
38.606897
87
py
auto-sklearn
auto-sklearn-master/scripts/readme.md
# How to update metadata (to be moved to the documentation) ## 1. Create a working directory and set the task type The working directory will be used to save all temporary and final output. working_directory=~/auto-sklearn-metadata/001 mkdir -p $working_directory The task type defines whether you want upda...
1,622
30.823529
102
md
auto-sklearn
auto-sklearn-master/scripts/run_auto-sklearn_for_metadata_generation.py
if __name__ == "__main__": import argparse import json import logging import os import subprocess import sys import tempfile from autosklearn.classification import AutoSklearnClassifier from autosklearn.regression import AutoSklearnRegressor from autosklearn.evaluation import E...
8,378
32.650602
87
py
auto-sklearn
auto-sklearn-master/scripts/update_metadata_util.py
import numpy as np import openml classification_tasks = [ 232, 236, 241, 245, 253, 254, 256, 258, 260, 262, 267, 271, 273, 275, 279, 288, 336, 340, 2119, 2120, 2121, 2122, 2123, 2125, 2356, 3044, 3047, 3048...
4,638
12.10452
77
py
auto-sklearn
auto-sklearn-master/scripts/2015_nips_paper/Readme.md
## Reproduce results of Efficient and Robust Automated Machine Learning (Feurer et al.) This folder contains all necessary scripts in order to reproduce the results shown in Figure 3 of Efficient and Robust Automated Machine Learning (Feurer et al.). The scripts can be modified to include different datasets, change the...
1,111
30.771429
88
md
auto-sklearn
auto-sklearn-master/scripts/2015_nips_paper/plot/plot_ranks.py
#!/usr/bin/env python3 import csv import sys import os import numpy as np import pandas as pd import matplotlib.pyplot as plt def read_csv(fn, has_header=True, data_type=str): """ Function which reads the csv files containing trajectories of the auto-sklearn runs. """ data = list() header =...
5,710
32.594118
89
py
auto-sklearn
auto-sklearn-master/scripts/2015_nips_paper/run/remove_dataset_from_metadata.py
import os import arff from shutil import copyfile def remove_dataset_from_aslib_arff( input_file, output_file, id, ): with open(input_file) as fh: arff_object = arff.load(fh) for i in range(len(arff_object["data"]) - 1, -1, -1): if str(arff_object["data"][i][0]) == str(id): ...
2,192
31.731343
79
py
auto-sklearn
auto-sklearn-master/scripts/2015_nips_paper/run/run_auto_sklearn.py
#!/usr/bin/env python3 import os import argparse import numpy as np import openml from autosklearn.classification import AutoSklearnClassifier from autosklearn.metrics import balanced_accuracy from remove_dataset_from_metadata import remove_dataset import score_ensemble def load_task(task_id): """Function used ...
6,060
29.457286
88
py
auto-sklearn
auto-sklearn-master/scripts/2015_nips_paper/run/run_commands.sh
#!/usr/bin/env bash # Run all commands in commands.txt. Each command line executes first the model fitting, # and then creates the trajectory of a single model and the ensemble. Therefore, each # line can be executed separately and in parallel, for example, on a cluster environment. cat "../commands.txt" | while read ...
347
57
89
sh
auto-sklearn
auto-sklearn-master/scripts/2015_nips_paper/run/score_ensemble.py
from argparse import ArgumentParser import csv import glob import os import time import joblib import numpy as np from autosklearn.ensembles.ensemble_selection import EnsembleSelection from autosklearn.metrics import balanced_accuracy from autosklearn.automl_common.common.utils.backend import create def _load_file...
8,574
32.236434
86
py