npstat is hosted by Hepforge, IPPP Durham
NPStat  5.10.0
npstat::LogisticRegressionOnGrid< Numeric, StackLen, StackDim > Class Template Reference

#include <LocalLogisticRegression.hh>

Inheritance diagram for npstat::LogisticRegressionOnGrid< Numeric, StackLen, StackDim >:
npstat::LogisticRegressionBase< int > npstat::AbsArrayProjector< Numeric, double >

Public Member Functions

 LogisticRegressionOnGrid (const ArrayND< Numeric, StackLen, StackDim > &numerator, const ArrayND< Numeric, StackLen, StackDim > &denominator, const QuadraticOrthoPolyND &poly, bool calculateLikelihoodGradient)
 
const ArrayND< Numeric, StackLen, StackDim > & getNumerator () const
 
const ArrayND< Numeric, StackLen, StackDim > & getDenominator () const
 
virtual void clear ()
 
virtual double result ()
 
virtual void process (const unsigned *index, unsigned indexLen, unsigned long linearIndex, const Numeric &value)
 
- Public Member Functions inherited from npstat::LogisticRegressionBase< int >
 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< int > &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< int >
void resetAccumulators ()
 
- Protected Attributes inherited from npstat::LogisticRegressionBase< int >
const QuadraticOrthoPolyNDpoly_
 
BoxND< int > 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<typename Numeric, unsigned StackLen = 1U, unsigned StackDim = 10U>
class npstat::LogisticRegressionOnGrid< Numeric, StackLen, StackDim >

Logistic regression on regularly sampled data

Constructor & Destructor Documentation

◆ LogisticRegressionOnGrid()

template<typename Numeric , unsigned StackLen = 1U, unsigned StackDim = 10U>
npstat::LogisticRegressionOnGrid< Numeric, StackLen, StackDim >::LogisticRegressionOnGrid ( const ArrayND< Numeric, StackLen, StackDim > &  numerator,
const ArrayND< Numeric, StackLen, StackDim > &  denominator,
const QuadraticOrthoPolyND poly,
bool  calculateLikelihoodGradient 
)

Constructor arguments are as follows:

numerator – count of points which "pass" for this grid cell

denominator – count of all points associated with this grid cell

poly – the set of orthogonal polynomial 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 "numerator", "denominator", or "poly" objects. These objects must still exist when the LogisticRegressionOnGrid object is in use.

The "standard" situation here is that the regression box is simply taken to be an integer-sized box whose length is the same as the number of steps used to build the polynomials.

Member Function Documentation

◆ clear()

template<typename Numeric , unsigned StackLen = 1U, unsigned StackDim = 10U>
virtual void npstat::LogisticRegressionOnGrid< Numeric, StackLen, StackDim >::clear ( )
inlinevirtual

Method from AbsArrayProjector we have to implement

Implements npstat::AbsArrayProjector< Numeric, double >.

◆ getNumerator()

template<typename Numeric , unsigned StackLen = 1U, unsigned StackDim = 10U>
const ArrayND<Numeric,StackLen,StackDim>& npstat::LogisticRegressionOnGrid< Numeric, StackLen, StackDim >::getNumerator ( ) const
inline

Inspect object properties

◆ process()

template<typename Numeric , unsigned StackLen = 1U, unsigned StackDim = 10U>
virtual void npstat::LogisticRegressionOnGrid< Numeric, StackLen, StackDim >::process ( const unsigned *  index,
unsigned  indexLen,
unsigned long  linearIndex,
const Numeric &  value 
)
virtual

Process one array point

Implements npstat::AbsArrayProjector< Numeric, double >.

◆ result()

template<typename Numeric , unsigned StackLen = 1U, unsigned StackDim = 10U>
virtual double npstat::LogisticRegressionOnGrid< Numeric, StackLen, StackDim >::result ( )
inlinevirtual

Return the result at the end of array processing

Implements npstat::AbsArrayProjector< Numeric, double >.


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