shortcuts/regr/main.go

25 lines
501 B
Go
Raw Normal View History

2024-09-30 20:41:48 +00:00
//go:build js && wasm
// +build js,wasm
package main
import (
"l12.xyz/x/shortcuts/regr/src"
"syscall/js"
)
func InitRegrExports(this js.Value, args []js.Value) interface{} {
exports := args[0]
2024-09-30 23:58:32 +00:00
exports.Set("Linear", js.FuncOf(src.NewLinearRegressionJS))
2024-10-01 02:37:42 +00:00
exports.Set("ElasticNet", js.FuncOf(src.NewElasticNetJS))
exports.Set("Lasso", js.FuncOf(src.NewLassoJS))
2024-09-30 20:41:48 +00:00
return nil
}
func main() {
c := make(chan struct{}, 0)
js.Global().Set("__InitRegrExports", js.FuncOf(InitRegrExports))
<-c
}