Skip to content

Commit 2d0e3e0

Browse files
committed
WIP
1 parent 9838607 commit 2d0e3e0

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

skore-hub-project/src/skore_hub_project/report/cross_validation_report.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from collections import defaultdict
44
from functools import cached_property
5-
from typing import ClassVar
5+
from typing import Any, ClassVar
66

77
import numpy as np
88
from pydantic import computed_field
@@ -124,9 +124,14 @@ class CrossValidationReportPayload(ReportPayload[CrossValidationReport]):
124124
TableReport,
125125
)
126126

127-
def model_post_init(self, context): # noqa: D102
127+
def model_post_init(self, _: Any) -> None: # noqa: D102
128+
self.__sample_to_class_index: list[int] | None
129+
self.__classes: list[str] | None
130+
128131
if "classification" in self.ml_task:
129-
class_to_class_indice = defaultdict(lambda: len(class_to_class_indice))
132+
class_to_class_indice: defaultdict[Any, int] = defaultdict(
133+
lambda: len(class_to_class_indice)
134+
)
130135

131136
self.__sample_to_class_index = [
132137
class_to_class_indice[sample] for sample in self.report.y

0 commit comments

Comments
 (0)