Medial Code Documentation
Loading...
Searching...
No Matches
CrossValidator.h
1// Cross Validator = an object for performing cross validation = learning set filterer + model + test set filterer
2
3#ifndef _MED_CV_H_
4#define _MED_CV_H_
5
6#include <InfraMed/InfraMed/InfraMed.h>
12#include <MedProcessTools/MedProcessTools/MedSamples.h>
13#include <MedProcessTools/MedProcessTools/SampleFilter.h>
15
16#define DEFAULT_CV_NTHREADS 8
17
18// TBD : splits object should be integrated here
19
20//.......................................................................................
21//.......................................................................................
22// An object for performing cross-validation
23//.......................................................................................
24//.......................................................................................
25
27public:
28
29 // Threading
30 int nthreads;
31
32 // Learning set filter(s)
33 vector <SampleFilter *> learning_set_filters;
34
35 // Test set filter(s)
36 vector< SampleFilter *> test_set_filters;
37
38 // Model
39 MedModel *model;
40
41 // Constructor/Destructor
42 CrossValidator() { nthreads = DEFAULT_CV_NTHREADS; };
43 CrossValidator(MedModel *_model) { nthreads = DEFAULT_CV_NTHREADS; model = _model; };
44 ~CrossValidator() {};
45
46 // Add
47 void add_learning_set_filter(SampleFilter *filter) { learning_set_filters.push_back(filter); };
48 void add_test_set_filter(SampleFilter *filter) { test_set_filters.push_back(filter); };
49
50 // Run
51 int doCV(MedPidRepository& rep, MedSamples& samples, int nfolds, MedSamples& outSamples);
52 int doCV(MedPidRepository& rep, MedSamples& samples, int nfolds, map<int, int>& folds, MedSamples& outSamples);
53};
54
55#endif
FeatureGenerator : creating features from raw signals.
A virtual class of processes on MedFeatures; E.g.
Logger.h - allowing logs with more control.
MedAlgo - APIs to different algorithms: Linear Models, RF, GBM, KNN, and more.
RepProcessor is the parent class for processing a MedRepository or PidDynamicRec Basic functionalitie...
Definition CrossValidator.h:26
A model = repCleaner + featureGenerator + featureProcessor + MedPredictor.
Definition MedModel.h:56
Definition MedPidRepository.h:87
MedSamples represent a collection of samples per different id The data is conatined in a vector of ...
Definition MedSamples.h:129
Definition SampleFilter.h:41