cascade.utils.sklearn#
- class cascade.utils.sklearn.SkMetric(name: str, *args: Any, value: Optional[SupportsFloat] = None, dataset: Optional[str] = None, split: Optional[str] = None, direction: Optional[Literal['up', 'down']] = None, interval: Optional[Tuple[SupportsFloat, SupportsFloat]] = None, extra: Optional[Dict[str, SupportsFloat]] = None, **kwargs: Any)[source]#
-
- __init__(name: str, *args: Any, value: Optional[SupportsFloat] = None, dataset: Optional[str] = None, split: Optional[str] = None, direction: Optional[Literal['up', 'down']] = None, interval: Optional[Tuple[SupportsFloat, SupportsFloat]] = None, extra: Optional[Dict[str, SupportsFloat]] = None, **kwargs: Any) None[source]#
-
Creates Metric
- Parameters:
-
-
name (str) – Name of the metric
-
value (Optional[MetricType]) – Scalar value of the metric, by default None
-
dataset (Optional[str]) – Dataset on which metric was computed, by default None
-
split (Optional[str]) – The split of the dataset for example train or test, by default None
-
direction (Literal["up", "down", None]) – Is metric better when it is greater or less, by default None
-
interval (Optional[Tuple[MetricType, MetricType]]) – Upper and lower boundaries of value, by default None
-
extra (Optional[Dict[str, Any]]) – Extra values that needs to be stored with metric, by default None
-
- class cascade.utils.sklearn.SkModel(*args: Any, blocks: Optional[List[Any]] = None, **kwargs: Any)[source]#
-
Wrapper for sklearn models. Accepts the name and block to form pipeline. Can fit, evaluate, predict save and load out of the box.
- __init__(*args: Any, blocks: Optional[List[Any]] = None, **kwargs: Any) None[source]#
-
- Parameters:
-
blocks (list, optional) – List of sklearn transformers to make a pipeline from
- get_meta() List[Dict[Any, Any]][source]#
-
- Returns:
-
meta – A list where first element is this object’s metadata. All other elements represent the other stages of pipeline if present.
Meta can be anything that is worth to document about the object and its properties.
Meta is a list (see Meta type alias) to allow the formation of pipelines.
- Return type:
-
Meta
- load_artifact(path: str, *args: Any, **kwargs: Any) None[source]#
-
Loads sklearn pipeline
Args and kwargs are passed into pickle.load
- Parameters:
-
path (str) – the folder from which to load pipeline.pkl
- Raises:
-
ValueError – if the path is not a valid directory