@wlearn/lightgbm
v0.1.0
Published
LightGBM WASM port for wlearn
Readme
@wlearn/lightgbm
LightGBM WASM port for wlearn. Gradient boosting for classification and regression, running in browser and Node.js via WebAssembly.
Installation
npm install @wlearn/lightgbmUsage
import { LGBModel } from '@wlearn/lightgbm'
// Create and train
const model = await LGBModel.create({
objective: 'binary',
learning_rate: 0.05,
num_leaves: 31,
numRound: 100
})
model.fit(X, y)
// Predict
const predictions = model.predict(X_test)
const probabilities = model.predictProba(X_test)
const accuracy = model.score(X_test, y_test)
// Save and load
const bundle = model.save()
const loaded = await LGBModel.load(bundle)
// Clean up
model.dispose()Supported objectives
binary-- binary classificationmulticlass-- multiclass classification (softmax)multiclassova-- multiclass one-vs-allcross_entropy-- cross-entropy classificationregression-- regression (default)
License
MIT (upstream LightGBM is MIT-licensed)
