Skip to content

Commit

Permalink
update user guide
Browse files Browse the repository at this point in the history
  • Loading branch information
tvdboom committed Aug 28, 2023
1 parent b38e87b commit 310735a
Show file tree
Hide file tree
Showing 211 changed files with 5,235 additions and 7,367 deletions.
24 changes: 12 additions & 12 deletions atom/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,10 +222,10 @@ class ATOMClassifier(BaseTransformer, ATOM):
- If <-1: Use number of cores - 1 + `n_jobs`.
device: str, default="cpu"
Device on which to train the estimators. Use any string
that follows the [SYCL_DEVICE_FILTER][] filter selector,
e.g. `device="gpu"` to use the GPU. Read more in the
[user guide][accelerating-pipelines].
Device on which to run the estimators. Use any string that
follows the [SYCL_DEVICE_FILTER][] filter selector, e.g.
`#!python device="gpu"` to use the GPU. Read more in the
[user guide][gpu-acceleration].
engine: dict or None, default=None
Execution engine to use for [data][data-acceleration] and
Expand Down Expand Up @@ -448,10 +448,10 @@ class ATOMForecaster(BaseTransformer, ATOM):
- If <-1: Use number of cores - 1 + `n_jobs`.
device: str, default="cpu"
Device on which to train the estimators. Use any string
that follows the [SYCL_DEVICE_FILTER][] filter selector,
e.g. `device="gpu"` to use the GPU. Read more in the
[user guide][accelerating-pipelines].
Device on which to run the estimators. Use any string that
follows the [SYCL_DEVICE_FILTER][] filter selector, e.g.
`#!python device="gpu"` to use the GPU. Read more in the
[user guide][gpu-acceleration].
engine: dict or None, default=None
Execution engine to use for [data][data-acceleration] and
Expand Down Expand Up @@ -677,10 +677,10 @@ class ATOMRegressor(BaseTransformer, ATOM):
- If <-1: Use number of cores - 1 + `n_jobs`.
device: str, default="cpu"
Device on which to train the estimators. Use any string
that follows the [SYCL_DEVICE_FILTER][] filter selector,
e.g. `device="gpu"` to use the GPU. Read more in the
[user guide][accelerating-pipelines].
Device on which to run the estimators. Use any string that
follows the [SYCL_DEVICE_FILTER][] filter selector, e.g.
`#!python device="gpu"` to use the GPU. Read more in the
[user guide][gpu-acceleration].
engine: dict or None, default=None
Execution engine to use for [data][data-acceleration] and
Expand Down
8 changes: 4 additions & 4 deletions atom/basemodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,10 @@ class BaseModel(BaseTransformer, BaseTracker, HTPlot, PredictionPlot, ShapPlot):
- If <-1: Use number of cores - 1 + `n_jobs`.
device: str, default="cpu"
Device on which to train the estimators. Use any string
that follows the [SYCL_DEVICE_FILTER][] filter selector,
e.g. `device="gpu"` to use the GPU. Read more in the
[user guide][accelerating-pipelines].
Device on which to run the estimators. Use any string that
follows the [SYCL_DEVICE_FILTER][] filter selector, e.g.
`#!python device="gpu"` to use the GPU. Read more in the
[user guide][gpu-acceleration].
engine: dict or None, default=None
Execution engine to use for [data][data-acceleration] and
Expand Down
19 changes: 12 additions & 7 deletions atom/basetransformer.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class BaseTransformer:
Standard keyword arguments for the classes. Can include:
- n_jobs: Number of cores to use for parallel processing.
- device: Device on which to train the estimators.
- device: Device on which to run the estimators.
- engine: Execution engine to use for data and estimators.
- backend: Parallelization backend.
- verbose: Verbosity level of the output.
Expand Down Expand Up @@ -103,13 +103,13 @@ def n_jobs(self, value: INT):

@property
def device(self) -> str:
"""Device on which to train the estimators."""
"""Device on which to run the estimators."""
return self._device

@device.setter
def device(self, value: str):
self._device = value
if "gpu" in value.lower():
self._device = value.lower()

Check notice on line 111 in atom/basetransformer.py

View workflow job for this annotation

GitHub Actions / Qodana Community for Python

An instance attribute is defined outside `__init__`

Instance attribute _device defined outside __init__
if "gpu" in self._device:
os.environ["CUDA_VISIBLE_DEVICES"] = str(self._device_id)

@property
Expand Down Expand Up @@ -155,16 +155,21 @@ def engine(self, value: dict | None):
)
else:
import sklearnex
sklearnex.set_config("auto" if "cpu" in self.device else self.device)
sklearnex.set_config(self.device if "gpu" in self.device else "auto")
elif models.lower() == "cuml":
if not find_spec("cuml"):
raise ModuleNotFoundError(
"Failed to import cuml. Package is not installed. Refer "
"to: https://rapids.ai/start.html#install."
)
else:
import cuml
cuml.internals.memory_utils.set_global_output_type("numpy")
from cuml.common.device_selection import set_global_device_type
set_global_device_type("gpu" if "gpu" in self.device else "cpu")

# See https://github.com/rapidsai/cuml/issues/5564
from cuml.internals.memory_util import set_global_output_type
set_global_output_type("numpy")

elif models.lower() != "sklearn":
raise ValueError(
"Invalid value for the models key of the engine parameter, "
Expand Down
48 changes: 24 additions & 24 deletions atom/data_cleaning.py
Original file line number Diff line number Diff line change
Expand Up @@ -539,10 +539,10 @@ class Cleaner(BaseEstimator, TransformerMixin, BaseTransformer):
is not provided.
device: str, default="cpu"
Device on which to train the estimators. Use any string
that follows the [SYCL_DEVICE_FILTER][] filter selector,
e.g. `device="gpu"` to use the GPU. Read more in the
[user guide][accelerating-pipelines].
Device on which to run the estimators. Use any string that
follows the [SYCL_DEVICE_FILTER][] filter selector, e.g.
`#!python device="gpu"` to use the GPU. Read more in the
[user guide][gpu-acceleration].
engine: dict or None, default=None
Execution engine to use for [data][data-acceleration] and
Expand Down Expand Up @@ -972,10 +972,10 @@ class Discretizer(BaseEstimator, TransformerMixin, BaseTransformer):
- If dict: Labels per column, where the key is the column's name.
device: str, default="cpu"
Device on which to train the estimators. Use any string
that follows the [SYCL_DEVICE_FILTER][] filter selector,
e.g. `device="gpu"` to use the GPU. Read more in the
[user guide][accelerating-pipelines].
Device on which to run the estimators. Use any string that
follows the [SYCL_DEVICE_FILTER][] filter selector, e.g.
`#!python device="gpu"` to use the GPU. Read more in the
[user guide][gpu-acceleration].
engine: dict or None, default=None
Execution engine to use for [data][data-acceleration] and
Expand Down Expand Up @@ -1694,10 +1694,10 @@ class Imputer(BaseEstimator, TransformerMixin, BaseTransformer):
(if more, the column is removed). If None, ignore this step.
device: str, default="cpu"
Device on which to train the estimators. Use any string
that follows the [SYCL_DEVICE_FILTER][] filter selector,
e.g. `device="gpu"` to use the GPU. Read more in the
[user guide][accelerating-pipelines].
Device on which to run the estimators. Use any string that
follows the [SYCL_DEVICE_FILTER][] filter selector, e.g.
`#!python device="gpu"` to use the GPU. Read more in the
[user guide][gpu-acceleration].
engine: dict or None, default=None
Execution engine to use for [data][data-acceleration] and
Expand Down Expand Up @@ -2095,10 +2095,10 @@ class Normalizer(BaseEstimator, TransformerMixin, BaseTransformer):
- "[quantile][]": Transform features using quantiles information.
device: str, default="cpu"
Device on which to train the estimators. Use any string
that follows the [SYCL_DEVICE_FILTER][] filter selector,
e.g. `device="gpu"` to use the GPU. Read more in the
[user guide][accelerating-pipelines].
Device on which to run the estimators. Use any string that
follows the [SYCL_DEVICE_FILTER][] filter selector, e.g.
`#!python device="gpu"` to use the GPU. Read more in the
[user guide][gpu-acceleration].
engine: dict or None, default=None
Execution engine to use for [data][data-acceleration] and
Expand Down Expand Up @@ -2394,10 +2394,10 @@ class Pruner(BaseEstimator, TransformerMixin, BaseTransformer):
if strategy="zscore".
device: str, default="cpu"
Device on which to train the estimators. Use any string
that follows the [SYCL_DEVICE_FILTER][] filter selector,
e.g. `device="gpu"` to use the GPU. Read more in the
[user guide][accelerating-pipelines].
Device on which to run the estimators. Use any string that
follows the [SYCL_DEVICE_FILTER][] filter selector, e.g.
`#!python device="gpu"` to use the GPU. Read more in the
[user guide][gpu-acceleration].
engine: dict or None, default=None
Execution engine to use for [data][data-acceleration] and
Expand Down Expand Up @@ -2699,10 +2699,10 @@ class Scaler(BaseEstimator, TransformerMixin, BaseTransformer):
Whether to scale binary columns (only 0s and 1s).
device: str, default="cpu"
Device on which to train the estimators. Use any string
that follows the [SYCL_DEVICE_FILTER][] filter selector,
e.g. `device="gpu"` to use the GPU. Read more in the
[user guide][accelerating-pipelines].
Device on which to run the estimators. Use any string that
follows the [SYCL_DEVICE_FILTER][] filter selector, e.g.
`#!python device="gpu"` to use the GPU. Read more in the
[user guide][gpu-acceleration].
engine: dict or None, default=None
Execution engine to use for [data][data-acceleration] and
Expand Down
8 changes: 4 additions & 4 deletions atom/feature_engineering.py
Original file line number Diff line number Diff line change
Expand Up @@ -991,10 +991,10 @@ class FeatureSelector(
- If <-1: Use number of cores - 1 + `n_jobs`.
device: str, default="cpu"
Device on which to train the estimators. Use any string
that follows the [SYCL_DEVICE_FILTER][] filter selector,
e.g. `device="gpu"` to use the GPU. Read more in the
[user guide][accelerating-pipelines].
Device on which to run the estimators. Use any string that
follows the [SYCL_DEVICE_FILTER][] filter selector, e.g.
`#!python device="gpu"` to use the GPU. Read more in the
[user guide][gpu-acceleration].
engine: dict or None, default=None
Execution engine to use for [data][data-acceleration] and
Expand Down
6 changes: 3 additions & 3 deletions atom/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ class CatBoost(ClassRegModel):
`use_best_model=False` parameter to avoid this behavior or use
a [holdout set][data-sets] to evaluate the final estimator.
* [In-training validation][] and [pruning][] are disabled when
`device="gpu"`.
`#!python device="gpu"`.
!!! note
ATOM uses CatBoost's `n_estimators` parameter instead of
Expand Down Expand Up @@ -1757,8 +1757,8 @@ class LightGBM(ClassRegModel):
Read more in LightGBM's [documentation][lgbdocs].
!!! info
Using LightGBM's [GPU acceleration][] requires
[additional software dependencies][lgb_gpu].
Using LightGBM's [GPU acceleration][estimator-acceleration]
requires [additional software dependencies][lgb_gpu].
See Also
--------
Expand Down
8 changes: 4 additions & 4 deletions atom/nlp.py
Original file line number Diff line number Diff line change
Expand Up @@ -831,10 +831,10 @@ class Vectorizer(BaseEstimator, TransformerMixin, BaseTransformer):
in X (besides `corpus`) that are non-sparse.
device: str, default="cpu"
Device on which to train the estimators. Use any string
that follows the [SYCL_DEVICE_FILTER][] filter selector,
e.g. `device="gpu"` to use the GPU. Read more in the
[user guide][accelerating-pipelines].
Device on which to run the estimators. Use any string that
follows the [SYCL_DEVICE_FILTER][] filter selector, e.g.
`#!python device="gpu"` to use the GPU. Read more in the
[user guide][gpu-acceleration].
engine: dict or None, default=None
Execution engine to use for [data][data-acceleration] and
Expand Down
72 changes: 36 additions & 36 deletions atom/training.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,10 +345,10 @@ class DirectClassifier(Direct):
- If <-1: Use number of cores - 1 + `n_jobs`.
device: str, default="cpu"
Device on which to train the estimators. Use any string
that follows the [SYCL_DEVICE_FILTER][] filter selector,
e.g. `device="gpu"` to use the GPU. Read more in the
[user guide][accelerating-pipelines].
Device on which to run the estimators. Use any string that
follows the [SYCL_DEVICE_FILTER][] filter selector, e.g.
`#!python device="gpu"` to use the GPU. Read more in the
[user guide][gpu-acceleration].
engine: dict or None, default=None
Execution engine to use for [data][data-acceleration] and
Expand Down Expand Up @@ -563,10 +563,10 @@ class DirectForecaster(Direct):
- If <-1: Use number of cores - 1 + `n_jobs`.
device: str, default="cpu"
Device on which to train the estimators. Use any string
that follows the [SYCL_DEVICE_FILTER][] filter selector,
e.g. `device="gpu"` to use the GPU. Read more in the
[user guide][accelerating-pipelines].
Device on which to run the estimators. Use any string that
follows the [SYCL_DEVICE_FILTER][] filter selector, e.g.
`#!python device="gpu"` to use the GPU. Read more in the
[user guide][gpu-acceleration].
engine: dict or None, default=None
Execution engine to use for [data][data-acceleration] and
Expand Down Expand Up @@ -778,10 +778,10 @@ class DirectRegressor(Direct):
- If <-1: Use number of cores - 1 + `n_jobs`.
device: str, default="cpu"
Device on which to train the estimators. Use any string
that follows the [SYCL_DEVICE_FILTER][] filter selector,
e.g. `device="gpu"` to use the GPU. Read more in the
[user guide][accelerating-pipelines].
Device on which to run the estimators. Use any string that
follows the [SYCL_DEVICE_FILTER][] filter selector, e.g.
`#!python device="gpu"` to use the GPU. Read more in the
[user guide][gpu-acceleration].
engine: dict or None, default=None
Execution engine to use for [data][data-acceleration] and
Expand Down Expand Up @@ -1003,10 +1003,10 @@ class SuccessiveHalvingClassifier(SuccessiveHalving):
- If <-1: Use number of cores - 1 + `n_jobs`.
device: str, default="cpu"
Device on which to train the estimators. Use any string
that follows the [SYCL_DEVICE_FILTER][] filter selector,
e.g. `device="gpu"` to use the GPU. Read more in the
[user guide][accelerating-pipelines].
Device on which to run the estimators. Use any string that
follows the [SYCL_DEVICE_FILTER][] filter selector, e.g.
`#!python device="gpu"` to use the GPU. Read more in the
[user guide][gpu-acceleration].
engine: dict or None, default=None
Execution engine to use for [data][data-acceleration] and
Expand Down Expand Up @@ -1225,10 +1225,10 @@ class SuccessiveHalvingForecaster(SuccessiveHalving):
- If <-1: Use number of cores - 1 + `n_jobs`.
device: str, default="cpu"
Device on which to train the estimators. Use any string
that follows the [SYCL_DEVICE_FILTER][] filter selector,
e.g. `device="gpu"` to use the GPU. Read more in the
[user guide][accelerating-pipelines].
Device on which to run the estimators. Use any string that
follows the [SYCL_DEVICE_FILTER][] filter selector, e.g.
`#!python device="gpu"` to use the GPU. Read more in the
[user guide][gpu-acceleration].
engine: dict or None, default=None
Execution engine to use for [data][data-acceleration] and
Expand Down Expand Up @@ -1444,10 +1444,10 @@ class SuccessiveHalvingRegressor(SuccessiveHalving):
- If <-1: Use number of cores - 1 + `n_jobs`.
device: str, default="cpu"
Device on which to train the estimators. Use any string
that follows the [SYCL_DEVICE_FILTER][] filter selector,
e.g. `device="gpu"` to use the GPU. Read more in the
[user guide][accelerating-pipelines].
Device on which to run the estimators. Use any string that
follows the [SYCL_DEVICE_FILTER][] filter selector, e.g.
`#!python device="gpu"` to use the GPU. Read more in the
[user guide][gpu-acceleration].
engine: dict or None, default=None
Execution engine to use for [data][data-acceleration] and
Expand Down Expand Up @@ -1675,10 +1675,10 @@ class TrainSizingClassifier(TrainSizing):
- If <-1: Use number of cores - 1 + `n_jobs`.
device: str, default="cpu"
Device on which to train the estimators. Use any string
that follows the [SYCL_DEVICE_FILTER][] filter selector,
e.g. `device="gpu"` to use the GPU. Read more in the
[user guide][accelerating-pipelines].
Device on which to run the estimators. Use any string that
follows the [SYCL_DEVICE_FILTER][] filter selector, e.g.
`#!python device="gpu"` to use the GPU. Read more in the
[user guide][gpu-acceleration].
engine: dict or None, default=None
Execution engine to use for [data][data-acceleration] and
Expand Down Expand Up @@ -1902,10 +1902,10 @@ class TrainSizingForecaster(TrainSizing):
- If <-1: Use number of cores - 1 + `n_jobs`.
device: str, default="cpu"
Device on which to train the estimators. Use any string
that follows the [SYCL_DEVICE_FILTER][] filter selector,
e.g. `device="gpu"` to use the GPU. Read more in the
[user guide][accelerating-pipelines].
Device on which to run the estimators. Use any string that
follows the [SYCL_DEVICE_FILTER][] filter selector, e.g.
`#!python device="gpu"` to use the GPU. Read more in the
[user guide][gpu-acceleration].
engine: dict or None, default=None
Execution engine to use for [data][data-acceleration] and
Expand Down Expand Up @@ -2126,10 +2126,10 @@ class TrainSizingRegressor(TrainSizing):
- If <-1: Use number of cores - 1 + `n_jobs`.
device: str, default="cpu"
Device on which to train the estimators. Use any string
that follows the [SYCL_DEVICE_FILTER][] filter selector,
e.g. `device="gpu"` to use the GPU. Read more in the
[user guide][accelerating-pipelines].
Device on which to run the estimators. Use any string that
follows the [SYCL_DEVICE_FILTER][] filter selector, e.g.
`#!python device="gpu"` to use the GPU. Read more in the
[user guide][gpu-acceleration].
engine: dict or None, default=None
Execution engine to use for [data][data-acceleration] and
Expand Down
Loading

0 comments on commit 310735a

Please sign in to comment.