panic when train model with LogisticRegression
Author: crafttomyyCreated Apr 24, 2025Updated Apr 24, 2025
panic: runtime error: cgo argument has Go pointer to unpinned Go pointer
cls,err:=models.NewLogisticRegression("l2", 0.01, 1.0)
if err != nil {
panic(err)
}
err = cls.Fit(trainData)
if err != nil {
panic(err) // <- panic here
}error:
panic: runtime error: cgo argument has Go pointer to unpinned Go pointer
goroutine 1 [running]:
github.com/sjwhitworth/golearn/linear_models.Train.func1(...)
/home/tomy/go/pkg/mod/github.com/sjwhitworth/[email protected]/linear_models/liblinear.go:65
github.com/sjwhitworth/golearn/linear_models.Train(0xc0002f3da0, 0xc00034b140)
/home/tomy/go/pkg/mod/github.com/sjwhitworth/[email protected]/linear_models/liblinear.go:65 +0x59
github.com/sjwhitworth/golearn/linear_models.(*LogisticRegression).Fit(0xc0002df000, {0x55c778, 0xc00034b0c0})
/home/tomy/go/pkg/mod/github.com/sjwhitworth/[email protected]/linear_models/logistic.go:34 +0x77
main.main()
/home/tomy/logistic_regression_classification/logisticRegression.go:28 +0x9d
exit status 2Source: sjwhitworth/golearn