Metadata-Version: 2.1
Name: PyGRF
Version: 0.0.7
Summary: PyGRF: An improved Python Geographical Random Forest model.
Home-page: https://github.com/geoai-lab/PyGRF
Author: Kai Sun, Ryan Zhenqi Zhou, Jiyeon Kim, and Yingjie Hu
Author-email: ksun4@buffalo.edu
License: MIT
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Requires-Python: >=3.8.0
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pandas
Requires-Dist: numpy
Requires-Dist: scikit-learn
Requires-Dist: scipy
Requires-Dist: libpysal
Requires-Dist: esda


# PyGRF



PyGRF: An improved Python Geographical Random Forest (GRF) model.

### Installation:

PyGRF can be installed from PyPI:

```bash
$ pip install PyGRF
```

### Example:

Below shows an example on how to fit a PyGRF model and use it to make predictions.

```python
from PyGRF import PyGRF
from sklearn.model_selection import train_test_split

# Split your data into training and test sets
X_train, X_test, y_train, y_test = train_test_split(X, y, random_state=42)

#Create a PyGRF model by specifying hyperparameters
pygrf_example = PyGRF.PyGRFBuilder(n_estimators=60, max_features=1, band_width=39, train_weighted=True, predict_weighted=True, bootstrap=False,
                          resampled=True, random_seed=42)

#Fit the created PyGRF model based on training data and their spatial coordinates						  
pygrf_example.fit(X_train, y_train, xy_coord)

#Make predictions for testing data using the fitted PyGRF model and you specified local model weight 
predict_combined, predict_global, predict_local = pygrf_example.predict(X_test, coords_test, local_weight=0.46)
```


### Parameters:
If you want to learn more about the major parameters in this package, please refer to the [Description of Parameters](https://github.com/geoai-lab/PyGRF/blob/master/Description_Parameters.pdf).


### Reference:
Kai Sun,  Ryan Zhenqi Zhou, Jiyeon Kim, and Yingjie Hu. 2024. PyGRF: An improved Python Geographical Random Forest model and case studies in public health and natural disasters.

