npstat is hosted by Hepforge, IPPP Durham
NPStat  5.10.0
npstat::LogisticRegressionOnKDTree< Point, Numeric, BooleanFunctor > Class Template Reference

#include <LocalLogisticRegression.hh>

Inheritance diagram for npstat::LogisticRegressionOnKDTree< Point, Numeric, BooleanFunctor >:
npstat::LogisticRegressionBase< Numeric > npstat::AbsVisitor< Point, double >

Public Member Functions

 LogisticRegressionOnKDTree (const KDTree< Point, Numeric > &dataTree, const BooleanFunctor &pointPassesOrFails, const QuadraticOrthoPolyND &poly, bool calculateLikelihoodGradient)
 
const KDTree< Point, Numeric > & getDataTree () const
 
virtual void clear ()
 
virtual double result ()
 
virtual void process (const Point &value)
 
- Public Member Functions inherited from npstat::LogisticRegressionBase< Numeric >
 LogisticRegressionBase (const QuadraticOrthoPolyND &poly, bool calculateLikelihoodGradient)
 
unsigned dim () const
 
const QuadraticOrthoPolyNDgetPoly () const
 
bool calculatingGradient () const
 
const std::vector< double > & lastCoeffs () const
 
void getGradient (double *buffer, unsigned bufLen) const
 
double getPassCount () const
 
double getFailCount () const
 
void setRegressionBox (const BoxND< Numeric > &box)
 
void setLinearMapping (const double *location, const double *scale, unsigned locationAndScaleArraySize)
 
double calculateLogLikelihood (const double *coeffs, unsigned nCoeffs)
 

Additional Inherited Members

- Protected Member Functions inherited from npstat::LogisticRegressionBase< Numeric >
void resetAccumulators ()
 
- Protected Attributes inherited from npstat::LogisticRegressionBase< Numeric >
const QuadraticOrthoPolyNDpoly_
 
BoxND< Numeric > regressionBox_
 
std::vector< double > location_
 
std::vector< double > scale_
 
std::vector< double > coords_
 
std::vector< double > coeffs_
 
std::vector< double > gradBuffer_
 
std::vector< long double > gradient_
 
long double logli_
 
long double passCount_
 
long double failCount_
 
const double minlog_
 
const double maxlog_
 
const unsigned mydim_
 
const bool calcGradient_
 

Detailed Description

template<class Point, class Numeric, class BooleanFunctor>
class npstat::LogisticRegressionOnKDTree< Point, Numeric, BooleanFunctor >

Logistic regression on data samples arranged into k-d trees

Constructor & Destructor Documentation

◆ LogisticRegressionOnKDTree()

template<class Point , class Numeric , class BooleanFunctor >
npstat::LogisticRegressionOnKDTree< Point, Numeric, BooleanFunctor >::LogisticRegressionOnKDTree ( const KDTree< Point, Numeric > &  dataTree,
const BooleanFunctor &  pointPassesOrFails,
const QuadraticOrthoPolyND poly,
bool  calculateLikelihoodGradient 
)

Constructor arguments are as follows:

dataTree – the tree of data points.

pointPassesOrFails – a functor that tells us whether the point "passes" (observed value of 1) or "fails" (observed value of 0).

poly – the set of orthogonal polynomials used to construct the local regression surface.

calculateLikelihoodGradient – flag which tells whether the code should calculate the gradient of log-likelihood with respect to coefficients of the local polynomial.

This object will not own "dataTree" or "poly" objects. These objects must still exist when the LogisticRegressionOnKDTree object is in use. The point selection functor will be copied.

Member Function Documentation

◆ clear()

template<class Point , class Numeric , class BooleanFunctor >
virtual void npstat::LogisticRegressionOnKDTree< Point, Numeric, BooleanFunctor >::clear ( )
inlinevirtual

Method from AbsVisitor we have to implement

Implements npstat::AbsVisitor< Point, double >.

◆ getDataTree()

template<class Point , class Numeric , class BooleanFunctor >
const KDTree<Point,Numeric>& npstat::LogisticRegressionOnKDTree< Point, Numeric, BooleanFunctor >::getDataTree ( ) const
inline

Inspect the data

◆ process()

template<class Point , class Numeric , class BooleanFunctor >
virtual void npstat::LogisticRegressionOnKDTree< Point, Numeric, BooleanFunctor >::process ( const Point &  value)
virtual

Process one array point

Implements npstat::AbsVisitor< Point, double >.

◆ result()

template<class Point , class Numeric , class BooleanFunctor >
virtual double npstat::LogisticRegressionOnKDTree< Point, Numeric, BooleanFunctor >::result ( )
inlinevirtual

Return the result at the end of array processing

Implements npstat::AbsVisitor< Point, double >.


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