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
61
62
63
64
//! Splitting, scoring, cross-validation, and hyperparameter search.
//!
//! The four concerns compose in one direction. A splitter turns a row count
//! into deterministic validated [`Split`] partitions. A score turns one batch
//! of model output into a number, and declares both which output it reads and
//! which direction is better. Cross-validation fits one model per split and
//! scores it. Search evaluates a [`ParameterGrid`] by cross-validating every
//! candidate.
//!
//! [`ClassificationScore`] and [`RegressionScore`] are the seam that makes the
//! last three open: [`ClassificationScorer`] and [`RegressionScorer`] are one
//! implementation of them rather than a privileged one, and cross-validation,
//! search, and permutation importance reach a metric only through it. So a
//! caller evaluates on a metric FerricML does not enumerate without
//! reimplementing the fold loop, the prediction call, or the class-layout
//! handling.
//!
//! Two choices are carried rather than duplicated into more entry points: the
//! target vocabulary is a type parameter, any
//! [`ClassificationTargets`](crate::data::ClassificationTargets), and whether a
//! fitted model offers probabilities is a value, the [`ScorableClassifier`]
//! view. There is therefore one classifier cross-validation function and one
//! classifier search function, and a further target shape or model capability
//! is an implementation rather than another entry point.
//!
//! Everything here is serial and deterministic: a fixed split order, fit
//! parameters, seed, and thread count reproduce the same fitted models and the
//! same scores, and errors carry the zero-based fold the failure came from.
pub use ;
pub use ;
pub use ;
pub use ;
/// The one classifier scoring implementation, for crate consumers that are
/// generic over the target vocabulary.
///
/// `inspection` reaches it here for the same reason cross-validation does: it
/// holds a `ClassificationTargets` value rather than a named container, so
/// neither public wrapper is a vocabulary it could pick. This is not a wider
/// contract than the public ones — it is the same one, minus the choice of
/// which target type to name.
pub use score_labelled;