Documentation
¶
Index ¶
- Variables
- func FindCategory(split []float64, value float64) int
- func Gini(left_dis, right_dis *ArrayVector) float64
- func InformationValue(dataset *DataSet) map[int64]float64
- func RemoveLowFreqFeatures(dataset *DataSet, threshold float64)
- type ArrayVector
- func (v *ArrayVector) AddValue(key int, value float64)
- func (v *ArrayVector) AddVector(v2 *ArrayVector, alpha float64)
- func (v *ArrayVector) Copy() *ArrayVector
- func (v *ArrayVector) Dot(v2 *ArrayVector) float64
- func (v *ArrayVector) Expand(size int)
- func (v *ArrayVector) FromString(buf string)
- func (v *ArrayVector) GetValue(key int) float64
- func (v *ArrayVector) KeyWithMaxValue() (int, float64)
- func (v *ArrayVector) NormL2() float64
- func (v *ArrayVector) Scale(s float64)
- func (v *ArrayVector) SetValue(key int, value float64)
- func (v *ArrayVector) SoftMaxNorm() *ArrayVector
- func (v *ArrayVector) Sum() float64
- func (v *ArrayVector) ToString() []byte
- type CombinedFeature
- type DataSet
- type ElemOperation
- type Feature
- type FeatureGoalDistribution
- func (f *FeatureGoalDistribution) AddWeightGoal(weight float64, goal float64)
- func (f *FeatureGoalDistribution) BestSplitByVariance(sum_left, sum_left2, count_left, sum_right, sum_right2, count_right float64) (float64, float64)
- func (f *FeatureGoalDistribution) Len() int
- func (f *FeatureGoalDistribution) Less(i, j int) bool
- func (f *FeatureGoalDistribution) Swap(i, j int)
- func (f *FeatureGoalDistribution) Variance(sum_left, sum_left2, count_left, sum_right, sum_right2, count_right float64) float64
- type FeatureLabelDistribution
- func (f *FeatureLabelDistribution) AddWeightLabel(weight float64, label int)
- func (self *FeatureLabelDistribution) BestSplitByGini(total_dis *ArrayVector) (float64, float64)
- func (f *FeatureLabelDistribution) InformationValue(global_total, global_positive int) float64
- func (f *FeatureLabelDistribution) LabelDistribution() *ArrayVector
- func (f *FeatureLabelDistribution) Len() int
- func (f *FeatureLabelDistribution) Less(i, j int) bool
- func (f *FeatureLabelDistribution) PositiveCount() int
- func (f *FeatureLabelDistribution) Swap(i, j int)
- type FeatureSplit
- type FeatureType
- type IntEncoder
- type LabelEncoder
- type MapBasedSample
- type Matrix
- func (m *Matrix) AddValue(k1, k2 int64, v float64)
- func (m *Matrix) ElemWiseAddMatrix(n *Matrix) *Matrix
- func (m *Matrix) GetRow(k1 int64) *Vector
- func (m *Matrix) GetValue(k1, k2 int64) float64
- func (m *Matrix) MultiplyVector(v *Vector) *Vector
- func (m *Matrix) Scale(scale float64) *Matrix
- func (m *Matrix) SetValue(k1, k2 int64, v float64)
- func (m *Matrix) Trans() *Matrix
- type RawDataSet
- type RawSample
- type RealDataSet
- type RealSample
- type Sample
- type StreamingDataSet
- type Vector
- func (v *Vector) AddValue(key int64, value float64)
- func (v *Vector) AddVector(v2 *Vector, alpha float64)
- func (v *Vector) ApplyElemWiseMultiplyAccumulation(u *Vector, s float64)
- func (v *Vector) ApplyOnElem(fn ElemOperation) *Vector
- func (v *Vector) ApplyScale(scale float64)
- func (v *Vector) Copy() *Vector
- func (v *Vector) Dot(v2 *Vector) float64
- func (v *Vector) DotFeatures(fs []Feature) float64
- func (v *Vector) ElemWiseAddVector(u *Vector) *Vector
- func (v *Vector) ElemWiseMultiply(u *Vector) *Vector
- func (v *Vector) ElemWiseMultiplyAdd(u *Vector, s float64) *Vector
- func (v *Vector) FromString(buf string)
- func (v *Vector) GetValue(key int64) float64
- func (v *Vector) KeyWithMaxValue() (int64, float64)
- func (v *Vector) MultiplyMatrix(m *Matrix) *Vector
- func (v *Vector) NormL2() float64
- func (v *Vector) OuterProduct(u *Vector) *Matrix
- func (v *Vector) RandomInit(key int64, c float64)
- func (v *Vector) Scale(scale float64) *Vector
- func (v *Vector) SetValue(key int64, value float64)
- func (v *Vector) SoftMaxNorm() *Vector
- func (v *Vector) Sum() float64
- func (v *Vector) ToString() []byte
- type WeightGoal
- type WeightLabel
Constants ¶
This section is empty.
Variables ¶
View Source
var FeatureTypeEnum = struct { DISCRETE_FEATURE FeatureType CONTINUOUS_FEATURE FeatureType }{0, 1}
Functions ¶
func FindCategory ¶
func Gini ¶
func Gini(left_dis, right_dis *ArrayVector) float64
func InformationValue ¶
func RemoveLowFreqFeatures ¶
Types ¶
type ArrayVector ¶
type ArrayVector struct {
// contains filtered or unexported fields
}
func NewArrayVector ¶
func NewArrayVector() *ArrayVector
func (*ArrayVector) AddValue ¶
func (v *ArrayVector) AddValue(key int, value float64)
func (*ArrayVector) AddVector ¶
func (v *ArrayVector) AddVector(v2 *ArrayVector, alpha float64)
func (*ArrayVector) Copy ¶
func (v *ArrayVector) Copy() *ArrayVector
func (*ArrayVector) Dot ¶
func (v *ArrayVector) Dot(v2 *ArrayVector) float64
func (*ArrayVector) Expand ¶
func (v *ArrayVector) Expand(size int)
func (*ArrayVector) FromString ¶
func (v *ArrayVector) FromString(buf string)
func (*ArrayVector) GetValue ¶
func (v *ArrayVector) GetValue(key int) float64
func (*ArrayVector) KeyWithMaxValue ¶
func (v *ArrayVector) KeyWithMaxValue() (int, float64)
func (*ArrayVector) NormL2 ¶
func (v *ArrayVector) NormL2() float64
func (*ArrayVector) Scale ¶
func (v *ArrayVector) Scale(s float64)
func (*ArrayVector) SetValue ¶
func (v *ArrayVector) SetValue(key int, value float64)
func (*ArrayVector) SoftMaxNorm ¶
func (v *ArrayVector) SoftMaxNorm() *ArrayVector
func (*ArrayVector) Sum ¶
func (v *ArrayVector) Sum() float64
func (*ArrayVector) ToString ¶
func (v *ArrayVector) ToString() []byte
type CombinedFeature ¶
type CombinedFeature []string
type DataSet ¶
type DataSet struct { Samples []*Sample FeatureNameIdMap map[int64]string // contains filtered or unexported fields }
DataSet
func LinearDataSet ¶
func NewDataSet ¶
func NewDataSet() *DataSet
func XORDataSet ¶
type ElemOperation ¶
type FeatureGoalDistribution ¶
type FeatureGoalDistribution struct {
// contains filtered or unexported fields
}
func NewFeatureGoalDistribution ¶
func NewFeatureGoalDistribution() *FeatureGoalDistribution
func (*FeatureGoalDistribution) AddWeightGoal ¶
func (f *FeatureGoalDistribution) AddWeightGoal(weight float64, goal float64)
func (*FeatureGoalDistribution) BestSplitByVariance ¶
func (f *FeatureGoalDistribution) BestSplitByVariance(sum_left, sum_left2, count_left, sum_right, sum_right2, count_right float64) (float64, float64)
func (*FeatureGoalDistribution) Len ¶
func (f *FeatureGoalDistribution) Len() int
func (*FeatureGoalDistribution) Less ¶
func (f *FeatureGoalDistribution) Less(i, j int) bool
func (*FeatureGoalDistribution) Swap ¶
func (f *FeatureGoalDistribution) Swap(i, j int)
func (*FeatureGoalDistribution) Variance ¶
func (f *FeatureGoalDistribution) Variance(sum_left, sum_left2, count_left, sum_right, sum_right2, count_right float64) float64
type FeatureLabelDistribution ¶
type FeatureLabelDistribution struct {
// contains filtered or unexported fields
}
func NewFeatureLabelDistribution ¶
func NewFeatureLabelDistribution() *FeatureLabelDistribution
func (*FeatureLabelDistribution) AddWeightLabel ¶
func (f *FeatureLabelDistribution) AddWeightLabel(weight float64, label int)
func (*FeatureLabelDistribution) BestSplitByGini ¶
func (self *FeatureLabelDistribution) BestSplitByGini(total_dis *ArrayVector) (float64, float64)
func (*FeatureLabelDistribution) InformationValue ¶
func (f *FeatureLabelDistribution) InformationValue(global_total, global_positive int) float64
func (*FeatureLabelDistribution) LabelDistribution ¶
func (f *FeatureLabelDistribution) LabelDistribution() *ArrayVector
func (*FeatureLabelDistribution) Len ¶
func (f *FeatureLabelDistribution) Len() int
func (*FeatureLabelDistribution) Less ¶
func (f *FeatureLabelDistribution) Less(i, j int) bool
func (*FeatureLabelDistribution) PositiveCount ¶
func (f *FeatureLabelDistribution) PositiveCount() int
func (*FeatureLabelDistribution) Swap ¶
func (f *FeatureLabelDistribution) Swap(i, j int)
type FeatureSplit ¶
type FeatureSplit []float64
type FeatureType ¶
type FeatureType int
func GetFeatureType ¶
func GetFeatureType(key string) FeatureType
type IntEncoder ¶
func NewIntEncoder ¶
func NewIntEncoder() *IntEncoder
func (*IntEncoder) Encoded ¶
func (e *IntEncoder) Encoded(original int) int
type LabelEncoder ¶
type LabelEncoder struct {
// contains filtered or unexported fields
}
func NewLabelEncoder ¶
func NewLabelEncoder() *LabelEncoder
func (*LabelEncoder) InverseTransformDataset ¶
func (e *LabelEncoder) InverseTransformDataset(dataset *DataSet) *DataSet
func (*LabelEncoder) InverseTransformSample ¶
func (e *LabelEncoder) InverseTransformSample(s *Sample) *Sample
func (*LabelEncoder) TransformDataset ¶
func (e *LabelEncoder) TransformDataset(dataset *DataSet) *DataSet
func (*LabelEncoder) TransformSample ¶
func (e *LabelEncoder) TransformSample(s *Sample) *Sample
type MapBasedSample ¶
MapBasedSample
func (*MapBasedSample) LabelDoubleValue ¶
func (s *MapBasedSample) LabelDoubleValue() float64
type RawDataSet ¶
RawDataSet
func NewRawDataSet ¶
func NewRawDataSet() *RawDataSet
func (*RawDataSet) AddSample ¶
func (d *RawDataSet) AddSample(sample *RawSample)
func (*RawDataSet) Load ¶
func (d *RawDataSet) Load(path string) error
func (*RawDataSet) ToDataSet ¶
func (d *RawDataSet) ToDataSet(splits map[string][]float64, combinations []CombinedFeature) *DataSet
type RawSample ¶
RawSample
func NewRawSample ¶
func NewRawSample() *RawSample
func (*RawSample) GetFeatureValue ¶
type RealDataSet ¶
type RealDataSet struct {
Samples []*RealSample
}
Real valued DataSet
func NewRealDataSet ¶
func NewRealDataSet() *RealDataSet
func SinusoidalDataSet ¶
func SinusoidalDataSet(n int) *RealDataSet
func (*RealDataSet) AddSample ¶
func (d *RealDataSet) AddSample(sample *RealSample)
type RealSample ¶
RealSample Real valued samples for regression
func NewRealSample ¶
func NewRealSample() *RealSample
func (*RealSample) AddFeature ¶
func (s *RealSample) AddFeature(f Feature)
func (*RealSample) GetFeatureVector ¶
func (rs *RealSample) GetFeatureVector() *Vector
type Sample ¶
Sample - for classification Here, label should be int value started from 0
func (*Sample) AddFeature ¶
func (*Sample) GetFeatureVector ¶
func (*Sample) LabelDoubleValue ¶
func (*Sample) ToMapBasedSample ¶
func (s *Sample) ToMapBasedSample() *MapBasedSample
type StreamingDataSet ¶
type StreamingDataSet struct {
Samples chan *Sample
}
Streaming
func NewStreamingDataSet ¶
func NewStreamingDataSet() *StreamingDataSet
func (*StreamingDataSet) AddSample ¶
func (d *StreamingDataSet) AddSample(sample *Sample)
type Vector ¶
func (*Vector) ApplyElemWiseMultiplyAccumulation ¶
func (*Vector) ApplyOnElem ¶
func (v *Vector) ApplyOnElem(fn ElemOperation) *Vector
func (*Vector) ApplyScale ¶
func (*Vector) DotFeatures ¶
func (*Vector) ElemWiseAddVector ¶
func (*Vector) ElemWiseMultiply ¶
func (*Vector) ElemWiseMultiplyAdd ¶
func (*Vector) FromString ¶
func (*Vector) KeyWithMaxValue ¶
func (*Vector) MultiplyMatrix ¶
func (*Vector) OuterProduct ¶
func (*Vector) RandomInit ¶
func (*Vector) SoftMaxNorm ¶
type WeightGoal ¶
type WeightGoal struct {
// contains filtered or unexported fields
}
type WeightLabel ¶
type WeightLabel struct {
// contains filtered or unexported fields
}
func (*WeightLabel) LabelDoubleValue ¶
func (self *WeightLabel) LabelDoubleValue() float64
Click to show internal directories.
Click to hide internal directories.