Skip to content

Commit ea11ec1

Browse files
committed
[+] NOTES.md & README.md
1 parent 9a9c6da commit ea11ec1

File tree

2 files changed

+35
-3
lines changed

2 files changed

+35
-3
lines changed

NOTES.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
## 16.03.2019
2+
3+
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`.
4+
5+
For example, line:
6+
```go
7+
model, err := leaves.LGEnsembleFromFile("lg_breast_cancer.model")
8+
```
9+
10+
Should be changed to:
11+
```go
12+
model, err := leaves.LGEnsembleFromFile("lg_breast_cancer.model", false)
13+
```
14+
15+
if one wants to leave old behaviour.
16+
17+
18+
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`:
19+
20+
```go
21+
model.Transformation().Name() == "raw"
22+
```
23+
24+
then
25+
26+
```go
27+
model.RawOutputGroups() == model.NOutputGroups()
28+
```

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ _leaves_ is a library implementing prediction code for GBRT (Gradient Boosting R
1414
## Features
1515
* General Features:
1616
* support parallel predictions for batches
17+
* support sigmoid, softmax transformation functions
1718
* Support LightGBM ([repo](https://github.com/Microsoft/LightGBM)) models:
1819
* read models from `text` format and from `JSON` format
1920
* support `gbdt`, `rf` (random forest) and `dart` models
@@ -51,7 +52,8 @@ import (
5152

5253
func main() {
5354
// 1. Read model
54-
model, err := leaves.LGEnsembleFromFile("lightgbm_model.txt")
55+
useTransformation := true
56+
model, err := leaves.LGEnsembleFromFile("lightgbm_model.txt", useTransformation)
5557
if err != nil {
5658
panic(err)
5759
}
@@ -69,6 +71,8 @@ In order to use XGBoost model, just change `leaves.LGEnsembleFromFile`, to `leav
6971

7072
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).
7173

74+
Some additional information on new features and backward compatibility can be found in [NOTES.md](NOTES.md).
75+
7276
## Benchmark
7377

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

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

0 commit comments

Comments
 (0)