Skip to content

Commit

Permalink
new engine 1
Browse files Browse the repository at this point in the history
  • Loading branch information
tvdboom committed Feb 4, 2024
1 parent 0c7209e commit c10c9fe
Show file tree
Hide file tree
Showing 4 changed files with 5,414 additions and 7,681 deletions.
26 changes: 7 additions & 19 deletions atom/data_cleaning.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def __repr__(self, N_CHAR_MAX: Int = 700) -> str:
and self.engine == EngineTuple()
and sklearn.get_config()["print_changed_only"]
):
out = re.sub(r"engine=Engine\(\)", "", out)
out = re.sub(r"engine={data='numpy', estimator='sklearn'}", "", out)
out = re.sub(r"((?<=\(),\s|,\s(?=\))|,\s(?=,\s))", "", out) # Drop comma-spaces

return out
Expand Down Expand Up @@ -3033,24 +3033,12 @@ class Scaler(TransformerMixin, OneToOneFeatureMixin, _SetOutputMixin):
`#!python device="gpu"` to use the GPU. Read more in the
[user guide][gpu-acceleration].
engine: str, dict or None, default=None
Execution engine to use for [data][data-acceleration] and
[estimators][estimator-acceleration]. The value should be
one of the possible values to change one of the two engines,
or a dictionary with keys `data` and `estimator`, with their
corresponding choice as values to change both engines. If
None, the default values are used. Choose from:
- "data":
engine: str, default="sklearn"
Execution engine for [estimators][estimator-acceleration].
Choose from:
- "pandas" (default)
- "pyarrow"
- "modin"
- "estimator":
- "sklearn" (default)
- "cuml"
- "sklearn"
- "cuml"
verbose: int, default=0
Verbosity level of the class. Choose from:
Expand Down Expand Up @@ -3119,7 +3107,7 @@ def __init__(
*,
include_binary: Bool = False,
device: str = "cpu",
engine: Engine = None,
engine: Engine = "sklearn",
verbose: Verbose = 0,
**kwargs,
):
Expand Down
6 changes: 2 additions & 4 deletions atom/utils/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,8 @@ class EngineTuple(NamedTuple):
estimator: EngineEstimatorOptions = "sklearn"

def __repr__(self) -> str:
"""Hide default values and change the name of the class."""
data = f"data={self[0]}" if self[0] != EngineTuple().data else ""
estimator = f"estimator={self[1]}" if self[1] != EngineTuple().estimator else ""
return f"Engine({data}{', ' if data else ''}{estimator})"
"""Print representation as dictionary."""
return self._asdict().__repr__()


class SPTuple(NamedTuple):
Expand Down
4 changes: 2 additions & 2 deletions atom/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2857,8 +2857,8 @@ def wrapper(self, *args, **kwargs):
# For sktime estimators, we are interested in y, not X
X = args[0] if len(args) > 0 else kwargs.get("X")

Check notice on line 2858 in atom/utils/utils.py

View workflow job for this annotation

GitHub Actions / Qodana Community for Python

PEP 8 naming convention violation

Variable in function should be lowercase

# We add the attributes and methods after running fit
# to avoid deleting them with .reset() calls
# We add the attributes and methods after running
# fit to avoid deleting them with .reset() calls
if X is not None:
if not hasattr(self, "feature_names_in_"):
BaseEstimator._check_feature_names(self, X, reset=True)

Check notice on line 2864 in atom/utils/utils.py

View workflow job for this annotation

GitHub Actions / Qodana Community for Python

Accessing a protected member of a class or a module

Access to a protected member _check_feature_names of a class
Expand Down
Loading

0 comments on commit c10c9fe

Please sign in to comment.