dmitryikh / leaves

pure Go implementation of prediction part for GBRT (Gradient Boosting Regression Trees) models from popular frameworks
MIT License
419 stars 72 forks source link

only version=v2 is supported #73

Open HaigLee opened 4 years ago

HaigLee commented 4 years ago

code:

import (
    "fmt"
    "github.com/dmitryikh/leaves"
)

func main() {
    // 1. Read model
    useTransformation := true
    model, err := leaves.LGEnsembleFromFile("lightgbm_model.txt", useTransformation)
    if err != nil {
        fmt.Println(err)
        panic(err)
    }
}

go build lgbuse.go, and then report an error:

only version=v2 is supported panic: only version=v2 is supported goroutine 1 [running]: main.main() lgbuse.go:14 +0x246 exit status 2

The line of code that cause probles: model, err := leaves.LGEnsembleFromFile("lightgbm_model.txt", useTransformation)

How can I solve this problem?

piggybox commented 3 years ago

I'm using the latest version as for now github.com/dmitryikh/leaves v0.0.0-20200503205002-939b6fa631dd and it works with v3 LightGBM model fine.