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
Before you install the forest-gis from source, you need to update cython for Windows and Linux to the newest version and then run
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
from forest.ensemble import RandomForestRegressor rf = RandomForestRegressor(500, max_features=0.3) rf.fit(train_x, train_y) local_variable_importance = r_t.compute_feature_importance(X,Y, partition_feature = partition_feature, method = "lvig_based_on_impurity")
or compute local variable importance based on decrease in accuracy
from forest.ensemble import RandomForestRegressor rf = meda.lovim(500, max_features=0.3) rf.fit(train_x, train_y) local_variable_importance = r_m.compute_feature_importance(X,Y, partition_feature = partition_feature, method = "lvig_based_on_accuracy")
to achieve lower computation cost, we provide a cython version based on decrease in node impurity
from forest.ensemble import RandomForestRegressor rf = meda.lovim(500, max_features=0.3) rf.fit(train_x, train_y) local_variable_importance = r_m.compute_feature_importance(X,Y, partition_feature = partition_feature, method = "lvig_based_on_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-0.0.3-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 05e19af13737f1f1c85d6df09fbaeffe2e486ffbd75bd56251dd72eff000c347 |
|
MD5 | face06b1acc08f8004d735a6fa4bba41 |
|
BLAKE2b-256 | d03c6c5371eebbee30c5e5836d242e4ca2ec0c7719e718058e761b70e7c968c3 |
Hashes for forest_gis-0.0.3-cp38-cp38-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6b097be9cebad59a9b2729df18e189700d03e8b36c5d82725f3b0115defba83f |
|
MD5 | 44c035fab3143fa8df06b2dc0465cc33 |
|
BLAKE2b-256 | d830f5f566a5ee6cffb2e8f58c3c50258936e9e42ba8d48163946ae433d2cc50 |
Hashes for forest_gis-0.0.3-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e691205f1846684e59e0ad6b2ee3980cc418d9e2b92666b1739f164fbb575902 |
|
MD5 | bf840fe1d1ec58d891d63534ff0954a1 |
|
BLAKE2b-256 | 2bdbeaff60fe6c90d71f566111b5387cbd47f19e917a3302964b4c61d35ef5a1 |
Hashes for forest_gis-0.0.3-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bfb5b0e66d9046951e2d5d12b6e195bfcdeaa21f0aaadda987ee37e297bfaf83 |
|
MD5 | cc39023c93791eb3f66be0c14162e98f |
|
BLAKE2b-256 | 55512242361dbb8aea42a8c1a7d1dca4ea38ebbd6ede07bb2f9493ffbbf42fa4 |
Hashes for forest_gis-0.0.3-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 54a3243f9453acc1e6f1c9f37f5d47b8ae0d59fc770f78f83d640b39bd590a8a |
|
MD5 | b1a199dc06939f7744e006bee1e5723a |
|
BLAKE2b-256 | 09f7228575efcb0cf3af454770b0478a3005c39a55b0b3a3afd416d7bae2ef2f |
Hashes for forest_gis-0.0.3-cp36-cp36m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 954cf5a747ed7f67d303213a8f7e5f80b2be99ac577003d29fc208b78019a74e |
|
MD5 | 20e034b481d0e128f4c5bdaaa1821b92 |
|
BLAKE2b-256 | 2f31a145476de37999681ba11f23854dcbf52c1145233c52d467cb2610745680 |