1
0
mirror of https://github.com/sjwhitworth/golearn.git synced 2025-04-26 13:49:14 +08:00

fix: additional type fixups

This commit is contained in:
Richard Townsend 2020-07-14 23:28:42 +01:00
parent 550a82c83f
commit 81098a10e6
2 changed files with 3 additions and 4 deletions

View File

@ -8,7 +8,6 @@ package linear_models
import "C"
import (
"fmt"
"unsafe"
"runtime"
)
@ -36,7 +35,7 @@ func (p *Parameter) Free() {
// Model encapsulates a trained libsvm model.
type Model struct {
c_model unsafe.Pointer
c_model *C.struct_model
}
// Free releases resources associated with a trained libsvm model.
@ -112,12 +111,12 @@ func Export(model *Model, filePath string) error {
}
func Load(model *Model, filePath string) error {
model.c_model = unsafe.Pointer(C.load_model(C.CString(filePath)))
model.c_model = C.load_model(C.CString(filePath))
if model.c_model == nil {
return fmt.Errorf("Something went wrong")
}
return nil
}
// Predict takes a row of float values corresponding to a particular

Binary file not shown.