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
from forest.ensemble import RandomForestRegressor rf = RandomForestRegressor(500, max_features=0.3) rf.fit(train_x, train_y) local_variable_importance = rf.lvig(X, Y, partition_feature = partition_feature, method = "lvig_based_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 = rf.lvig(X, 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
from forest.ensemble import RandomForestRegressor rf = meda.lovim(500, max_features=0.3) rf.fit(train_x, train_y) local_variable_importance = rf.lvig(X, 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.1-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 38d586d08a93b46a8ecd8696fa49cbca98966714ef426e2065cd8a1c6886d213 |
|
MD5 | c7eb6c4808ad50a9fddbc09bd1803618 |
|
BLAKE2b-256 | 0f2c2841188f045cb930aecf722951cc87d0bd51c85efabc39d5025e80950243 |
Hashes for forest_gis-1.0.1-cp38-cp38-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0cbcaa42c6840715c4dbebe6f52b99cf54716f720685108208ee192cb2dc876d |
|
MD5 | 4d1171e2262c68bccc4de2167bea53e7 |
|
BLAKE2b-256 | 8758778ce34cd879296a9ea766439b3d7c4214109cb7e7f6ca01e5b027c7f664 |
Hashes for forest_gis-1.0.1-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e6a3b524ccc8c0b59c675d30f0ce879239d8fb7c866a51f3c7839ba6567082a5 |
|
MD5 | c858654abbc08564d09d8bd87014ea6f |
|
BLAKE2b-256 | fe1a260d09cb9a74d5a09f9f3294ac87f7c8b24508e244e319614dbebcedc244 |
Hashes for forest_gis-1.0.1-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6d74a0d64349edf9a89910d691ef91535da9b9956cb35b247fed14bc81a4565b |
|
MD5 | c8aaeb66d8c88aa40990d3088284ec84 |
|
BLAKE2b-256 | 931a23654127c0d9fb8c2be7d52a31434404ca089984cd819199bb9d0be2e502 |
Hashes for forest_gis-1.0.1-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 12a4896052fab27e2b6af2cdf83d955a62279cbc6db10bb5b0434178cad5ed43 |
|
MD5 | 7acfd405d10cd52d8780fc03c78de257 |
|
BLAKE2b-256 | 6fd55dce70eeecf995ea6c1a71980a57f47bf1b3ed8c1acb023789c0bbb8ac4a |
Hashes for forest_gis-1.0.1-cp36-cp36m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ce801587436c2870ce86b936d619a13d65518d233b836065893c1e240e45c682 |
|
MD5 | f2166ba3cf3c839365bc76438b381f2d |
|
BLAKE2b-256 | 1df18902b590d6552dc66f66c34922223a383b5a4b1e82c9f653f982aa3eda0d |