XCSF  1.4.7
XCSF learning classifier system
xcs_supervised.h File Reference

Supervised regression learning functions. More...

#include "xcsf.h"
Include dependency graph for xcs_supervised.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

double xcs_supervised_fit (struct XCSF *xcsf, const struct Input *train_data, const struct Input *test_data, const bool shuffle, const int start, const int trials)
 Executes MAX_TRIALS number of XCSF learning iterations using the training data and test iterations using the test data. More...
 
double xcs_supervised_score (struct XCSF *xcsf, const struct Input *data, const double *cover)
 Calculates the XCSF error for the input data. More...
 
double xcs_supervised_score_n (struct XCSF *xcsf, const struct Input *data, const int N, const double *cover)
 Calculates the XCSF error for a subsample of the input data. More...
 
void xcs_supervised_predict (struct XCSF *xcsf, const double *x, double *pred, const int n_samples, const double *cover)
 Calculates the XCSF predictions for the provided input. More...
 

Detailed Description

Supervised regression learning functions.

Author
Richard Preen rpree.nosp@m.n@gm.nosp@m.ail.c.nosp@m.om
Date
2015–2024.

Definition in file xcs_supervised.h.

Function Documentation

◆ xcs_supervised_fit()

double xcs_supervised_fit ( struct XCSF xcsf,
const struct Input train_data,
const struct Input test_data,
const bool  shuffle,
const int  start,
const int  trials 
)

Executes MAX_TRIALS number of XCSF learning iterations using the training data and test iterations using the test data.

Parameters
[in]xcsfThe XCSF data structure.
[in]train_dataThe input data to use for training.
[in]test_dataThe input data to use for testing.
[in]shuffleWhether to randomise the instances during training.
[in]startIndex to begin sampling.
[in]trialsNumber of trials to execute.
Returns
The average XCSF training error using the loss function.

Definition at line 99 of file xcs_supervised.c.

References param_set_explore(), perf_print(), Input::x, Input::x_dim, xcs_supervised_sample(), xcs_supervised_trial(), Input::y, and Input::y_dim.

Referenced by XCS::fit(), and main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ xcs_supervised_predict()

void xcs_supervised_predict ( struct XCSF xcsf,
const double *  x,
double *  pred,
const int  n_samples,
const double *  cover 
)

Calculates the XCSF predictions for the provided input.

Parameters
[in]xcsfThe XCSF data structure.
[in]xThe input feature variables.
[out]predThe calculated XCSF predictions.
[in]n_samplesThe number of instances.
[in]coverIf cover is not NULL and the match set is empty, the prediction array will be set to this value instead of covering.

Definition at line 141 of file xcs_supervised.c.

References param_set_explore(), and xcs_supervised_trial().

Referenced by XCS::predict().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ xcs_supervised_score()

double xcs_supervised_score ( struct XCSF xcsf,
const struct Input data,
const double *  cover 
)

Calculates the XCSF error for the input data.

Parameters
[in]xcsfThe XCSF data structure.
[in]dataThe input data to calculate the error.
[in]coverIf cover is not NULL and the match set is empty, the prediction array will be set to this value instead of covering.
Returns
The average XCSF error using the loss function.

Definition at line 161 of file xcs_supervised.c.

References Input::n_samples, param_set_explore(), Input::x, Input::x_dim, xcs_supervised_trial(), Input::y, and Input::y_dim.

Referenced by XCS::fit(), XCS::score(), and xcs_supervised_score_n().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ xcs_supervised_score_n()

double xcs_supervised_score_n ( struct XCSF xcsf,
const struct Input data,
const int  N,
const double *  cover 
)

Calculates the XCSF error for a subsample of the input data.

Parameters
[in]xcsfThe XCSF data structure.
[in]dataThe input data to calculate the error.
[in]NThe maximum number of samples to draw randomly for scoring.
[in]coverIf cover is not NULL and the match set is empty, the prediction array will be set to this value instead of covering.
Returns
The average XCSF error using the loss function.

Definition at line 185 of file xcs_supervised.c.

References Input::n_samples, param_set_explore(), Input::x, Input::x_dim, xcs_supervised_sample(), xcs_supervised_score(), xcs_supervised_trial(), Input::y, and Input::y_dim.

Referenced by XCS::score().

Here is the call graph for this function:
Here is the caller graph for this function: