![]() |
SG++-Doxygen-Documentation
|
Multiple class refinement is based on the zero-crossing based refinement. More...
#include <MultipleClassRefinementFunctor.hpp>
Public Member Functions | |
double | getBorderPenalty () |
Gets the factor, the borders are penalized with. | |
double | getTopPercent () |
Gets the range in which densities are considered to be close. | |
MultipleClassRefinementFunctor (std::vector< base::Grid * > grids, std::vector< base::DataVector * > alphas, std::vector< double > priors, size_t refinements_num, size_t partCombined, double thresh) | |
Constructor. | |
double | operator() (base::GridStorage &storage, size_t seq) const override |
This should be returning a refinement value for every grid point. | |
void | refine () |
Organizes the refinement of the classes uses set parameter to execute the refinement step. | |
void | setBorderPenalty (double newPenalty) |
Sets the factor, used to penalize the borders. | |
void | setTopPercent (double newPercent) |
Sets the range in which densities are considered to be close. | |
![]() | |
size_t | getNumGrids () override |
Returns the number of grids the functor can / does refine. | |
size_t | getRefinementsNum () const override |
Returns the maximal number of points that should be refined. | |
double | getRefinementThreshold () const override |
Returns the threshold for refinement. | |
double | operator() (base::GridStorage &storage, size_t seq) const override |
This should be returning a refinement value for every grid point. | |
void | preComputeEvaluations () override |
Precomputes grid evaluations for all grids. | |
void | setGridIndex (size_t grid_index) override |
Sets the index (into the vector of grids) of the grid to be refined. | |
double | start () const override |
Returns the lower bound of refinement criterion (e.g., alpha or error) (lower bound). | |
ZeroCrossingRefinementFunctor (std::vector< base::Grid * > grids, std::vector< base::DataVector * > alphas, std::vector< double > priors, size_t refinements_num=1, bool level_penalize=false, bool pre_compute=false, double threshold=0.0) | |
Constructor. | |
~ZeroCrossingRefinementFunctor () override | |
![]() | |
virtual | ~MultiGridRefinementFunctor () |
![]() | |
virtual double | getTotalRefinementValue (GridStorage &storage) const |
Returns the total sum of local (error) indicators used for refinement. | |
RefinementFunctor () | |
Constructor. | |
virtual | ~RefinementFunctor () |
Destructor. | |
Additional Inherited Members | |
![]() | |
typedef double | value_type |
![]() | |
void | getChild (const base::HashGridPoint &gp, size_t d, bool left, base::HashGridPoint &child) const |
std::vector< double > | getEvalVector (size_t ind, size_t seq) const |
Gets the evaluations of all grids at the coords of seq. | |
void | getParent (const base::HashGridPoint &gp, size_t d, base::HashGridPoint &par) const |
void | goDown (base::HashGridPoint &gp, base::HashGridPoint &down, size_t d, bool left) const |
Used for non-leaf grid points. | |
void | goUp (base::HashGridPoint &gp, base::HashGridPoint &up, size_t d, bool left) const |
Used for leaf grid points. | |
bool | hasChild (const base::HashGridPoint &gp, size_t d, bool left) const |
bool | isLeftChild (const base::HashGridPoint &gp, size_t d) const |
int | sgn (double d) const |
![]() | |
std::vector< base::DataVector * > | alphas |
size_t | current_grid_index |
std::vector< base::Grid * > | grids |
bool | level_penalize |
std::vector< std::map< std::string, double > > | pre_comp_evals |
Stores grid evaluations at all grids (vector) at the union of grid point coordinates over all grids (hashed by string representation in the map) | |
bool | pre_compute |
std::vector< double > | priors |
size_t | refinements_num |
double | threshold |
Multiple class refinement is based on the zero-crossing based refinement.
The zero-crossings are not determinate by pairwise comparing the sings of PDFS f_1 - f_2, but by comparing the dominating class at geometric neighbors, determined for each dimension separately.
Finer levels are penalized by 2^{-|l|}.
sgpp::datadriven::MultipleClassRefinementFunctor::MultipleClassRefinementFunctor | ( | std::vector< base::Grid * > | grids, |
std::vector< base::DataVector * > | alphas, | ||
std::vector< double > | priors, | ||
size_t | refinements_num, | ||
size_t | partCombined, | ||
double | thresh | ||
) |
Constructor.
grids | Vector of grids. current_grid_index specifies the grid to be refined |
alphas | Vector of surpluses related to the grids |
priors | Vector of priors related to the classificator |
refinements_num | Maximum number of refinements done |
partCombined | Number of refinement done in the combined grid |
thresh | Threshold for refinement scores |
double sgpp::datadriven::MultipleClassRefinementFunctor::getBorderPenalty | ( | ) |
Gets the factor, the borders are penalized with.
double sgpp::datadriven::MultipleClassRefinementFunctor::getTopPercent | ( | ) |
Gets the range in which densities are considered to be close.
Gives a percentage [0,1].
|
overridevirtual |
This should be returning a refinement value for every grid point.
The point with the highest value will be refined first.
storage | reference to the grids storage object |
seq | sequence number in the coefficients array |
Implements sgpp::base::RefinementFunctor.
References sgpp::datadriven::ZeroCrossingRefinementFunctor::current_grid_index, sgpp::base::MultipleClassPoint::getBorderScore(), sgpp::base::MultipleClassPoint::getDensity(), sgpp::base::MultipleClassPoint::getDominateClass(), sgpp::base::HashGridPoint::getLevel(), sgpp::base::MultipleClassPoint::getNeighbors(), sgpp::base::HashGridStorage::getPoint(), sgpp::base::HashGridStorage::getSequenceNumber(), sgpp::base::Grid::getStorage(), sgpp::base::MultipleClassPoint::getTopClasses(), and sgpp::datadriven::ZeroCrossingRefinementFunctor::grids.
void sgpp::datadriven::MultipleClassRefinementFunctor::refine | ( | ) |
Organizes the refinement of the classes uses set parameter to execute the refinement step.
Creates the combined grid and starts the refinement.
References sgpp::base::Grid::getStorage(), sgpp::datadriven::ZeroCrossingRefinementFunctor::grids, refine(), sgpp::datadriven::ZeroCrossingRefinementFunctor::refinements_num, and sgpp::datadriven::ZeroCrossingRefinementFunctor::setGridIndex().
Referenced by sgpp::datadriven::ModelFittingClassification::adapt(), and refine().
void sgpp::datadriven::MultipleClassRefinementFunctor::setBorderPenalty | ( | double | newPenalty | ) |
Sets the factor, used to penalize the borders.
The border score is multiplied with the factor before beeing added to the overall score.
newPenalty | Factor to penalize the borders |
void sgpp::datadriven::MultipleClassRefinementFunctor::setTopPercent | ( | double | newPercent | ) |
Sets the range in which densities are considered to be close.
Set the percentage [0,1] the densities need to have, compared to the density of the dominating class.
newPercent | Set the new range |