class cv::ml::ParamGrid

Overview

The structure represents the logarithmic grid range of statmodel parameters. Moreā€¦

#include <ml.hpp>

class ParamGrid
{
public:
    // fields

    double logStep;
    double maxVal;
    double minVal;

    // construction

    ParamGrid();

    ParamGrid(
        double _minVal,
        double _maxVal,
        double _logStep
        );

    // methods

    static
    Ptr<ParamGrid>
    create(
        double minVal = 0.,
        double maxVal = 0.,
        double logstep = 1.
        );
};

Detailed Documentation

The structure represents the logarithmic grid range of statmodel parameters.

It is used for optimizing statmodel accuracy by varying model parameters, the accuracy estimate being computed by cross-validation.

Fields

double logStep

Logarithmic step for iterating the statmodel parameter.

The grid determines the following iteration sequence of the statmodel parameter values:

\[(minVal, minVal*step, minVal*{step}^2, \dots, minVal*{logStep}^n),\]

where \(n\) is the maximal index satisfying

\[\texttt{minVal} * \texttt{logStep} ^n < \texttt{maxVal}\]

The grid is logarithmic, so logStep must always be greater then 1. Default value is 1.

double maxVal

Maximum value of the statmodel parameter. Default value is 0.

double minVal

Minimum value of the statmodel parameter. Default value is 0.

Construction

ParamGrid()

Default constructor.

ParamGrid(
    double _minVal,
    double _maxVal,
    double _logStep
    )

Constructor with parameters.

Methods

static
Ptr<ParamGrid>
create(
    double minVal = 0.,
    double maxVal = 0.,
    double logstep = 1.
    )

Creates a ParamGrid Ptr that can be given to the SVM::trainAuto method.

Parameters:

minVal minimum value of the parameter grid
maxVal maximum value of the parameter grid
logstep Logarithmic step for iterating the statmodel parameter