Skip to content

Commit

Permalink
[+] NOTES.md & README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitryikh committed Mar 16, 2019
1 parent 9a9c6da commit ea11ec1
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 3 deletions.
28 changes: 28 additions & 0 deletions NOTES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
## 16.03.2019

Transformation functions are introduced. Before this step `leaves` was able to output only raw predictions. Here is new bool option named `loadTransformation` adedd to all model load functions: `XGEnsembleFromReader`, `XGEnsembleFromFile`, `XGBLinearFromReader`, `XGBLinearFromFile`, `SKEnsembleFromReader`, `SKEnsembleFromFile`, `LGEnsembleFromJSON`, `LGEnsembleFromReader`, `LGEnsembleFromFile`.

For example, line:
```go
model, err := leaves.LGEnsembleFromFile("lg_breast_cancer.model")
```

Should be changed to:
```go
model, err := leaves.LGEnsembleFromFile("lg_breast_cancer.model", false)
```

if one wants to leave old behaviour.


Also, `NClasses` `Ensemble` method will be renamed to `NRawOutputGroups` while keeping the same meaning - number of values that model provides for every object in raw predictions. There is also added `NOutputGroups` - number of values that model provides for every object after applying transformation function. Generally, that means that transformation function can change outputs dimensionality. Please note, if current transformation funciton is `raw`:

```go
model.Transformation().Name() == "raw"
```

then

```go
model.RawOutputGroups() == model.NOutputGroups()
```
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ _leaves_ is a library implementing prediction code for GBRT (Gradient Boosting R
## Features
* General Features:
* support parallel predictions for batches
* support sigmoid, softmax transformation functions
* Support LightGBM ([repo](https://github.com/Microsoft/LightGBM)) models:
* read models from `text` format and from `JSON` format
* support `gbdt`, `rf` (random forest) and `dart` models
Expand Down Expand Up @@ -51,7 +52,8 @@ import (

func main() {
// 1. Read model
model, err := leaves.LGEnsembleFromFile("lightgbm_model.txt")
useTransformation := true
model, err := leaves.LGEnsembleFromFile("lightgbm_model.txt", useTransformation)
if err != nil {
panic(err)
}
Expand All @@ -69,6 +71,8 @@ In order to use XGBoost model, just change `leaves.LGEnsembleFromFile`, to `leav

Documentation is hosted on godoc ([link](https://godoc.org/github.com/dmitryikh/leaves)). Documentation contains complex usage examples and full API reference. Some additional information about usage examples can be found in [leaves_test.go](leaves_test.go).

Some additional information on new features and backward compatibility can be found in [NOTES.md](NOTES.md).

## Benchmark

Below are comparisons of prediction speed on batches (~1000 objects in 1 API
Expand Down Expand Up @@ -104,9 +108,9 @@ Single thread:
## Limitations

* LightGBM models:
* no support transformations functions (sigmoid, lambdarank, etc). Output scores is _raw scores_
* limited support of transformation functions (support only sigmoid, softmax)
* XGBoost models:
* no support transformations functions. Output scores is _raw scores_
* limited support of transformation functions (support only sigmoid, softmax)
* could be slight divergence between C API predictions vs. _leaves_ because of floating point convertions and comparisons tolerances
* scikit-learn tree models:
* no support transformations functions. Output scores is _raw scores_ (as from `GradientBoostingClassifier.decision_function`)
Expand Down

0 comments on commit ea11ec1

Please sign in to comment.