31 evaluation_criterion, autolock)
50 void CCrossValidation::init()
60 "classes for intermediade cross-validation results",
101 SG_WARNING(
"%s does not support locking. Autolocking is skipped. "
102 "Set autolock flag to false to get rid of warning.\n",
138 SG_DEBUG(
"entering cross-validation run %d \n", i)
140 SG_DEBUG(
"result of cross-validation run %d is %f\n", i, results[i])
167 SG_ERROR(
"%d is an illegal number of repetitions\n", num_runs)
177 SG_DEBUG(
"building index sets for %d-fold cross-validation\n", num_subsets)
190 for (
index_t i=0; i <num_subsets; ++i)
267 #pragma omp parallel for
268 for (
index_t i=0; i <num_subsets; ++i)
315 inverse_subset_indices.
vlen,
"training indices");
320 machine->
train(features);
352 subset_indices.
vlen,
"test indices");
367 SG_DEBUG(
"result on fold %d is %f\n", i, results[i])
virtual void update_fold_index(index_t fold_index, const char *prefix="")
virtual void build_subsets()=0
index_t get_num_subsets() const
virtual void update_train_indices(SGVector< index_t > indices, const char *prefix="")
Parallel * get_global_parallel()
CSGObject * get_next_element()
virtual CLabels * apply_locked(SGVector< index_t > indices)
The class Labels models labels, i.e. class assignments of objects.
virtual CSGObject * clone()
static float64_t std_deviation(SGVector< float64_t > values)
virtual CEvaluationResult * evaluate()
virtual float64_t evaluate(CLabels *predicted, CLabels *ground_truth)=0
virtual void update_test_true_result(CLabels *results, const char *prefix="")
Abstract base class for all splitting types. Takes a CLabels instance and generates a desired number ...
virtual void init_num_runs(index_t num_runs, const char *prefix="")
CEvaluation * m_evaluation_criterion
virtual void update_test_indices(SGVector< index_t > indices, const char *prefix="")
type to encapsulate the results of an evaluation run.
virtual const char * get_name() const
virtual bool train_locked(SGVector< index_t > indices)
void set_num_runs(int32_t num_runs)
A generic learning machine interface.
virtual void set_indices(SGVector< index_t > indices)
void display_vector(const char *name="vector", const char *prefix="") const
virtual void update_trained_machine(CMachine *machine, const char *prefix="")
CSGObject * get_first_element()
virtual void set_store_model_features(bool store_model)
Class for managing individual folds in cross-validation.
Class SGObject is the base class of all shogun objects.
virtual void data_unlock()
virtual const char * get_name() const
virtual void data_lock(CLabels *labs, CFeatures *features)
virtual void remove_subset()
Abstract class that contains the result generated by the MachineEvaluation class. ...
Machine Evaluation is an abstract class that evaluates a machine according to some criterion...
virtual CLabels * get_labels()
virtual void add_subset(SGVector< index_t > subset)
SGVector< index_t > generate_subset_inverse(index_t subset_idx)
static floatmax_t mean(SGVector< T > vec)
EMessageType get_loglevel() const
virtual void update_test_result(CLabels *results, const char *prefix="")
virtual bool supports_locking() const
virtual void post_update_results()
virtual float64_t evaluate_one_run()
all of classes and functions are contained in the shogun namespace
virtual ~CCrossValidation()
SGVector< index_t > generate_subset_indices(index_t subset_idx)
virtual void remove_subset()
virtual void update_evaluation_result(float64_t result, const char *prefix="")
The class Features is the base class of all feature objects.
bool append_element(CSGObject *data)
virtual bool train(CFeatures *data=NULL)
void add_cross_validation_output(CCrossValidationOutput *cross_validation_output)
virtual void init_expose_labels(CLabels *labels)
virtual void set_labels(CLabels *lab)
bool is_data_locked() const
virtual void init_num_folds(index_t num_folds, const char *prefix="")
virtual void update_run_index(index_t run_index, const char *prefix="")
Class Evaluation, a base class for other classes used to evaluate labels, e.g. accuracy of classifica...
CSplittingStrategy * m_splitting_strategy
virtual void add_subset(SGVector< index_t > subset)
Class List implements a doubly connected list for low-level-objects.
virtual CLabels * apply(CFeatures *data=NULL)