-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated version in pyproject.toml, updated readme
- Loading branch information
Showing
2 changed files
with
45 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,56 @@ | ||
# coppice | ||
|
||
Python decision tree and ensemble package using a rust backend. | ||
A simple decision tree and random forest library using a Rust backend. | ||
|
||
## Installation | ||
|
||
### Development | ||
```bash | ||
pip install coppice | ||
``` | ||
|
||
## Usage | ||
|
||
### Python | ||
```python | ||
import numpy as np | ||
|
||
from coppice import _coppice | ||
|
||
x = ... # [w, n] | ||
y = ... # [n] | ||
|
||
x = x.astype(np.float32) | ||
y = y.astype(np.uint32) | ||
|
||
_coppice.train_tree_np(x, y, max_depth=5) | ||
|
||
_coppice.train_forest_np(x, y, max_depth=5, num_trees=10) | ||
``` | ||
|
||
### CLI | ||
|
||
```bash | ||
usage: coppice_ [-h] [--model-type {tree,forest}] [--num-trees NUM_TREES] | ||
[--max-depth MAX_DEPTH] | ||
x-path y-path | ||
|
||
positional arguments: | ||
x-path | ||
y-path | ||
|
||
options: | ||
-h, --help show this help message and exit | ||
--model-type {tree,forest} | ||
--num-trees NUM_TREES | ||
--max-depth MAX_DEPTH | ||
``` | ||
|
||
## Development | ||
|
||
```bash | ||
git clone [email protected]:JBwdn/coppice.git | ||
cd coppice | ||
pip install -e ".[dev]" | ||
maturin develop | ||
pre-commit install | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters