Skip to main content

stats_claw/resampling/types/
mod.rs

1//! Plain-data parameter structs for the library's statistical constructs.
2//!
3//! Each struct carries only the parameters (and any descriptive string fields)
4//! that identify a construct; all numerics live in the behaviour traits and
5//! inherent methods implemented for these types in the sibling modules. The
6//! structs derive `Default` so callers build them with struct-update syntax and
7//! set only the fields they care about.
8//!
9//! This file is produced mechanically by the `carve` tool from the source
10//! project; edit the carve inputs rather than this file.
11
12/// Partition-based scheme for estimating generalization performance.
13#[derive(Debug, Clone, Default)]
14pub struct CrossValidation {
15    /// Number of folds.
16    pub number_of_folds: i64,
17    /// Whether folds are stratified.
18    pub stratified: bool,
19    /// Random seed.
20    pub random_seed: i64,
21    /// Unique name identifying a resampling scheme.
22    pub scheme_name: String,
23    /// Free-text description.
24    pub description: String,
25}
26
27/// Leave-one-out resampling for bias and variance estimation.
28#[derive(Debug, Clone, Default)]
29pub struct JackknifeResampling {
30    /// Unique name identifying a resampling scheme.
31    pub scheme_name: String,
32    /// Free-text description.
33    pub description: String,
34}
35
36/// Cross-validation using a single observation per validation fold.
37#[derive(Debug, Clone, Default)]
38pub struct LeaveOneOutCrossValidation {
39    /// Unique name identifying a resampling scheme.
40    pub scheme_name: String,
41    /// Free-text description.
42    pub description: String,
43}
44
45/// Repeated random train-validation splits.
46#[derive(Debug, Clone, Default)]
47pub struct MonteCarloResampling {
48    /// Number of iterations.
49    pub number_of_iterations: i64,
50    /// Training fraction.
51    pub train_size: f64,
52    /// Random seed.
53    pub random_seed: i64,
54    /// Unique name identifying a resampling scheme.
55    pub scheme_name: String,
56    /// Free-text description.
57    pub description: String,
58}
59
60/// Cross-validation preserving class proportions across folds.
61#[derive(Debug, Clone, Default)]
62pub struct StratifiedCrossValidation {
63    /// Number of folds.
64    pub number_of_folds: i64,
65    /// Random seed.
66    pub random_seed: i64,
67    /// Unique name identifying a resampling scheme.
68    pub scheme_name: String,
69    /// Free-text description.
70    pub description: String,
71}