-
Notifications
You must be signed in to change notification settings - Fork 131
Expand file tree
/
Copy pathprotocol.py
More file actions
60 lines (47 loc) · 1.26 KB
/
protocol.py
File metadata and controls
60 lines (47 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
"""Protocols definition used to remove adherence to ``skore`` for type checking."""
from __future__ import annotations
from collections.abc import Callable
from typing import TYPE_CHECKING, Any, Literal, Protocol, runtime_checkable
if TYPE_CHECKING:
from pandas import DataFrame
DataSource = Literal["train", "test"] | None
Aggregate = Literal["mean", "std"]
@runtime_checkable
class Display(Protocol):
"""Protocol equivalent to ``skore.Display``."""
frame: Callable[..., DataFrame]
plot: Callable[..., None]
@runtime_checkable
class EstimatorReport(Protocol):
"""Protocol equivalent to ``skore.EstimatorReport``."""
_hash: int
cache_predictions: Any
clear_cache: Any
_cache: Any
metrics: Any
data: Any
ml_task: str
estimator: Any
estimator_name_: str
X_train: Any
y_train: Any
X_test: Any
y_test: Any
fit: Any
@runtime_checkable
class CrossValidationReport(Protocol):
"""Protocol equivalent to ``skore.CrossValidationReport``."""
_hash: int
cache_predictions: Any
clear_cache: Any
_cache: Any
metrics: Any
data: Any
estimator_reports_: Any
ml_task: str
estimator: Any
estimator_name_: str
X: Any
y: Any
splitter: Any
split_indices: Any