SG++-Doxygen-Documentation
sgpp::base::PredictiveRefinementIndicator Class Reference

A refinement error indicator for regression problems based on the residuals of the datasets. More...

#include <PredictiveRefinementIndicator.hpp>

Inheritance diagram for sgpp::base::PredictiveRefinementIndicator:
sgpp::base::RefinementFunctor

Public Types

typedef GridPoint counter_key_type
 
typedef uint64_t counter_value_type
 
typedef std::pair< size_t, double > value_type
 
- Public Types inherited from sgpp::base::RefinementFunctor
typedef double value_type
 

Public Member Functions

uint64_t getMinSupportPoints () const
 Returns the lower bound of refinement criterion (e.g., alpha or error. More...
 
size_t getRefinementsNum () const override
 Returns the maximal number of points that should be refined. More...
 
double getRefinementThreshold () const override
 Returns the threshold for refinement. More...
 
virtual double operator() (GridPoint &point) const
 This should be returning a refinement indicator for the specified grid point The point with the highest value will be refined first. More...
 
double operator() (GridStorage &storage, size_t seq) const override
 This should be returning a refinement value for every grid point. More...
 
 PredictiveRefinementIndicator (Grid &grid, DataMatrix &dataSet, DataVector &errorVector, size_t refinements_num=1, double threshold=0.0, uint64_t minSupportPoints=0)
 Constructor. More...
 
double runOperator (GridStorage &storage, size_t seq)
 
void setMinSupportPoints (uint64_t minSupportPoints)
 
double start () const override
 Returns the lower bound of refinement criterion (e.g., alpha or error) (lower bound). More...
 
virtual ~PredictiveRefinementIndicator ()
 Destructor. More...
 
- Public Member Functions inherited from sgpp::base::RefinementFunctor
virtual double getTotalRefinementValue (GridStorage &storage) const
 Returns the total sum of local (error) indicators used for refinement. More...
 
 RefinementFunctor ()
 Constructor. More...
 
virtual ~RefinementFunctor ()
 Destructor. More...
 

Protected Member Functions

double basisFunctionEvalHelper (level_t level, index_t index, double value)
 

Protected Attributes

DataMatrixdataSet
 
DataVectorerrorVector
 
size_t refinementsNum
 number of grid points to refine More...
 
double threshold
 threshold, only the points with greater to equal absolute values More...
 

Detailed Description

A refinement error indicator for regression problems based on the residuals of the datasets.

It calculates an error messure based on the information from the data set: For a new grid point g on level l and index i, it calculates the indicator as a sum of squared residuals ( (value of sample from dataset - grid evaluated at the sample's coordinates), squared), weighted with the underlying basis function of the grid point.

Member Typedef Documentation

◆ counter_key_type

◆ counter_value_type

◆ value_type

typedef std::pair<size_t, double> sgpp::base::PredictiveRefinementIndicator::value_type

Constructor & Destructor Documentation

◆ PredictiveRefinementIndicator()

sgpp::base::PredictiveRefinementIndicator::PredictiveRefinementIndicator ( Grid grid,
DataMatrix dataSet,
DataVector errorVector,
size_t  refinements_num = 1,
double  threshold = 0.0,
uint64_t  minSupportPoints = 0 
)

Constructor.

Parameters
gridDataVector that is basis for refinement decisions. The i-th entry corresponds to the i-th grid point.
dataSetcontains all points of the source data set. Each row contains coordinates of a single grid point, without the function evaluation (meaning only data from omega).
errorVectora DataVector containing the squared absolute error (given value of data point - evaluation of sparse grid at the data point position) for each grid point in dataSet.
refinements_numthe amount of grid points to maximally be refined or created, depending on refinement strategy.
thresholdThe absolute value of the entries have to be greater or equal than the threshold
minSupportPointsThe minimal number of data points that have to be within the support of a basis function for refinement.

References sgpp::base::Grid::getType(), refinementsNum, and threshold.

◆ ~PredictiveRefinementIndicator()

virtual sgpp::base::PredictiveRefinementIndicator::~PredictiveRefinementIndicator ( )
inlinevirtual

Member Function Documentation

◆ basisFunctionEvalHelper()

double sgpp::base::PredictiveRefinementIndicator::basisFunctionEvalHelper ( level_t  level,
index_t  index,
double  value 
)
protected

◆ getMinSupportPoints()

uint64_t sgpp::base::PredictiveRefinementIndicator::getMinSupportPoints ( ) const
inline

Returns the lower bound of refinement criterion (e.g., alpha or error.

◆ getRefinementsNum()

size_t sgpp::base::PredictiveRefinementIndicator::getRefinementsNum ( ) const
overridevirtual

Returns the maximal number of points that should be refined.

The maximal number of points to refine is set in the constructor of the implementing class.

Returns
number of points that should refined. Default value: 1.

Reimplemented from sgpp::base::RefinementFunctor.

References refinementsNum.

Referenced by ~PredictiveRefinementIndicator().

◆ getRefinementThreshold()

double sgpp::base::PredictiveRefinementIndicator::getRefinementThreshold ( ) const
overridevirtual

Returns the threshold for refinement.

Only the grid points with absolute value of refinement criterion (e.g., alpha or error) greater or equal to this threshold will be refined.

Returns
threshold value for refinement. Default value: 0.

Implements sgpp::base::RefinementFunctor.

References threshold.

Referenced by ~PredictiveRefinementIndicator().

◆ operator()() [1/2]

double sgpp::base::PredictiveRefinementIndicator::operator() ( GridPoint point) const
virtual

This should be returning a refinement indicator for the specified grid point The point with the highest value will be refined first.

Parameters
pointfor which to calculate an indicator value
Returns
refinement value

errorVector->get(row)

References analyse_erg::counter, dataSet, chess::dim, errorVector, sgpp::base::Basis< LT, IT >::eval(), sgpp::base::DataVector::get(), sgpp::base::DataMatrix::get(), sgpp::base::Grid::getBasis(), sgpp::base::HashGridPoint::getDimension(), sgpp::base::HashGridPoint::getIndex(), sgpp::base::HashGridPoint::getLevel(), sgpp::base::DataMatrix::getNrows(), and level.

Referenced by setMinSupportPoints(), and ~PredictiveRefinementIndicator().

◆ operator()() [2/2]

double sgpp::base::PredictiveRefinementIndicator::operator() ( GridStorage storage,
size_t  seq 
) const
overridevirtual

This should be returning a refinement value for every grid point.

The point with the highest value will be refined first.

Parameters
storagereference to the grids storage object
seqsequence number in the coefficients array
Returns
refinement value

Implements sgpp::base::RefinementFunctor.

◆ runOperator()

double sgpp::base::PredictiveRefinementIndicator::runOperator ( GridStorage storage,
size_t  seq 
)

◆ setMinSupportPoints()

void sgpp::base::PredictiveRefinementIndicator::setMinSupportPoints ( uint64_t  minSupportPoints)
inline

References operator()().

◆ start()

double sgpp::base::PredictiveRefinementIndicator::start ( ) const
overridevirtual

Returns the lower bound of refinement criterion (e.g., alpha or error) (lower bound).

The refinement value of grid points to be refined have to be larger than this value

Returns
lower bound

Implements sgpp::base::RefinementFunctor.

Referenced by sgpp::base::PredictiveRefinement::getIndicator(), and ~PredictiveRefinementIndicator().

Member Data Documentation

◆ dataSet

DataMatrix& sgpp::base::PredictiveRefinementIndicator::dataSet
protected

Referenced by operator()().

◆ errorVector

DataVector& sgpp::base::PredictiveRefinementIndicator::errorVector
protected

Referenced by operator()().

◆ refinementsNum

size_t sgpp::base::PredictiveRefinementIndicator::refinementsNum
protected

number of grid points to refine

Referenced by getRefinementsNum(), and PredictiveRefinementIndicator().

◆ threshold

double sgpp::base::PredictiveRefinementIndicator::threshold
protected

threshold, only the points with greater to equal absolute values

Referenced by getRefinementThreshold(), and PredictiveRefinementIndicator().


The documentation for this class was generated from the following files: