logistic

package
v0.41.0 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2025 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LogisticRegression

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

LogisticRegression represents a logistic regression model.

func NewLogisticRegression

func NewLogisticRegression(beta0, beta1 *big.Float) *LogisticRegression

NewLogisticRegression initializes a new LogisticRegression model.

func (*LogisticRegression) Beta0

func (lr *LogisticRegression) Beta0() *big.Float

Beta0 returns the model's bias (intercept) term.

func (*LogisticRegression) Beta1

func (lr *LogisticRegression) Beta1() *big.Float

Beta1 returns the model's weight (slope) term.

func (*LogisticRegression) BigBeta0

func (lr *LogisticRegression) BigBeta0() *big.Int

BigBeta0 returns the model's bias (intercept) term.

func (*LogisticRegression) BigBeta1

func (lr *LogisticRegression) BigBeta1() *big.Int

BigBeta1 returns the model's weight (slope) term.

func (*LogisticRegression) PlotSigmoid

func (lr *LogisticRegression) PlotSigmoid(xValues, yValues []float64, blockNumber uint64) error

Plot the given trained logistic regression values with Beta0 and Beta1

func (*LogisticRegression) Predict

func (lr *LogisticRegression) Predict(x *big.Float) *big.Float

Predict computes the probability that the input belongs to class 1.

func (*LogisticRegression) Train

func (lr *LogisticRegression) Train(x []*big.Int, y []*big.Int)

Train trains the logistic regression model using gradient descent.

Jump to

Keyboard shortcuts

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