本文整理汇总了Java中weka.classifiers.functions.Logistic类的典型用法代码示例。如果您正苦于以下问题:Java Logistic类的具体用法?Java Logistic怎么用?Java Logistic使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Logistic类属于weka.classifiers.functions包,在下文中一共展示了Logistic类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: buildRegression
import weka.classifiers.functions.Logistic; //导入依赖的package包/类
public void buildRegression(){
logReg = new Logistic();
try {
logReg.buildClassifier(iris);
} catch (Exception e) {
}
System.out.println(logReg);
}
示例2: LearnLogisticRegression
import weka.classifiers.functions.Logistic; //导入依赖的package包/类
@Override
public void LearnLogisticRegression() throws Exception
{
trainedData.setClassIndex(trainedData.numAttributes()-1);
filter=new StringToWordVector();
classifier=new FilteredClassifier();
classifier.setFilter(filter);
classifier.setClassifier(new Logistic());
classifier.buildClassifier(trainedData);
}
开发者ID:unsw-cse-soc,项目名称:Data-curation-API,代码行数:12,代码来源:ExtractClassificationTextLogisticRegressionImpl.java
示例3: EvaluateLogisticRegression
import weka.classifiers.functions.Logistic; //导入依赖的package包/类
@Override
public List<Classification> EvaluateLogisticRegression() throws Exception
{
List<Classification> lstEvaluationDetail=new ArrayList<>();
trainedData.setClassIndex(trainedData.numAttributes()-1);
filter=new StringToWordVector();
classifier=new FilteredClassifier();
classifier.setFilter(filter);
classifier.setClassifier(new Logistic());
Evaluation eval=new Evaluation(trainedData);
eval.crossValidateModel(classifier, trainedData, 4, new Random(1));
/*try
{
for(int i=0;i<10000;i++)
{
cls.setPrecision(eval.precision(i));
cls.setRecall(eval.recall(i));
cls.setAuc(eval.areaUnderPRC(i));
cls.setFMeasure(eval.fMeasure(i));
cls.setFn(eval.falseNegativeRate(i));
cls.setFp(eval.falsePositiveRate(i));
cls.setTn(eval.trueNegativeRate(i));
cls.setTp(eval.truePositiveRate(i));
cls.setMeanAbsoluteError(eval.meanAbsoluteError());
cls.setRelativeAbsoluteError(eval.relativeAbsoluteError());
cls.setCorrect(eval.correct());
cls.setKappa(eval.kappa());
cls.setNumInstances(eval.numInstances());
cls.setInCorrect(eval.incorrect());
lstEvaluationDetail.add(new Classification(cls.getPrecision(),
cls.getRecall(),
cls.getAuc(),
cls.getCorrect(),
cls.getInCorrect(),
cls.getErrorRate(),
cls.getFn(),
cls.getFp(),
cls.getTn(),
cls.getTp(),
cls.getKappa(),
cls.getMeanAbsoluteError(),
cls.getNumInstances(),
cls.getRelativeAbsoluteError(),
cls.getFMeasure()));
}
}
catch(Exception ex)
{
}*/
return lstEvaluationDetail;
}
开发者ID:unsw-cse-soc,项目名称:Data-curation-API,代码行数:53,代码来源:ExtractClassificationTextLogisticRegressionImpl.java
示例4: main
import weka.classifiers.functions.Logistic; //导入依赖的package包/类
public static void main(String[] args){
Logistic lg = new Logistic();
AbstractClassifier.runClassifier(lg, args);
}
示例5: getClassifier
import weka.classifiers.functions.Logistic; //导入依赖的package包/类
/**
* returns the classifier
* @return
*/
public Logistic getClassifier(){
return this.classifier;
}
示例6: getDefaultNominalClassifier
import weka.classifiers.functions.Logistic; //导入依赖的package包/类
/**
* Returns the default nominal classifier.
*
* @return the default
*/
protected Classifier getDefaultNominalClassifier() {
return new Logistic();
}
示例7: LogisticClassifier
import weka.classifiers.functions.Logistic; //导入依赖的package包/类
public LogisticClassifier(String trainFile, String testFile) {
super(trainFile, testFile);
this.cmodel = new Logistic();
}