mlworkshop

module
v0.0.0-...-ed6d74d Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2019 License: MIT

README

Machine Learning Workshop

GoDoc Go Report Card

Training and Evaluation harness for machine learning algorithms in Go and JavaScript.

Usage

Go

Go get the evaluation harness:

go get -u github.com/fresh8/mlworkshop/harness

To use the harness simply call the Evaluate() function passing in the path to the dataset csv file and your model:

package main

import (
	"log"

	"github.com/fresh8/mlworkshop/harness"
	"gonum.org/v1/gonum/mat"
)

func main() {

	log.Println("Evaluating model")

	model := MyClassifier{
		// model parameters
	}

	result, err := harness.Evaluate("diabetes.csv", &model)
	if err != nil {
		log.Fatal(err)
	}

	log.Printf("Result = %+v", result)
}

Where the model of type MyClassifier implements the harness.Predictor interface. Please refer to the Godoc for more details.

Javascript

Copy the harness.js into your project.

To apply the harness:

const result = harness.evaluator('path/string/to/data', Algo)
console.log(result)

The harness will expect your implimentation to be a class with fit and predict methods.

the evaluator method will return an object of metrics, measuring how accurate your implimentation is.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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