Documentation ¶
Index ¶
- func AccumPlatt(c int, colSum *mat64.Vector, plattAB *mat64.Dense, plattASet *mat64.Dense, ...)
- func AccumThres(c int, colSum *mat64.Vector, thresSet *mat64.Dense, thres *mat64.Dense)
- func AccumTsYdata(iFold int, c int, colSum *mat64.Vector, tsYh *mat64.Dense, tsY *mat64.Dense, ...)
- func AveThres(cBest int, thresSet *mat64.Dense, plattCountSet *mat64.Dense) (aveThres *mat64.Dense)
- func BestHyperParameterSetByMeasure(trainMeasure *mat64.Dense, index int) (cBest int, value float64)
- func BinPredByAlpha(Yh *mat64.Dense, rankCut int, outBin bool) (binYh *mat64.Dense, detectNanInf bool)
- func ColMaxMin(data *mat64.Dense)
- func ColScale(data *mat64.Dense, rebaData *mat64.Dense) (scaleData *mat64.Dense)
- func ColStackMatrix(X *mat64.Dense, addX *mat64.Dense) (X2 *mat64.Dense)
- func ComputeAccuracy(tsYdata *mat64.Dense, Yhat *mat64.Dense, isWeighted bool) (accuracy float64)
- func ComputeAupr(Y *mat64.Vector, Yh *mat64.Vector, beta float64) (aupr float64, pAupr float64, maxFscore float64, optThres float64)
- func ComputeF1_3(Y *mat64.Vector, Yh *mat64.Vector, thres float64) (F1 float64, tp int, fp int, fn int, tn int)
- func DefaultThres(tsYdata *mat64.Dense, tsYhat *mat64.Dense) (thres *mat64.Dense)
- func DistanceTopK(k int, rowIdx int, tsYhat *mat64.Dense, yProbTrain *mat64.Dense) (idxArr []int)
- func EcocRun(tsXdata *mat64.Dense, tsYdata *mat64.Dense, trXdata *mat64.Dense, ...) (YhSet map[int]*mat64.Dense, colSum *mat64.Vector)
- func EleCopy(data *mat64.Dense) (data2 *mat64.Dense)
- func FeatureDataStack(sPriorData *mat64.Dense, tsRowName []string, trRowName []string, ...) (tsXdata1 *mat64.Dense, trXdata1 *mat64.Dense)
- func Flat(Y *mat64.Dense) (vec *mat64.Vector)
- func FscoreThres(tsYdata *mat64.Dense, tsYhat *mat64.Dense, beta float64, isParAuprThres bool) (thres *mat64.Dense)
- func HyperParameterSet(maxDim int, lbL float64, hbL float64, nStep int) (kSet []int, sigmaFctsSet []float64, lamdaSet []float64)
- func IOC_MFADecoding(nRowTsY int, rowIdx int, tsY_Prob *mat64.Dense, tsY_C *mat64.Dense, ...) (tsYhatData []float64)
- func Init(resFolder string) (logFIle *os.File)
- func LabelRelationship(trYdata *mat64.Dense) (posLabelRls *mat64.Dense, negLabelRls *mat64.Dense)
- func MSE(trY *mat64.Vector, trYh *mat64.Vector) (mse float64)
- func MaskZeroByThres(tsYhat *mat64.Dense, thresData *mat64.Dense) (tsYhat2 *mat64.Dense)
- func MulEleByFloat64(value float64, M *mat64.Dense) (M2 *mat64.Dense)
- func MultiLabelRecalibrate(kNN int, tsYhat *mat64.Dense, xTest *mat64.Dense, yPlattTrain *mat64.Dense, ...) (tsYhatCal *mat64.Dense)
- func NetworkEnhance(network *mat64.Dense) (networkEnhanced *mat64.Dense)
- func ParaCov(data *mat64.Dense, goro int) (covmat *mat64.Dense, err error)
- func Platt(trYhat *mat64.Dense, trY *mat64.Dense, tsYhat *mat64.Dense, lamdaArr []float64) (tsYhh *mat64.Dense, plattAB *mat64.Dense, mseArr []float64)
- func PlattChopScale(tsY *mat64.Dense, tsYhh *mat64.Dense) (maxArr []float64)
- func PlattParameterEst(Yh *mat64.Vector, Y *mat64.Vector) (A float64, B float64)
- func PlattScale(Yh *mat64.Vector, A float64, B float64) (Yhh []float64)
- func PlattScaleSet(Yh *mat64.Dense, plattAB *mat64.Dense) (Yhh *mat64.Dense)
- func PlattScaleSetPseudoLabel(tsYhat *mat64.Dense, trYdata *mat64.Dense, thres *mat64.Dense) (tsYhat2 *mat64.Dense, thres2 *mat64.Dense)
- func Pop(pToSlice *[]float64) float64
- func PosSelect(tsYdata *mat64.Dense, colSum *mat64.Vector) (tsYdataFilter *mat64.Dense)
- func PrintMemUsage()
- func PropagateSet(network *mat64.Dense, trYdata *mat64.Dense, idIdx map[string]int, ...) (sPriorData *mat64.Dense, ind []int)
- func PropagateSetWithPrior(priorData *mat64.Dense, priorGeneID map[string]int, ...) (sPriorData *mat64.Dense, ind []int)
- func QuantileNorm(data *mat64.Dense, thresData *mat64.Dense, isTransThres bool) (normData *mat64.Dense, normThresData *mat64.Dense)
- func RandListFromUniDist(length int, length2 int) (values []float64)
- func RankPred(Yh *mat64.Dense, thres *mat64.Dense) (rankYh *mat64.Dense, rankThres *mat64.Dense)
- func ReadFile(inFile string, rowName bool, colName bool) (dataR *mat64.Dense, rName []string, cName []string, err error)
- func ReadIDfile(inFile string) (rName []string)
- func ReadNetwork(inNetworkFile string) (network *mat64.Dense, idIdx map[string]int, idxToId map[int]string)
- func ReadNetworkPropagate(trRowName []string, tsRowName []string, trYdata *mat64.Dense, ...) (tsXdata *mat64.Dense, trXdata *mat64.Dense, indAccum []int)
- func ReadNetworkPropagateCV(f int, folds map[int][]int, trRowName []string, tsRowName []string, ...) (cvTrain []int, cvTest []int, trXdataCV *mat64.Dense, indAccum []int)
- func RebalanceData(trYdata *mat64.Dense) (rebaData *mat64.Dense)
- func RefillIndCol(tsX *mat64.Dense, ind []int) (tsX2 *mat64.Dense)
- func Report(tsYdata *mat64.Dense, tsYhat *mat64.Dense, thresData *mat64.Dense, rankCut int, ...) (microF1 float64, accuracy float64, macroAupr float64, microAupr float64, ...)
- func RescaleData(data *mat64.Dense, thresData *mat64.Dense) (scaleData *mat64.Dense)
- func SOIS(trY *mat64.Dense, nFold int, ratio int, isOutInfo bool) (folds map[int][]int)
- func SelectPlattAB(cBest int, plattASet *mat64.Dense, plattBSet *mat64.Dense, ...) (plattAB *mat64.Dense)
- func Shift(pToSlice *[]string) string
- func Sigmoid(x float64) (y float64)
- func SigmoidMatrix(data *mat64.Dense) (scaleData *mat64.Dense)
- func Single_compute(tsYdata *mat64.Dense, tsYhat *mat64.Dense, rankCut int) (microF1 float64, accuracy float64, macroAupr float64, microAupr float64)
- func SoftThresScale(tsYhat *mat64.Dense, thresData *mat64.Dense) (tsYhat2 *mat64.Dense, thresData2 *mat64.Dense)
- func SubSetTrain(iFold int, Y *mat64.Dense, Yh *mat64.Dense, predBinY *mat64.Dense, ...) (yPlattTrain *mat64.Dense, yPredTrain *mat64.Dense, xTrain *mat64.Dense, ...)
- func TestDataPlattChopScale(tsYhh *mat64.Dense, maxArr []float64)
- func TmmFilterForPlatt(inTrYhat *mat64.Vector, inTrY *mat64.Vector, lamda float64) (trYhat *mat64.Vector, trY *mat64.Vector)
- func TopKprec(tsYdata *mat64.Dense, Yhat *mat64.Dense, k int) (kPrec float64)
- func TrainRLS_Regress_CG(trFoldX *mat64.Dense, trFoldY *mat64.Dense, lamda float64, ...) (weights *mat64.Dense)
- func TuneAndPredict(nFold int, fBetaThres float64, nK int, nKnn int, isFirst bool, isKnn bool, ...) (trainMeasureUpdated *mat64.Dense, testMeasureUpdated *mat64.Dense, ...)
- func WriteFile(outFile string, data *mat64.Dense, name []string, isRowID bool) (err error)
- func WriteNetwork(outFile string, data *mat64.Dense, idxToId map[int]string) (err error)
- func WriteOutputFiles(isVerbose bool, resFolder string, trainMeasure *mat64.Dense, ...)
- func YhPlattSetUpdate(iFold int, c int, YhPlattSetCalibrated map[int]*mat64.Dense, ...)
- func Zscore(data *mat64.Dense) (scaleData *mat64.Dense)
- type ByValue
- type CvFold
- type Model
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AccumPlatt ¶
func AccumThres ¶
func AccumTsYdata ¶
func AccumTsYdata(iFold int, c int, colSum *mat64.Vector, tsYh *mat64.Dense, tsY *mat64.Dense, tsX *mat64.Dense, indAccum []int, YhPlattSet map[int]*mat64.Dense, YhPlattSetCalibrated map[int]*mat64.Dense, yPlattSet map[int]*mat64.Dense, iFoldMarker map[int]*mat64.Dense, yPredSet map[int]*mat64.Dense, xSet map[int]*mat64.Dense, rawThres *mat64.Dense)
func BinPredByAlpha ¶
func ComputeAccuracy ¶
func ComputeAupr ¶
func ComputeF1_3 ¶
func DefaultThres ¶
func DistanceTopK ¶
func FeatureDataStack ¶
func FscoreThres ¶
func HyperParameterSet ¶
func IOC_MFADecoding ¶
func LabelRelationship ¶
func MaskZeroByThres ¶
func MultiLabelRecalibrate ¶
func PlattChopScale ¶
chop scale to 0 - 1 range
func PlattParameterEst ¶
func PrintMemUsage ¶
func PrintMemUsage()
func PropagateSet ¶
func PropagateSetWithPrior ¶
func PropagateSetWithPrior(priorData *mat64.Dense, priorGeneID map[string]int, priorIdxToId map[int]string, network *mat64.Dense, trYdata *mat64.Dense, idIdx map[string]int, idxToId map[int]string, idArr []string, trGeneMap map[string]int, isDada bool, alpha float64, wg *sync.WaitGroup, mutex *sync.Mutex) (sPriorData *mat64.Dense, ind []int)
func QuantileNorm ¶
func RandListFromUniDist ¶
func ReadIDfile ¶
func ReadNetwork ¶
func ReadNetworkPropagate ¶
func ReadNetworkPropagateCV ¶
func ReadNetworkPropagateCV(f int, folds map[int][]int, trRowName []string, tsRowName []string, trYdata *mat64.Dense, inNetworkFile []string, priorMatrixFile []string, isAddPrior bool, isDada bool, alpha float64, wg *sync.WaitGroup, mutex *sync.Mutex) (cvTrain []int, cvTest []int, trXdataCV *mat64.Dense, indAccum []int)
func Report ¶
func Report(tsYdata *mat64.Dense, tsYhat *mat64.Dense, thresData *mat64.Dense, rankCut int, isVerbose bool) (microF1 float64, accuracy float64, macroAupr float64, microAupr float64, kPrec float64, firstAupr float64)
func Report(tsYdata *mat64.Dense, tsYhat *mat64.Dense, rebaData *mat64.Dense, rankCut int, isVerbose bool) (microF1 float64, accuracy float64, macroAupr float64, microAupr float64) {
func RescaleData ¶
func SelectPlattAB ¶
func Single_compute ¶
func SoftThresScale ¶
func SubSetTrain ¶
func TestDataPlattChopScale ¶
chop scale to 0 - 1 range
func TmmFilterForPlatt ¶
func TrainRLS_Regress_CG ¶
func TuneAndPredict ¶
func TuneAndPredict(nFold int, fBetaThres float64, nK int, nKnn int, isFirst bool, isKnn bool, kSet []int, lamdaSet []float64, reg bool, rankCut int, trainFold []CvFold, testFold []CvFold, indAccum []int, tsXdata *mat64.Dense, tsYdata *mat64.Dense, trXdata *mat64.Dense, trYdata *mat64.Dense, trainMeasure *mat64.Dense, testMeasure *mat64.Dense, posLabelRls *mat64.Dense, negLabelRls *mat64.Dense, wg *sync.WaitGroup, mutex *sync.Mutex) (trainMeasureUpdated *mat64.Dense, testMeasureUpdated *mat64.Dense, tsYhat *mat64.Dense, thres *mat64.Dense, Yhat *mat64.Dense, YhatCalibrated *mat64.Dense, Ylabel *mat64.Dense)
func WriteNetwork ¶
func WriteOutputFiles ¶
func YhPlattSetUpdate ¶
Types ¶
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
Model contains a pointer to C's struct model (i.e., `*C.struct_model`). It is returned after training and used for predicting.
func Train ¶
func Train(X, y *mat64.Dense, bias float64, solverType int, c_, p, eps float64, classWeights map[int]float64) *Model
Wrapper for the `train` function in liblinear.
`model* train(const struct problem *prob, const struct parameter *param);`
The explanation of parameters are:
solverType:
for multi-class classification 0 -- L2-regularized logistic regression (primal) 1 -- L2-regularized L2-loss support vector classification (dual) 2 -- L2-regularized L2-loss support vector classification (primal) 3 -- L2-regularized L1-loss support vector classification (dual) 4 -- support vector classification by Crammer and Singer 5 -- L1-regularized L2-loss support vector classification 6 -- L1-regularized logistic regression 7 -- L2-regularized logistic regression (dual) for regression 11 -- L2-regularized L2-loss support vector regression (primal) 12 -- L2-regularized L2-loss support vector regression (dual) 13 -- L2-regularized L1-loss support vector regression (dual)
eps is the stopping criterion.
C_ is the cost of constraints violation.
p is the sensitiveness of loss of support vector regression.
classWeights is a map from int to float64, with the key be the class and the value be the weight. For example, {1: 10, -1: 0.5} means giving weight=10 for class=1 while weight=0.5 for class=-1
If you do not want to change penalty for any of the classes, just set classWeights to nil.