A set of python modules for machine learning and data mining
Project description
Installation
Dependencies
forest-gis requires:
Python (>= 3.6)
NumPy (>= 1.15.0)
SciPy (>= 0.19.1)
joblib (>= 0.14)
For Windwos
If you already have a working installation of numpy and scipy, and you plateform is Windows 32-bit or 64-bit, the easiest way to install forest-gis is using pip
pip install -U forest-gis
or conda
conda install -c conda-forge forest-gis
For linux
At present, on the pypi, we only provide wheel files supporting Python3.6, 3.7, 3.8 for Windows 32-bit, Windows 64-bit. Though the wheel files for Linux 64-bit are also provided, you may encouter problems if your Linux system has a lower version of glibc than ubantu 18.x because the wheel files was just compiled on ubantu 18.x If you get wrong when use pip to install forest-gis, you can try to install “forest-gis” from source.
For macOS
At present, install forest-gis from wheel files are not provied for macOS.
Build forest-gis from source
For Windows and Linux
Necessarily, before you install the forest-gis from source, you need to first install or update cython and numpy to the newest version and then run
pip install cython pip install numpy pip install --verbose .
For macOS, first install the macOS command line tools
brew install libomp
Set the following environment variables
export CC=/usr/bin/clang export CXX=/usr/bin/clang++ export CPPFLAGS="$CPPFLAGS -Xpreprocessor -fopenmp" export CFLAGS="$CFLAGS -I/usr/local/opt/libomp/include" export CXXFLAGS="$CXXFLAGS -I/usr/local/opt/libomp/include" export LDFLAGS="$LDFLAGS -Wl,-rpath,/usr/local/opt/libomp/lib -L/usr/local/opt/libomp/lib -lomp"
Finally, build forest-gis
pip install --verbose .
User Guide
Compute local variable importance based on decrease in node impurity
# use Boston house-price datasets as an example from sklearn.datasets import load_boston train_x, train_y = load_boston(return_X_y=True) # partition_feature could a column from train_x partition_feature = train_x[:, 1] from forest.ensemble import RandomForestRegressor rf = RandomForestRegressor(500, max_features=0.3) rf.fit(train_x, train_y) local_variable_importance = rf.lvig(train_x, train_y, partition_feature = partition_feature, method = "lvig_based_impurity")
or compute local variable importance based on decrease in accuracy
local_variable_importance = rf.lvig(train_x, train_y, partition_feature = partition_feature, method = "lvig_based_accuracy")
to achieve lower computation cost, we provide a cython version based on decrease in node impurity
local_variable_importance = rf.lvig(train_x, train_y, partition_feature = partition_feature, method = "lvig_based_impurity_cython_version")
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for forest_gis-1.0.2-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bfaa3e84560767bc1b8c9219e41930e0e5c8d7b1c6ed334250eb6eb7ab724654 |
|
MD5 | f57c17188576fa8aba67ba014fe07387 |
|
BLAKE2b-256 | 1f885146e14b476055b0c6a6c072f339163b83ecd223e95e057580f97aecfb8f |
Hashes for forest_gis-1.0.2-cp38-cp38-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 38652e104dbf997a4453e5f4fe6a3722938371589f82ffb4e6a9e81411361ba5 |
|
MD5 | a73c8c85deeb28403da9a5af573465be |
|
BLAKE2b-256 | 13b491425588952d395703b84b91200b4d9817cba08973f52c30e704c6c3ec6b |
Hashes for forest_gis-1.0.2-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bdc5e776464217480e8fea918203c889901f2797d456264c11ab8915f36cc633 |
|
MD5 | a50dbcd13c3c80a1f2cca113b69fb274 |
|
BLAKE2b-256 | 687958d9a7c5524187898a116d1f1586fe1bf98b457cf66b8242e49902df2768 |
Hashes for forest_gis-1.0.2-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a567afd188a37f2930ddedd960a522ecf7c1ce9c6d7ab98bcc086e1a35d3004c |
|
MD5 | 592eddbb5ee6c325d9d901046628b25c |
|
BLAKE2b-256 | 407e494907953e975c45a70257e552551194e97002e72e04b9721288c5d9daa6 |
Hashes for forest_gis-1.0.2-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c51fc89e401c9e82b6ee97ef43bf397b5e88a73a63c80bed1dba1bdbac04c11a |
|
MD5 | 22106ff3d3a318804db18cf97be3c675 |
|
BLAKE2b-256 | 14235bab15309749f3935c7355ac5b2d8919c7483774a19680ae0e702097d01d |
Hashes for forest_gis-1.0.2-cp36-cp36m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 10e00574d63ad30663933d79feb5ff5baec2a88d7fc3bd0ab934f7cac9f62386 |
|
MD5 | 927991a51efec062fd5392aa36f69380 |
|
BLAKE2b-256 | 31e37ab732126a9cb32be45fc902820e5398a880e876f72d537a2973ffe399cf |