Categorygithub.com/Vaniog/lirego
modulepackage
0.0.0-20240610133139-934a22290b84
Repository: https://github.com/vaniog/lirego.git
Documentation: pkg.go.dev

# README

Optimization methods Lab №3

Team:

  • Gurov Matvey M3233
  • Tarasov Ivan M3233
  • Farafonov Egor M3233

Lirego

Function prediction and other optimization problems solution with linear regression

Presentation

Goрдость.pdf

Benchmarks

benchmarks

Examples

Polynomial:
polynom

Exponential:
exponent

Trigonometry:
sin

Code snippet

// x1 + 2*x2 = y
ds := training.NewSliceDataSet([][]float64{
  {0, 1, 2},
  {2, 0, 2},
  {3, 2, 7},
})

lm := ml.NewLinearModel(ml.Config{
  RowLen: 2,
  Loss:   ml.MSELoss{},
  Reg:    ml.EmptyRegularizator{},
  Bias:   false,
})

trainer := training.NewGreedyTrainer(0, 100000, 0.1)
trainer.Train(lm, ds)

fmt.Println(lm.Predict(mat.NewVecDense(2, []float64{1, 1})))
//Output: 2.999999