david-matheson / rftk Goto Github PK
View Code? Open in Web Editor NEWRandom forest toolkit
Random forest toolkit
Hi, It's really good to have a python wrapper, Can you please provide usage of random forest directly in C++
Is it easy to go through the code and implementing myself.
Is there any other C++ implementations that you know.
Hi David,
I was looking at the code for the rftk python package provided on the github and I was having trouble understanding what the features of the package were given the limited documentation. I was wondering if you could explain the differences between the functions create_online_one_stream_classifier and create_online_two_stream_consistent_classifier, and the parameters number_of_features, number_of_splitpoints, number_of_trees, min_impurity, min_child_size, max_frontier_size, poisson_sample, split_rate_grown, number_of_data_to_split_root, number_of_data_to_force_split_root, and probability_of_impurity_stream. I am unfamiliar with many of these terms and what they control in the random forest algorithm.
Thanks in advance.
Would it possible to have either a example or a unit test demonstrating online learning? In all the examples I've seen so far (including the regression branch), the learner is exposed to one set of data and then predicts on one set. When I tried to fumble with my my own test, running fit twice seemed to just replace the model entirely.
learner = rftk.learn.create_one_stream_classifier()
x = np.array([[0],[1], [2], [3], [4]], dtype=np.float32)
classes = np.array([0,1,2,3,4], dtype=np.int32)
predictor = learner.fit(x=x, classes=classes,
bootstrap=False,
number_of_features=1,
number_of_splitpoints=10)
print predictor.predict(x=x).argmax(axis=1) #Should be [0 1 2 3 4]
[0 1 2 3 4]
x = np.array([[1], [2], [3], [4]], dtype=np.float32) #Now expose it to fewer classes
classes = np.array([1,2,3,4], dtype=np.int32)
predictor = learner.fit(x=x, classes=classes)
print predictor.predict(x=x).argmax(axis=1) #Should be [1 2 3 4]
[1 2 3 4]
x = np.array([[0],[1], [2], [3], [4]], dtype=np.float32)
print predictor.predict(x=x).argmax(axis=1) #Should be [0 1 2 3 4]
[1 1 2 3 4]
Thank you very much for your work on this package and the two papers.
For several days I have attempted to compile the package without luck on both a Windows and Ubuntu machine.
Any assistance would be much appreciated,
Rex
Computer Details (Fresh install of everything including OS today)
Ubuntu 13.1 64bit
Scons 2.3.0
---Without Any Error---
sudo apt-get install scons
sudo apt-get install libboost-all-dev
sudo git clone https://github.com/david-matheson/rftk.git
---From within the base RFTK folder /home/rd/rftk --
sudo scons
scons: Reading SConscript files ...
/home/rd/rftk/modules/init.py
/home/rd/rftk/modules/init.py
scons: done reading SConscript files.
scons: Building targets ...
clang -o build/debug/asserts/native/asserts.os -c -g -O0 -Wall -Wextra -Weffc++ -Werror -fPIC -DENABLE_EXCEPTIONS=1 -DUSE_BOOST_THREAD=0 -I/usr/include/python2.7 -I/usr/lib/python2.7/dist-packages/numpy/core/include build/debug/asserts/native/asserts.cpp
clang -o build/debug/libasserts.so -shared -Wl,-rpath=/home/rd/rftk/build/debug/install_debug/lib build/debug/asserts/native/asserts.os -Lbuild/debug -lboost_thread
Install file: "build/debug/libasserts.so" as "build/debug/install_debug/lib/libasserts.so"
scons: *** [build/debug/install_debug/asserts/asserts.py] Source build/debug/asserts/swig/asserts.py' not found, needed by target
build/debug/install_debug/asserts/asserts.py'.
scons: building terminated because of errors.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.