Bill 2 years ago
commit 6ad9ba6ea3

@ -5,14 +5,13 @@
struct minEval{ struct minEval{
double value; double value;
double values; int* values;
double eval; double eval;
long left; // how many on its left long left; // how many on its left
double* record; double* record;
long max; long max;
long** count; long** count;
long* sorted; // sorted d
}; };
minEval giniSparse(double** data, long* result, long* d, long size, long col, long classes, long* totalT){ minEval giniSparse(double** data, long* result, long* d, long size, long col, long classes, long* totalT){

@ -4,9 +4,6 @@
#include "../server/table.h" #include "../server/table.h"
DecisionTree* dt = nullptr; DecisionTree* dt = nullptr;
long pt = 0;
double** data = nullptr;
long* result = nullptr;
__AQEXPORT__(bool) newtree(int height, long f, ColRef<int> sparse, double forget, long maxf, long noclasses, Evaluation e, long r, long rb){ __AQEXPORT__(bool) newtree(int height, long f, ColRef<int> sparse, double forget, long maxf, long noclasses, Evaluation e, long r, long rb){
if(sparse.size!=f)return 0; if(sparse.size!=f)return 0;
@ -19,14 +16,13 @@ __AQEXPORT__(bool) newtree(int height, long f, ColRef<int> sparse, double forget
return 1; return 1;
} }
__AQEXPORT__(bool) additem(ColRef<double>X, long y, long size){ __AQEXPORT__(bool) fit(ColRef<ColRef<double>> X, ColRef<int> y){
long j = 0; if(X.size != y.size)return 0;
if(size>0){ double** data = (double**)malloc(X.size*sizeof(double*));
free(data); long* result = (long*)malloc(y.size*sizeof(long));
free(result); for(long i=0; i<X.size; i++){
pt = 0; data[i] = X.container[i].container;
data=(double**)malloc(size*sizeof(double*)); result[i] = y.container[i];
result=(long*)malloc(size*sizeof(long));
} }
data[pt] = (double*)malloc(X.size*sizeof(double)); data[pt] = (double*)malloc(X.size*sizeof(double));
for(j=0; j<X.size; j++){ for(j=0; j<X.size; j++){

@ -18,4 +18,4 @@ LOAD MODULE FROM "./libirf.so"
select additem(tb2.y, 0, -1) from tb2; select additem(tb2.y, 0, -1) from tb2;
select additem(tb2.z, 1, -1) from tb2; select additem(tb2.z, 1, -1) from tb2;
select fit(); select fit();
select predict(); select predict();

Loading…
Cancel
Save