Documentation
¶
Index ¶
- type Fabricator
- func (f *Fabricator) Apply(useY bool, res ResultSet)
- func (f *Fabricator) ErrorRange() float64
- func (f *Fabricator) Gradient() float64
- func (f *Fabricator) GradientError(rangeVal float64)
- func (f *Fabricator) SetErrorRange(rangeVal float64)
- func (f *Fabricator) YIntercept() float64
- func (f *Fabricator) YInterceptError(rangeVal float64)
- type Result
- type ResultSet
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Fabricator ¶
type Fabricator struct {
// contains filtered or unexported fields
}
Fabricator represents the fabricator generated from a set of results.
func (*Fabricator) Apply ¶
func (f *Fabricator) Apply(useY bool, res ResultSet)
Apply applies the Fabricator on a given result set. Call this method multiple times to generate multiple trials. Set useY to true if you want to fill values of X using Y, instead of filling values of Y using X.
func (*Fabricator) ErrorRange ¶
func (f *Fabricator) ErrorRange() float64
ErrorRange returns the error range of Y values on the Fabricator.
func (*Fabricator) Gradient ¶
func (f *Fabricator) Gradient() float64
Gradient returns gradient of the Fabricator.
func (*Fabricator) GradientError ¶
func (f *Fabricator) GradientError(rangeVal float64)
GradientError sets the slope of the Fabricator model to a random value in the given range from the original gradient.
func (*Fabricator) SetErrorRange ¶
func (f *Fabricator) SetErrorRange(rangeVal float64)
SetErrorRange sets the range of trials returned by the Fabricator using the given range.
func (*Fabricator) YIntercept ¶
func (f *Fabricator) YIntercept() float64
YIntercept returns the y-intercept of the Fabricator.
func (*Fabricator) YInterceptError ¶
func (f *Fabricator) YInterceptError(rangeVal float64)
YInterceptError sets the y-intercept of the Fabricator model to a random value in the given range from the original y-intercept.
type ResultSet ¶
type ResultSet []Result
ResultSet represents a set of Result that is sorted in ascending order of X.
func (ResultSet) Fabricate ¶
func (r ResultSet) Fabricate() *Fabricator
Fabricate returns a perfect (i.e. no errors) Fabricator based on the ResultSet.
func (ResultSet) LinearRegression ¶
LinearRegression performs linear regression on the ResultSet using least squares, and returns the gradient and y-intercept.