Skip to content

Commit

Permalink
branchmanager
Browse files Browse the repository at this point in the history
  • Loading branch information
tvdboom committed Sep 5, 2023
1 parent b4aebbb commit 36c9c4c
Show file tree
Hide file tree
Showing 51 changed files with 933 additions and 582 deletions.
49 changes: 43 additions & 6 deletions atom/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@
from __future__ import annotations

from logging import Logger
from pathlib import Path
from typing import Literal

from joblib.memory import Memory
from sklearn.base import clone
from typeguard import typechecked

from beartype import beartype
from atom.atom import ATOM
from atom.basetransformer import BaseTransformer
from atom.utils.types import (
Expand All @@ -23,7 +24,7 @@
)


@typechecked
@beartype
def ATOMModel(

Check notice on line 28 in atom/api.py

View workflow job for this annotation

GitHub Actions / Qodana Community for Python

PEP 8 naming convention violation

Function name should be lowercase
estimator: PREDICTOR,
name: str | None = None,
Expand Down Expand Up @@ -117,6 +118,7 @@ def ATOMModel(
return estimator


@beartype
class ATOMClassifier(BaseTransformer, ATOM):
"""Main class for classification tasks.
Expand Down Expand Up @@ -260,6 +262,16 @@ class ATOMClassifier(BaseTransformer, ATOM):
- "threading": Single-node, thread-based parallelism.
- "ray": Multi-node, process-based parallelism.
memory: bool, str, Path or Memory, default=True
Enables caching for memory optimization. Read more in the
[user guide][memory-considerations].
- If False: No caching is performed.
- If True: A default temp directory is used.
- If str: Path to the caching directory.
- If Path: A [pathlib.Path][] to the caching directory.
- If Memory: Object with the [joblib.Memory][] interface.
verbose: int, default=0
Verbosity level of the class. Choose from:
Expand Down Expand Up @@ -319,7 +331,6 @@ class ATOMClassifier(BaseTransformer, ATOM):
"""

@typechecked
def __init__(
self,
*arrays,
Expand All @@ -334,6 +345,7 @@ def __init__(
device: str = "cpu",
engine: ENGINE = {"data": "numpy", "estimator": "sklearn"},
backend: BACKEND = "loky",
memory: BOOL | str | Path | Memory = True,
verbose: Literal[0, 1, 2] = 0,

Check warning on line 349 in atom/api.py

View workflow job for this annotation

GitHub Actions / Qodana Community for Python

Invalid type hints definitions and usages

'Literal' may be parameterized with literal ints, byte and unicode strings, bools, Enum values, None, other literal types, or type aliases to other literal types
warnings: BOOL | WARNINGS = False,
logger: str | Logger | None = None,
Expand All @@ -345,6 +357,7 @@ def __init__(
device=device,
engine=engine,
backend=backend,
memory=memory,
verbose=verbose,
warnings=warnings,
logger=logger,
Expand Down Expand Up @@ -486,6 +499,16 @@ class ATOMForecaster(BaseTransformer, ATOM):
- "threading": Single-node, thread-based parallelism.
- "ray": Multi-node, process-based parallelism.
memory: bool, str, Path or Memory, default=True
Enables caching for memory optimization. Read more in the
[user guide][memory-considerations].
- If False: No caching is performed.
- If True: A default temp directory is used.
- If str: Path to the caching directory.
- If Path: A [pathlib.Path][] to the caching directory.
- If Memory: Object with the [joblib.Memory][] interface.
verbose: int, default=0
Verbosity level of the class. Choose from:
Expand Down Expand Up @@ -541,7 +564,7 @@ class ATOMForecaster(BaseTransformer, ATOM):
"""

@typechecked
@beartype
def __init__(
self,
*arrays,
Expand All @@ -553,6 +576,7 @@ def __init__(
device: str = "cpu",
engine: ENGINE = {"data": "numpy", "estimator": "sklearn"},
backend: BACKEND = "loky",
memory: BOOL | str | Path | Memory = True,
verbose: Literal[0, 1, 2] = 0,

Check warning on line 580 in atom/api.py

View workflow job for this annotation

GitHub Actions / Qodana Community for Python

Invalid type hints definitions and usages

'Literal' may be parameterized with literal ints, byte and unicode strings, bools, Enum values, None, other literal types, or type aliases to other literal types
warnings: BOOL | WARNINGS = False,
logger: str | Logger | None = None,
Expand All @@ -564,6 +588,7 @@ def __init__(
device=device,
engine=engine,
backend=backend,
memory=memory,
verbose=verbose,
warnings=warnings,
logger=logger,
Expand Down Expand Up @@ -715,6 +740,16 @@ class ATOMRegressor(BaseTransformer, ATOM):
- "threading": Single-node, thread-based parallelism.
- "ray": Multi-node, process-based parallelism.
memory: bool, str, Path or Memory, default=True
Enables caching for memory optimization. Read more in the
[user guide][memory-considerations].
- If False: No caching is performed.
- If True: A default temp directory is used.
- If str: Path to the caching directory.
- If Path: A [pathlib.Path][] to the caching directory.
- If Memory: Object with the [joblib.Memory][] interface.
verbose: int, default=0
Verbosity level of the class. Choose from:
Expand Down Expand Up @@ -774,7 +809,7 @@ class ATOMRegressor(BaseTransformer, ATOM):
"""

@typechecked
@beartype
def __init__(
self,
*arrays,
Expand All @@ -788,6 +823,7 @@ def __init__(
device: str = "cpu",
engine: ENGINE = {"data": "numpy", "estimator": "sklearn"},
backend: BACKEND = "loky",
memory: BOOL | str | Path | Memory = True,
verbose: Literal[0, 1, 2] = 0,

Check warning on line 827 in atom/api.py

View workflow job for this annotation

GitHub Actions / Qodana Community for Python

Invalid type hints definitions and usages

'Literal' may be parameterized with literal ints, byte and unicode strings, bools, Enum values, None, other literal types, or type aliases to other literal types
warnings: BOOL | WARNINGS = False,
logger: str | Logger | None = None,
Expand All @@ -799,6 +835,7 @@ def __init__(
device=device,
engine=engine,
backend=backend,
memory=memory,
verbose=verbose,
warnings=warnings,
logger=logger,
Expand Down
Loading

0 comments on commit 36c9c4c

Please sign in to comment.