Documentation ¶
Index ¶
- type DataPoint
- type ErrLogUndefined
- type Fitter
- type Predicter
- type Regression
- func NewCombined(combiner func(x, y float64) float64, first, second Regression) Regression
- func NewExponential() Regression
- func NewExponentialWithLogExpFunc(log, exp func(float64) float64) Regression
- func NewLinear() Regression
- func NewLogLog() Regression
- func NewLogLogWithLogFunc(log func(float64) float64) Regression
- func NewLogarithmic() Regression
- func NewLogarithmicWithLogFunc(log func(float64) float64) Regression
- func NewPower() Regression
- func NewPowerWithLogFunc(log func(float64) float64) Regression
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ErrLogUndefined ¶
type ErrLogUndefined float64
ErrLogUndefined signifies that the logarithm of the underlying value is undefined.
func (ErrLogUndefined) Error ¶
func (f ErrLogUndefined) Error() string
Error implements the error interface
func (ErrLogUndefined) Value ¶
func (f ErrLogUndefined) Value() float64
Value returns the floating point value for which the logarithm is undefined.
type Regression ¶
type Regression interface { Fitter Predicter // GetR2 returns the R-squared metric of the regression. GetR2() float64 }
Regression is the interface that groups the Fit and Predict methods.
func NewCombined ¶
func NewCombined(combiner func(x, y float64) float64, first, second Regression) Regression
NewCombined returns a new Regression combining other regression.
func NewExponential ¶
func NewExponential() Regression
NewExponential returns a new Regression for exponential regression.
func NewExponentialWithLogExpFunc ¶
func NewExponentialWithLogExpFunc(log, exp func(float64) float64) Regression
NewExponentialWithLogExpFunc returns a new Regression for log-log regression.
func NewLinear ¶
func NewLinear() Regression
NewLinear returns a new Regression for linear regression.
func NewLogLog ¶
func NewLogLog() Regression
NewLogLog returns a new Regression for log-log regression.
func NewLogLogWithLogFunc ¶
func NewLogLogWithLogFunc(log func(float64) float64) Regression
NewLogLogWithLogFunc returns a new Regression for log-log regression.
func NewLogarithmic ¶
func NewLogarithmic() Regression
NewLogarithmic returns a new Regression for logarithmic regression.
func NewLogarithmicWithLogFunc ¶
func NewLogarithmicWithLogFunc(log func(float64) float64) Regression
NewLogarithmicWithLogFunc returns a new Regression for logarithmic regression.
func NewPowerWithLogFunc ¶
func NewPowerWithLogFunc(log func(float64) float64) Regression
NewPowerWithLogFunc returns a new Regression for power regression.