|
|
lucid
0.0.1
Lifting-based Uncertain Control Invariant Dynamics
|
Leave-One-Out cross-validation (LOOCV) is a specific type of cross-validation where the number of folds equals the number of data points in the dataset. More...
#include <LeaveOneOut.h>
Public Member Functions | |
| Dimension | num_folds (ConstMatrixRef training_inputs) const override |
| In the Leave-One-Out cross-validation (LOOCV) strategy, the number of folds is equal to the number of samples in the dataset, i.e., \( n \). | |
| std::string | to_string () const override |
| Obtain the string representation of this object. | |
Public Member Functions inherited from lucid::CrossValidator | |
| double | fit (Estimator &estimator, ConstMatrixRef training_inputs, ConstMatrixRef training_outputs, const scorer::Scorer &scorer=nullptr) const |
Fit the estimator using cross-validation on the provided training_inputs and training_outputs. | |
| double | fit (Estimator &estimator, ConstMatrixRef training_inputs, ConstMatrixRef training_outputs, const Tuner &tuner, const scorer::Scorer &scorer=nullptr) const |
Fit the estimator using cross-validation on the provided training_inputs and training_outputs using the tuner tuner to optimize @hp. | |
| std::vector< double > | score (const Estimator &estimator, ConstMatrixRef inputs, ConstMatrixRef outputs, const scorer::Scorer &scorer=nullptr) const |
Evaluate the estimator using cross-validation on the provided inputs and outputs. | |
Private Member Functions | |
| std::pair< SliceSelector, SliceSelector > | compute_folds (ConstMatrixRef training_inputs) const override |
| Compute the training and validation folds for cross-validation. | |
Additional Inherited Members | |
Public Types inherited from lucid::CrossValidator | |
| using | SliceSelector = std::vector<std::vector<Index>> |
| Type alias for slice selector. | |
Protected Member Functions inherited from lucid::CrossValidator | |
| double | fit (Estimator &estimator, ConstMatrixRef training_inputs, ConstMatrixRef training_outputs, const Tuner *tuner, const scorer::Scorer &scorer) const |
Fit the estimator using cross-validation on the provided training_inputs and training_outputs using the tuner tuner to optimize @hp, if provided. | |
Leave-One-Out cross-validation (LOOCV) is a specific type of cross-validation where the number of folds equals the number of data points in the dataset.
In LOOCV, each data point is used once as a validation set while the remaining data points form the training set. This means that for a dataset with n samples, the model is trained n times, each time leaving out one sample for validation. LOOCV is particularly useful for small datasets, as it maximizes the amount of training data used in each iteration. However, it can be computationally expensive for large datasets due to the high number of training iterations required. Moreover, LOOCV can lead to high variance in the model's performance estimate, as each training set is very similar to the others, differing by only one sample.
---
title: "Leave one out"
config:
packet:
bitWidth: 64
bitsPerRow: 10
showBits: false
---
packet
+9: "Training"
+1: "Validation"
+8: "Training"
+1: "Validation"
+1: "Training"
+10: "..."
+1: "Training"
+1: "Validation"
+8: "Training"
+1: "Validation"
+9: "Training"
|
nodiscardoverrideprivatevirtual |
Compute the training and validation folds for cross-validation.
Each fold is represented as a pair of index vectors, where the first vector contains the indices for the training set and the second vector contains the indices for the validation set.
| training_inputs | \( \texttip{n}{Number of samples} \times \texttip{d_x}{Dimension of the input vector space} \) training input data |
Implements lucid::CrossValidator.
|
inlinenodiscardoverridevirtual |
In the Leave-One-Out cross-validation (LOOCV) strategy, the number of folds is equal to the number of samples in the dataset, i.e., \( n \).
| training_inputs | \( \texttip{n}{Number of samples} \times \texttip{d_x}{Dimension of the input vector space} \) training input data |
Implements lucid::CrossValidator.
|
nodiscardoverridevirtual |
Obtain the string representation of this object.
Reimplemented from lucid::CrossValidator.