func (regr *LinearRegression) Predict(X mat.Matrix, Ymutable mat.Mutable) *mat.Dense {
	Y := base.ToDense(Ymutable)
	nSamples, _ := X.Dims()
	if Y.IsEmpty() {
		*Y = *mat.NewDense(nSamples, regr.GetNOutputs(), nil)
	}
	regr.DecisionFunction(X, Y)
	return base.FromDense(Ymutable, Y)
}
Predict predicts y for X using Coef
package linearmodel
import (
	"errors"
	"fmt"
	"time"
	"github.com/pa-m/sklearn/base"
	"github.com/pa-m/sklearn/metrics"
	"github.com/pa-m/sklearn/preprocessing"
	"math"
	"runtime"
	"golang.org/x/exp/rand"
	"gonum.org/v1/gonum/mat"
	"gonum.org/v1/gonum/optimize"
)
type float = float64
type Activation = base.Activation
type LinearModel struct {
	FitIntercept, Normalize          bool
	XOffset, XScale, Coef, Intercept *mat.Dense
}
type LinearRegression struct {
	LinearModel
}
type RegularizedRegression struct {
	LinearRegression
	Solver              string
	SolverConfigure     func(base.Optimizer)
	Tol, Alpha, L1Ratio float64
	LossFunction        Loss
	ActivationFunction  Activation
	Options             LinFitOptions
}
func NewLinearRegression() *LinearRegression {
	regr := &LinearRegression{}
	regr.FitIntercept = true
	return regr
}
func (*LinearRegression) IsClassifier() bool { return false }
func (regr *LinearRegression) PredicterClone() base.Predicter {
	clone := *regr
	return &clone
}
func (regr *LinearRegression) Fit(Xmatrix, Ymatrix mat.Matrix) base.Fiter {
	X0, Y0 := base.ToDense(Xmatrix), base.ToDense(Ymatrix)
	var X, Y, YOffset *mat.Dense
	X, Y, regr.XOffset, YOffset, regr.XScale = PreprocessData(X0, Y0, regr.FitIntercept, regr.Normalize, nil)
	regr.Coef = &mat.Dense{}
	regr.Coef.Solve(X, Y)
	regr.LinearModel.setIntercept(regr.XOffset, YOffset, regr.XScale)
	return regr
}
func (regr *LinearModel) GetNOutputs() int {
	_, nOutputs := regr.Coef.Dims()
	return nOutputs
}
func (regr *RegularizedRegression) Fit(Xmatrix, Ymatrix mat.Matrix) base.Fiter {
	X0, Y0 := base.ToDense(Xmatrix), base.ToDense(Ymatrix)
	var X, Y, YOffset *mat.Dense
	X, Y, regr.XOffset, YOffset, regr.XScale = PreprocessData(X0, Y0, regr.FitIntercept, regr.Normalize, nil)
	opt := regr.Options
	opt.Tol = regr.Tol
	opt.Solver = regr.Solver
	opt.SolverConfigure = regr.SolverConfigure
	opt.Loss = regr.LossFunction
	opt.Activation = regr.ActivationFunction
	opt.Alpha = regr.Alpha
	opt.L1Ratio = regr.L1Ratio
	res := LinFit(X, Y, &opt)
	regr.Coef = res.Theta
	regr.LinearModel.setIntercept(regr.XOffset, YOffset, regr.XScale)
	return regr
}