Documentation
¶
Index ¶
- Constants
- func NewRelativeMeanImprCriterion(tolerance float64) *relativeMeanImprCriterion
- type DiffFunction
- type EPLogisticRegression
- func (algo *EPLogisticRegression) Clear()
- func (algo *EPLogisticRegression) Command() cli.Command
- func (algo *EPLogisticRegression) Init(ctx *cli.Context)
- func (algo *EPLogisticRegression) LoadModel(path string)
- func (algo *EPLogisticRegression) Predict(sample *core.Sample) float64
- func (algo *EPLogisticRegression) SaveModel(path string)
- func (algo *EPLogisticRegression) Train(dataset *core.DataSet)
- type EPLogisticRegressionParams
- type FTRLFeatureWeight
- type FTRLLogisticRegression
- func (algo *FTRLLogisticRegression) Clear()
- func (algo *FTRLLogisticRegression) Command() cli.Command
- func (algo *FTRLLogisticRegression) Init(ctx *cli.Context)
- func (algo *FTRLLogisticRegression) LoadModel(path string)
- func (algo *FTRLLogisticRegression) Predict(sample *core.Sample) float64
- func (algo *FTRLLogisticRegression) SaveModel(path string)
- func (algo *FTRLLogisticRegression) Train(dataset *core.DataSet)
- type FTRLLogisticRegressionParams
- type LBFGSMinimizer
- type LROWLQN
- func (lr *LROWLQN) Clear()
- func (lr *LROWLQN) Command() cli.Command
- func (lr *LROWLQN) Equals(x *core.Vector, y *core.Vector) bool
- func (lr *LROWLQN) Gradient(pos *core.Vector) *core.Vector
- func (lr *LROWLQN) Init(ctx *cli.Context)
- func (lr *LROWLQN) LoadModel(path string)
- func (lr *LROWLQN) Predict(sample *core.Sample) float64
- func (lr *LROWLQN) SaveModel(path string)
- func (lr *LROWLQN) Train(dataset *core.DataSet)
- func (lr *LROWLQN) Value(pos *core.Vector) float64
- type LROWLQNParams
- type LinearRegression
- func (algo *LinearRegression) Command() cli.Command
- func (algo *LinearRegression) Init(ctx *cli.Context)
- func (algo *LinearRegression) LoadModel(path string)
- func (algo *LinearRegression) Predict(sample *core.Sample) float64
- func (algo *LinearRegression) SaveModel(path string)
- func (algo *LinearRegression) Train(dataset *core.DataSet)
- type LogisticRegression
- func (algo *LogisticRegression) Clear()
- func (algo *LogisticRegression) Command() cli.Command
- func (algo *LogisticRegression) Init(ctx *cli.Context)
- func (algo *LogisticRegression) LoadModel(path string)
- func (algo *LogisticRegression) Predict(sample *core.Sample) float64
- func (algo *LogisticRegression) SaveModel(path string)
- func (algo *LogisticRegression) Train(dataset *core.DataSet)
- type LogisticRegressionParams
- type LogisticRegressionStream
- func (algo *LogisticRegressionStream) Command() cli.Command
- func (algo *LogisticRegressionStream) Init(ctx *cli.Context)
- func (algo *LogisticRegressionStream) LoadModel(path string)
- func (algo *LogisticRegressionStream) Predict(sample *core.Sample) float64
- func (algo *LogisticRegressionStream) SaveModel(path string)
- func (algo *LogisticRegressionStream) Train(dataset *core.StreamingDataSet)
- type Minimizer
- type OWLQNMinimizer
- type QuasiNewtonHelper
- func (h *QuasiNewtonHelper) ApplyQuasiInverseHession(dir *core.Vector)
- func (h *QuasiNewtonHelper) BackTrackingLineSearch(cost float64, pos *core.Vector, grad *core.Vector, dir *core.Vector, ...) (nextCost float64, nextPos *core.Vector)
- func (h *QuasiNewtonHelper) UpdateState(nextPos *core.Vector, nextGrad *core.Vector) (isOptimal bool)
Constants ¶
View Source
const MAX_BACKTRACKING_ITER = 50
Variables ¶
This section is empty.
Functions ¶
func NewRelativeMeanImprCriterion ¶
func NewRelativeMeanImprCriterion(tolerance float64) *relativeMeanImprCriterion
Types ¶
type DiffFunction ¶
type DiffFunction interface {
Value(pos *core.Vector) float64
Gradient(pos *core.Vector) *core.Vector
}
Description: function for minimizer such as LBFGS and OWLQN
type EPLogisticRegression ¶
type EPLogisticRegression struct {
Model map[int64]*utils.Gaussian
// contains filtered or unexported fields
}
func (*EPLogisticRegression) Clear ¶
func (algo *EPLogisticRegression) Clear()
func (*EPLogisticRegression) Command ¶
func (algo *EPLogisticRegression) Command() cli.Command
func (*EPLogisticRegression) Init ¶
func (algo *EPLogisticRegression) Init(ctx *cli.Context)
func (*EPLogisticRegression) LoadModel ¶
func (algo *EPLogisticRegression) LoadModel(path string)
func (*EPLogisticRegression) Predict ¶
func (algo *EPLogisticRegression) Predict(sample *core.Sample) float64
func (*EPLogisticRegression) SaveModel ¶
func (algo *EPLogisticRegression) SaveModel(path string)
func (*EPLogisticRegression) Train ¶
func (algo *EPLogisticRegression) Train(dataset *core.DataSet)
type EPLogisticRegressionParams ¶
type EPLogisticRegressionParams struct {
// contains filtered or unexported fields
}
type FTRLFeatureWeight ¶
type FTRLFeatureWeight struct {
// contains filtered or unexported fields
}
func (*FTRLFeatureWeight) Wi ¶
func (w *FTRLFeatureWeight) Wi(p FTRLLogisticRegressionParams) float64
type FTRLLogisticRegression ¶
type FTRLLogisticRegression struct {
Model map[int64]FTRLFeatureWeight
Params FTRLLogisticRegressionParams
}
func (*FTRLLogisticRegression) Clear ¶
func (algo *FTRLLogisticRegression) Clear()
func (*FTRLLogisticRegression) Command ¶
func (algo *FTRLLogisticRegression) Command() cli.Command
func (*FTRLLogisticRegression) Init ¶
func (algo *FTRLLogisticRegression) Init(ctx *cli.Context)
func (*FTRLLogisticRegression) LoadModel ¶
func (algo *FTRLLogisticRegression) LoadModel(path string)
func (*FTRLLogisticRegression) Predict ¶
func (algo *FTRLLogisticRegression) Predict(sample *core.Sample) float64
func (*FTRLLogisticRegression) SaveModel ¶
func (algo *FTRLLogisticRegression) SaveModel(path string)
func (*FTRLLogisticRegression) Train ¶
func (algo *FTRLLogisticRegression) Train(dataset *core.DataSet)
type FTRLLogisticRegressionParams ¶
type FTRLLogisticRegressionParams struct {
Alpha float64
Beta float64
Lambda1 float64
Lambda2 float64
IsBalance bool // 正反例样本是否均衡
SSR float64 // 欠采样比例Sub-Sample Ratio (0,1]。默认值为1,表示正反例样本数量均衡,不均衡时表示负例(label=0)样本。
SBR float64 // Samples Balance Ratio 样本集正反例样本比率 (0,1]。默认值为1,表示正反例样本数量均衡。
Steps int // 最大迭代次数
}
type LBFGSMinimizer ¶
type LBFGSMinimizer struct {
// contains filtered or unexported fields
}
func NewLBFGSMinimizer ¶
func NewLBFGSMinimizer() *LBFGSMinimizer
func (*LBFGSMinimizer) Minimize ¶
func (m *LBFGSMinimizer) Minimize(costfun DiffFunction, init *core.Vector) *core.Vector
type LROWLQN ¶
type LROWLQN struct {
Model *core.Vector
Params LROWLQNParams
// contains filtered or unexported fields
}
type LROWLQNParams ¶
type LROWLQNParams struct {
Regularization float64
}
type LinearRegression ¶
type LinearRegression struct {
Model map[int64]float64
Params LogisticRegressionParams
}
func (*LinearRegression) Command ¶
func (algo *LinearRegression) Command() cli.Command
func (*LinearRegression) Init ¶
func (algo *LinearRegression) Init(ctx *cli.Context)
func (*LinearRegression) LoadModel ¶
func (algo *LinearRegression) LoadModel(path string)
func (*LinearRegression) Predict ¶
func (algo *LinearRegression) Predict(sample *core.Sample) float64
func (*LinearRegression) SaveModel ¶
func (algo *LinearRegression) SaveModel(path string)
func (*LinearRegression) Train ¶
func (algo *LinearRegression) Train(dataset *core.DataSet)
type LogisticRegression ¶
type LogisticRegression struct {
Model map[int64]float64
Params LogisticRegressionParams
}
func (*LogisticRegression) Clear ¶
func (algo *LogisticRegression) Clear()
func (*LogisticRegression) Command ¶
func (algo *LogisticRegression) Command() cli.Command
func (*LogisticRegression) Init ¶
func (algo *LogisticRegression) Init(ctx *cli.Context)
func (*LogisticRegression) LoadModel ¶
func (algo *LogisticRegression) LoadModel(path string)
func (*LogisticRegression) Predict ¶
func (algo *LogisticRegression) Predict(sample *core.Sample) float64
func (*LogisticRegression) SaveModel ¶
func (algo *LogisticRegression) SaveModel(path string)
func (*LogisticRegression) Train ¶
func (algo *LogisticRegression) Train(dataset *core.DataSet)
type LogisticRegressionStream ¶
type LogisticRegressionStream struct {
Model map[int64]float64
Params LogisticRegressionParams
}
func (*LogisticRegressionStream) Command ¶
func (algo *LogisticRegressionStream) Command() cli.Command
func (*LogisticRegressionStream) Init ¶
func (algo *LogisticRegressionStream) Init(ctx *cli.Context)
func (*LogisticRegressionStream) LoadModel ¶
func (algo *LogisticRegressionStream) LoadModel(path string)
func (*LogisticRegressionStream) Predict ¶
func (algo *LogisticRegressionStream) Predict(sample *core.Sample) float64
func (*LogisticRegressionStream) SaveModel ¶
func (algo *LogisticRegressionStream) SaveModel(path string)
func (*LogisticRegressionStream) Train ¶
func (algo *LogisticRegressionStream) Train(dataset *core.StreamingDataSet)
type OWLQNMinimizer ¶
type OWLQNMinimizer struct {
// contains filtered or unexported fields
}
*
- It's based the paper "Scalable Training of L1-Regularized Log-Linear Models"
- by Galen Andrew and Jianfeng Gao
- user: weixuan
- To change this template use File | Settings | File Templates.
func NewOWLQNMinimizer ¶
func NewOWLQNMinimizer(l1reg float64) *OWLQNMinimizer
func (*OWLQNMinimizer) Minimize ¶
func (m *OWLQNMinimizer) Minimize(costfun DiffFunction, init *core.Vector) *core.Vector
type QuasiNewtonHelper ¶
type QuasiNewtonHelper struct {
// contains filtered or unexported fields
}
*
- It's based the paper "Scalable Training of L1-Regularized Log-Linear Models"
- by Galen Andrew and Jianfeng Gao
- user: weixuan
- To change this template use File | Settings | File Templates.
func NewQuasiNewtonHelper ¶
func NewQuasiNewtonHelper(numHist int, minimizer Minimizer, curPos *core.Vector, curGrad *core.Vector) *QuasiNewtonHelper
Description: the pos and gradient arguments should NOT be modified outside
func (*QuasiNewtonHelper) ApplyQuasiInverseHession ¶
func (h *QuasiNewtonHelper) ApplyQuasiInverseHession(dir *core.Vector)
Description: Update the dir from -grad to optimal direction
Dir will be modified directly
func (*QuasiNewtonHelper) BackTrackingLineSearch ¶
func (*QuasiNewtonHelper) UpdateState ¶
func (h *QuasiNewtonHelper) UpdateState(nextPos *core.Vector, nextGrad *core.Vector) (isOptimal bool)
Description: the pos and gradient arguments should NOT be modified outside
Click to show internal directories.
Click to hide internal directories.