You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
AQuery/sdk/DecisionTree.h

61 lines
1.6 KiB

2 years ago
#ifndef CART_H
#define CART_H
#include "Evaluation.h"
struct minEval;
struct DR;
struct DT;
class DecisionTree
{
2 years ago
public:
DT *DTree = nullptr;
double minIG;
long maxHeight;
long feature;
long maxFeature;
bool isRF;
long classes;
int *Sparse;
double forgetRate;
double increaseRate;
double initialIR;
Evaluation evalue;
long Rebuild;
long roundNo;
long called;
long retain;
long lastT;
long lastAll;
2 years ago
DecisionTree(long f, int *sparse, double forget, long maxFeature, long noClasses, Evaluation e);
2 years ago
void Stablelize();
2 years ago
void Free();
2 years ago
minEval findMinGiniDense(double **data, long *result, long *totalT, long size, long col);
2 years ago
minEval findMinGiniSparse(double **data, long *result, long *totalT, long size, long col, DT *current);
2 years ago
minEval incrementalMinGiniDense(double **data, long *result, long size, long col, long ***count, double **record, long *max, long newCount, long forgetSize, double **forgottenData, long *forgottenClass);
2 years ago
minEval incrementalMinGiniSparse(double **dataNew, long *resultNew, long sizeNew, long sizeOld, DT *current, long col, long forgetSize, double **forgottenData, long *forgottenClass);
2 years ago
long *fitThenPredict(double **trainData, long *trainResult, long trainSize, double **testData, long testSize);
2 years ago
void fit(double **data, long *result, long size);
2 years ago
void Update(double **data, long *result, long size, DT *current);
2 years ago
void IncrementalUpdate(double **data, long *result, long size, DT *current);
2 years ago
long Test(double *data, DT *root);
2 years ago
void print(DT *root);
2 years ago
};
#endif