openModeller  Version 1.5.0
LogitRule Class Reference

#include <Rule.h>

Inheritance diagram for LogitRule:
Inheritance graph
Collaboration diagram for LogitRule:
Collaboration graph

Public Member Functions

 LogitRule ()
 
virtual ~LogitRule ()
 
virtual RuleobjFactory ()
 
virtual char type () const
 
virtual void fromString (char *strRule)
 
virtual void initialize (EnvCellSet *objEnvCellSet, const RuleSet *objRuleSet, bool *geneIsActivePtr, int *geneIndexPtr, int iActGenes)
 
virtual bool applyToCell (EnvCell *cell)
 
virtual bool similar (Rule *objOtherRule)
 
virtual double getStrength (EnvCell *cell)
 
virtual void mutate (int intTemperature)
 
int regression (EnvCellSet *objEnvCellSet, int dep, double &constant, double &coef1, double &coef2)
 
 LogitRule ()
 
 LogitRule (int numRules)
 
 LogitRule (Scalar prediction, int numGenes, const Sample &chrom1, const Sample &chrom2, const double *performances)
 Constructor with setters. More...
 
virtual ~LogitRule ()
 
virtual GarpRuleobjFactory () const
 
virtual char type () const
 
virtual void initialize (const Regression &regression)
 
virtual bool applies (const Sample &sample) const
 
virtual int getStrength (const Sample &sample) const
 
virtual bool similar (const GarpRule *objOtherRule) const
 
void log ()
 
- Public Member Functions inherited from GarpRule
 GarpRule ()
 
virtual ~GarpRule ()
 
 GarpRule ()
 Default constructor. More...
 
 GarpRule (const int numGenes)
 Constructor with defined size. More...
 
 GarpRule (Scalar prediction, int numGenes, const Sample &chrom1, const Sample &chrom2, const double *performances)
 Constructor with setters. More...
 
virtual ~GarpRule ()
 Default destructor. More...
 
virtual GarpRuleclone () const
 
virtual int copy (const GarpRule *fromRule)
 
int numGenes () const
 
bool needsEvaluation () const
 
void forceEvaluation ()
 
void evaluated ()
 
void setPrediction (double pred)
 
Scalar getPrediction () const
 
const SamplegetChrom1 () const
 
const SamplegetChrom2 () const
 
const double * getPerformanceArray () const
 
double getPerformance (PerfIndex perfIndex) const
 
virtual int getCertainty (const Scalar pred) const
 
virtual double getError (const Scalar predefinedValue, const Scalar prediction) const
 
virtual void mutate (double temperature)
 
virtual void crossover (GarpRule *rule, int xpt1, int xpt2)
 
void adjustRange (Scalar &v1, Scalar &v2) const
 
double evaluate (const OccurrencesPtr &occs)
 
- Public Member Functions inherited from Rule
 Rule ()
 Default constructor. More...
 
virtual ~Rule ()
 Default destructor. More...
 
virtual Ruleclone ()
 
virtual void copy (Rule *fromRule)
 
void RestoreRule (double *perf, unsigned char *genes, int arry_len, int *gene_index)
 Restore Model. More...
 
virtual char * toString ()
 
virtual char * toXML ()
 
virtual double getCertainty (EnvCell *cell)
 
virtual double getError (BYTE pred, EnvCell *cell)
 
double testWithData (EnvCellSet *objTrainSet)
 
bool needsEvaluation ()
 

Additional Inherited Members

- Protected Attributes inherited from GarpRule
Sample _chrom1
 BYTE vector containing the genes (representation of the variables in a Genetic Algorithm. More...
 
Sample _chrom2
 
Scalar _prediction
 
int _numGenes
 Number of genes stored by the rule. More...
 
double _performance [10]
 Vector for storing the performance values for the rule. More...
 
bool _needsEvaluation
 
char _origin
 
- Protected Attributes inherited from Rule
BYTEGene
 BYTE vector containing the genes (representation of the variables in a Genetic Algorithm. More...
 
int intGenes
 Number of genes stored by the rule. More...
 
double dblPerformance [10]
 Vector for storing the performance values for the rule. More...
 
bool blnNeedsEvaluation
 
int intGens
 
int intTrials
 
int intScreener
 
int intScreen
 
int intLength
 
int intNumber
 
int intConclusion
 
char chrOrigin
 
char chrPad
 
int lId
 
int iOrigGen
 
double _pXYs
 
int _no
 
double _dA
 
double _dSig
 
bool * bGeneIsActive
 
int * iGeneIndex
 
int iActiveGenes
 

Detailed Description

Implements Garp Logistic Regression rules. Also known as Logit rules.

Definition at line 180 of file Rule.h.

Constructor & Destructor Documentation

LogitRule::LogitRule ( )

Definition at line 728 of file Rule.cpp.

Referenced by objFactory().

LogitRule::~LogitRule ( )
virtual

Definition at line 733 of file Rule.cpp.

LogitRule::LogitRule ( )
LogitRule::LogitRule ( int  numRules)

Definition at line 55 of file rules_logit.cpp.

LogitRule::LogitRule ( Scalar  prediction,
int  numGenes,
const Sample chrom1,
const Sample chrom2,
const double *  performances 
)

Constructor with setters.

Definition at line 59 of file rules_logit.cpp.

virtual LogitRule::~LogitRule ( )
virtual

Member Function Documentation

bool LogitRule::applies ( const Sample sample) const
virtual

Implements GarpRule.

Definition at line 85 of file rules_logit.cpp.

References getStrength().

Here is the call graph for this function:

bool LogitRule::applyToCell ( EnvCell cell)
virtual

Implements Rule.

Definition at line 810 of file Rule.cpp.

References getStrength().

Here is the call graph for this function:

void LogitRule::fromString ( char *  strRule)
virtual

Implements Rule.

Definition at line 738 of file Rule.cpp.

int LogitRule::getStrength ( const Sample sample) const
virtual

Implements GarpRule.

Definition at line 91 of file rules_logit.cpp.

References GarpRule::_chrom1, GarpRule::_chrom2, Sample::begin(), Sample::end(), and equalEps().

Here is the call graph for this function:

double LogitRule::getStrength ( EnvCell cell)
virtual

Implements Rule.

Definition at line 814 of file Rule.cpp.

References Rule::Gene, Rule::iActiveGenes, Rule::iGeneIndex, Rule::intLength, GarpUtil::membership(), and EnvCell::values.

Referenced by applies(), and applyToCell().

Here is the call graph for this function:

void LogitRule::initialize ( const Regression regression)
virtual

Definition at line 69 of file rules_logit.cpp.

References GarpRule::_chrom1, GarpRule::_chrom2, GarpRule::_numGenes, Random::get(), Regression::getB(), and Regression::getC().

Here is the call graph for this function:

void LogitRule::initialize ( EnvCellSet objEnvCellSet,
const RuleSet objRuleSet,
bool *  geneIsActivePtr,
int *  geneIndexPtr,
int  iActGenes 
)
virtual

Implements Rule.

Definition at line 743 of file Rule.cpp.

References Rule::Gene, Rule::iActiveGenes, Rule::iGeneIndex, Rule::initialize(), GarpUtil::randint(), and regression().

Here is the call graph for this function:

void LogitRule::log ( )
virtual

Reimplemented from GarpRule.

Definition at line 154 of file rules_logit.cpp.

References GarpRule::_chrom1, GarpRule::_chrom2, GarpRule::_numGenes, GarpRule::_prediction, coeficientThreshold, GarpRule::getPerformance(), Log::info(), Log::instance(), and PerfSig.

Here is the call graph for this function:

void LogitRule::mutate ( int  intTemperature)
virtual

Reimplemented from Rule.

Definition at line 854 of file Rule.cpp.

References Rule::blnNeedsEvaluation, Rule::chrOrigin, Rule::Gene, Rule::iActiveGenes, Rule::iGeneIndex, Rule::intGens, Rule::intLength, and GarpUtil::randint().

Here is the call graph for this function:

virtual GarpRule* LogitRule::objFactory ( ) const
inlinevirtual

Implements GarpRule.

Definition at line 61 of file rules_logit.hh.

References LogitRule().

Here is the call graph for this function:

virtual Rule* LogitRule::objFactory ( )
inlinevirtual

Implements Rule.

Definition at line 185 of file Rule.h.

References LogitRule().

Here is the call graph for this function:

int LogitRule::regression ( EnvCellSet objEnvCellSet,
int  dep,
double &  constant,
double &  coef1,
double &  coef2 
)

Definition at line 767 of file Rule.cpp.

References EnvCellSet::count(), EnvCellSet::get(), and EnvCell::values.

Referenced by initialize().

Here is the call graph for this function:

bool LogitRule::similar ( const GarpRule objOtherRule) const
virtual

Reimplemented from GarpRule.

Definition at line 122 of file rules_logit.cpp.

References GarpRule::_chrom1, GarpRule::_numGenes, GarpRule::_prediction, coeficientThreshold, GarpRule::type(), and type().

Here is the call graph for this function:

bool LogitRule::similar ( Rule objOtherRule)
virtual

Reimplemented from Rule.

Definition at line 873 of file Rule.cpp.

References Rule::Gene, Rule::intLength, and type().

Here is the call graph for this function:

virtual char LogitRule::type ( ) const
inlinevirtual

Reimplemented from GarpRule.

Definition at line 63 of file rules_logit.hh.

virtual char LogitRule::type ( ) const
inlinevirtual

Reimplemented from GarpRule.

Definition at line 187 of file Rule.h.

Referenced by similar().


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