golightly

package module
v0.0.0-...-1a6feb0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 31, 2023 License: MIT Imports: 3 Imported by: 2 modules, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Golightly for Machine Learning in Go

Golightly provides the building blocks for an ML API

Go is widely used to create APIs and other networked services, but the Go ecosystem has few native ML libraries. Golightly provides ML models for regression, classification, ranking, and more.

Golightly brings the LightGBM ML library into the Go ecosystem

LightGBM is an MIT-licensed, high performance machine learning framework developed by Microsoft. It is comparable to XGBoost in predictive performance but much faster to train. For high performance, it is written in C++.

Golightly uses purego to dynamically link to the C++ LightGBM library, which avoids CGO and the associated complications to building a Go project.

Golightly is a work in progress with some basic functions working well (e.g., enough to create a prediction API for existing models or train new models from files), but with more work needed to fully recapitulate LightGBM functionality. Contributions are welcome, particularly if you know C/C++.

Golightly is currently a very thin wrapper for LightGBM, but a small number of convenience functions are planned. Currently, the library is only tested on Linux, but should work on MacOS and Windows with minimal effort (just swap the dynamic library file, e.g, dll, dylib).

For Linux, download the pre-compiled static object for LightGBM.

Wine quality data from: Modeling wine preferences by data mining from physicochemical properties By P. Cortez, A. Cerdeira, Fernando Almeida, Telmo Matos, J. Reis. 2009

Original wine data is from the UCI ML Repository

Documentation

Index

Constants

View Source
const Col_major = int32(0)
View Source
const Dtype_float32 = int32(0)
View Source
const Dtype_float64 = int32(1)
View Source
const Importance_gain = int32(1)
View Source
const Importance_split = int32(0)
View Source
const PredictContrib = int32(3)
View Source
const PredictLeaf = int32(2)
View Source
const PredictNormal = int32(0)
View Source
const PredictRaw = int32(1)
View Source
const Row_major = int32(1)

Variables

View Source
var BoosterAddValidData func(booster Booster, valid_data Dataset) int
View Source
var BoosterCalcNumPredict func(booster Booster, num_row int32, predict_type int32, start_iteration int32, num_iteration int32, outlen *int64) int
View Source
var BoosterCreate func(train_data Dataset, parameters string, out *Booster) int
View Source
var BoosterCreateFromModelfile func(filename string, out_num_iterations *int32, out *Booster) int
View Source
var BoosterDumpModel func(booster Booster, start_iteration int32, num_iteration int32, feature_importance_type int32, buffer_len int64, outlen *int64, out_str string) int
View Source
var BoosterFeatureImportance func(booster Booster, num_iteration int32, importance_type int32, out_results []float64) int
View Source
var BoosterFree func(booster Booster) int
View Source
var BoosterGetCurrentIteration func(booster Booster, out_iteration *int32) int
View Source
var BoosterGetEval func(booster Booster, data_idx int32, out_len *int32, out_results *[2]float64) int
View Source
var BoosterGetEvalCounts func(booster Booster, out *int32) int
View Source
var BoosterGetFeatureNames func(booster Booster, len int32, out_len *int32, buffer_len int32, out_buffer_len []int32, out_strs [][]byte) int

var BoosterGetEvalNames func(booster Booster, len int32, out_len *int32, const size_t buffer_len, size_t* out_buffer_len, char** out_strs) int

View Source
var BoosterGetLeafValue func(booster Booster, tree_idx int32, leaf_idx int32, out_val *float64) int
View Source
var BoosterGetLinear func(booster Booster, out *int32) int
View Source
var BoosterGetLoadedParam func(booster Booster, buffer_len int64, outlen *int64, out_str string) int
View Source
var BoosterGetLowerBoundValue func(booster Booster, out_results *float64) int
View Source
var BoosterGetNumClasses func(booster Booster, out *int32) int
View Source
var BoosterGetNumFeature func(booster Booster, out_len *int32) int
View Source
var BoosterGetNumPredict func(booster Booster, data_idx int32, out_len *int64) int
View Source
var BoosterGetPredict func(booster Booster, data_idx int32, out_len *int64, out_result *float64) int
View Source
var BoosterGetUpperBoundValue func(booster Booster, out_results *float64) int
View Source
var BoosterLoadModelFromString func(model_str string, out_num_iterations *int32, out *Booster) int
View Source
var BoosterMerge func(booster Booster, other_booster Booster) int
View Source
var BoosterNumModelPerIteration func(booster Booster, out_tree_per_iteration *int32) int
View Source
var BoosterNumberOfTotalModel func(booster Booster, out *int32) int
View Source
var BoosterPredictForFile func(booster Booster, data_filename string, data_has_header int32, predict_type int32, start_iteration int32, num_iteration int32, parameter string, result_filename string) int
View Source
var BoosterPredictForMat func(booster Booster, data uintptr, data_type int32, nrow int32, ncol int32, is_row_major int32, predict_type int32, start_iteration int32, num_iteration int32, parameter string, outlen *int64, out_result *float64) int
View Source
var BoosterPredictForMatSingleRow func(booster Booster, data uintptr, data_type int32, ncol int32, is_row_major int32, predict_type int32, start_iteration int32, num_iteration int32, parameter string, outlen *int64, out_result *float64) int
View Source
var BoosterPredictForMatSingleRowFast func(fastConfig FastConfig, data []float32, outlen *int64, out_result *float64) int
View Source
var BoosterPredictForMatSingleRowFastInit func(booster Booster, predict_type int32, start_iteration int32, num_iteration int32, data_type int32, ncol int32, parameter string, out_fastConfig *FastConfig) int
View Source
var BoosterPredictForMats func(booster Booster, data *uintptr, data_type int32, nrow int32, ncol int32, predict_type int32, start_iteration int32, num_iteration int32, parameter string, outlen *int64, out_result *float64) int
View Source
var BoosterRefit func(booster Booster, leaf_preds *int32, nrow int32, ncol int32) int
View Source
var BoosterResetParameter func(booster Booster, parameters string) int
View Source
var BoosterResetTrainingData func(booster Booster, train_data Dataset) int
View Source
var BoosterRollbackOneIter func(booster Booster) int
View Source
var BoosterSaveModel func(booster Booster, start_iteration int32, num_iteration int32, feature_importance_type int32, filename string) int
View Source
var BoosterSaveModelToString func(booster Booster, start_iteration int32, num_iteration int32, feature_importance_type int32, buffer_len int64, outlen *int64, out_str []byte) int
View Source
var BoosterSetLeafValue func(booster Booster, tree_idx int32, leaf_idx int32, val float64) int
View Source
var BoosterShuffleModels func(booster Booster, start_iter int32, end_iter int32) int
View Source
var BoosterUpdateOneIter func(booster Booster, is_finished *int32) int
View Source
var BoosterUpdateOneIterCustom func(booster Booster, grad *float32, hess *float32, is_finished *int32) int
View Source
var BoosterValidateFeatureNames func(booster Booster, data_names *string, data_num_features int32) int // note: data_names was originally const char**
View Source
var ByteBufferFree func(byteBuffer ByteBuffer) int
View Source
var ByteBufferGetAt func(byteBuffer ByteBuffer, index int32, out_val *uint8) int
View Source
var DatasetAddFeaturesFrom func(target Dataset, source Dataset) int
View Source
var DatasetCreateByReference func(reference Dataset, num_total_row int64, out *Dataset) int
View Source
var DatasetCreateFromFile func(filename string, parameters string, reference Dataset, out *Dataset) int
View Source
var DatasetCreateFromMat func(data [][]float64, data_type int32, nrow int32, ncol int32, is_row_major int32, parameters string, reference Dataset, out *Dataset) int
View Source
var DatasetCreateFromMats func(nmat int32, data *uintptr, data_type int32, nrow *int32, ncol int32, is_row_major int32, parameters string, reference Dataset, out *Dataset) int
View Source
var DatasetDumpText func(dataset Dataset, filename string) int
View Source
var DatasetFree func(dataset Dataset) int
View Source
var DatasetGetFeatureNumBin func(dataset Dataset, feature int32, out *int32) int
View Source
var DatasetGetField func(dataset Dataset, field_name string, out_len *int32, out_ptr *uintptr, out_type *int32) int
View Source
var DatasetGetNumData func(dataset Dataset, out *int32) int
View Source
var DatasetGetNumFeature func(dataset Dataset, out *int32) int
View Source
var DatasetGetSubset func(dataset Dataset, used_row_indices *int32, num_used_row_indices int32, parameters string, out *Dataset) int
View Source
var DatasetInitStreaming func(dataset Dataset, has_weights int32, has_init_scores int32, has_queries int32, nclasses int32, nthreads int32, omp_max_threads int32) int
View Source
var DatasetMarkFinished func(dataset Dataset) int
View Source
var DatasetPushRows func(dataset Dataset, data uintptr, data_type int32, nrow int32, ncol int32, start_row int32) int
View Source
var DatasetPushRowsWithMetadata func(dataset Dataset, data uintptr, data_type int32, nrow int32, ncol int32, start_row int32, label *float32, weight *float32, init_score *float64, query *int32, tid int32) int
View Source
var DatasetSaveBinary func(dataset Dataset, filename string) int
View Source
var DatasetSerializeReferenceToBinary func(dataset Dataset, out *ByteBuffer, out_len *int32) int
View Source
var DatasetSetFeatureNames func(dataset Dataset, feature_names *string, num_feature_names int32) int // note: feature_names was originally const char**
View Source
var DatasetSetField func(dataset Dataset, field_name string, field_data uintptr, num_element int32, type_data int32) int
View Source
var DatasetSetWaitForManualFinish func(dataset Dataset, wait int32) int
View Source
var DatasetUpdateParamChecking func(old_parameters string, new_parameters string) int
View Source
var DumpParamAliases func(buffer_len int64, out_len *int64, out_str string) int
View Source
var FastConfigFree func(fastConfig FastConfig) int
View Source
var GetSampleCount func(num_total_row int32, parameters string, out *int32) int
View Source
var NetworkFree func() int
View Source
var NetworkInit func(machines string, local_listen_port int32, listen_time_out int32, num_machines int32) int
View Source
var SampleIndices func(num_total_row int32, parameters string, out uintptr, out_len *int32) int

Functions

func InitializeLightgbm

func InitializeLightgbm(libpath string)

Types

type Booster

type Booster uintptr

func CreateSimpleRegressionModel

func CreateSimpleRegressionModel(trainFile, validFile string) Booster

type ByteBuffer

type ByteBuffer uintptr

type Dataset

type Dataset uintptr

type FastConfig

type FastConfig uintptr

Directories

Path Synopsis
cmd
golight command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址