linear_models

package
v0.0.0-...-93838e3 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2014 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package linear_models implements linear and logistic regression models.

Index

Constants

View Source
const (
	L2R_LR              = C.L2R_LR
	L2R_L2LOSS_SVC_DUAL = C.L2R_L2LOSS_SVC_DUAL
	L2R_L2LOSS_SVC      = C.L2R_L2LOSS_SVC
	L2R_L1LOSS_SVC_DUAL = C.L2R_L1LOSS_SVC_DUAL
	MCSVM_CS            = C.MCSVM_CS
	L1R_L2LOSS_SVC      = C.L1R_L2LOSS_SVC
	L1R_LR              = C.L1R_LR
	L2R_LR_DUAL         = C.L2R_LR_DUAL
)

Variables

View Source
var (
	NotEnoughDataError  = errors.New("not enough rows to support this many variables.")
	NoTrainingDataError = errors.New("you need to Fit() before you can Predict()")
)

Functions

func Predict

func Predict(model *Model, x []float64) float64

Types

type LinearRegression

type LinearRegression struct {
	// contains filtered or unexported fields
}

func NewLinearRegression

func NewLinearRegression() *LinearRegression

func (*LinearRegression) Fit

func (lr *LinearRegression) Fit(inst base.FixedDataGrid) error

func (*LinearRegression) Predict

type LogisticRegression

type LogisticRegression struct {
	// contains filtered or unexported fields
}

func NewLogisticRegression

func NewLogisticRegression(penalty string, C float64, eps float64) (*LogisticRegression, error)

func (*LogisticRegression) Fit

func (*LogisticRegression) Predict

type Model

type Model struct {
	// contains filtered or unexported fields
}

func Train

func Train(prob *Problem, param *Parameter) *Model

type Parameter

type Parameter struct {
	// contains filtered or unexported fields
}

func NewParameter

func NewParameter(solver_type int, C float64, eps float64) *Parameter

type Problem

type Problem struct {
	// contains filtered or unexported fields
}

func NewProblem

func NewProblem(X [][]float64, y []float64, bias float64) *Problem

Jump to

Keyboard shortcuts

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