decision-tree-classifier

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit fef61fdd521f2aead99a8c89953e94d3a8d4ce16
parent 0b82e16a80a312beb9bfb6f1309f51f363c4dd58
Author: Andrew <andrewlaack1@gmail.com>
Date:   Fri, 20 Dec 2024 10:20:11 -0600

This c++ is so much fungit status!

Diffstat:
Mclassifier/Makefile | 4++++
Mrewrite/TreeNode.cpp | 10++++++----
2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/classifier/Makefile b/classifier/Makefile @@ -1,3 +1,7 @@ +make: gini split + + + split: g++ -shared -o cpp/libsplit.so -fPIC -O3 cpp/split.cpp diff --git a/rewrite/TreeNode.cpp b/rewrite/TreeNode.cpp @@ -115,19 +115,21 @@ SplitResults TreeNode::splitOnNode(float* X, int* y, int samples, int features){ for(int i = 0 ; i < samples; ++i){ if(X[(i*features) + index] < splitValue){ for(int x = 0; x < features; ++x){ - nextLtX[0] = X[(i*features) + x]; - nextLtX += 1; + nextLtX[x] = X[(i*features) + x]; } + nextLtX += features; + nextLtY[0] = y[i]; nextLtY += 1; } else{ for(int x = 0; x < features; ++x){ - nextGteqX[0] = X[(i*features) + x]; - nextGteqX += 1; + nextGteqX[x] = X[(i*features) + x]; } + nextGteqX += features; + nextGteqY[0] = y[i]; nextGteqY += 1; }