本文整理汇总了Java中weka.associations.Apriori类的典型用法代码示例。如果您正苦于以下问题:Java Apriori类的具体用法?Java Apriori怎么用?Java Apriori使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Apriori类属于weka.associations包,在下文中一共展示了Apriori类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: buildAssociate
import weka.associations.Apriori; //导入依赖的package包/类
public static String buildAssociate() throws Exception {
InstanceQuery query = new InstanceQuery();
query.setUsername("root");
query.setPassword("cs6310");
query.setDatabaseURL("jdbc:mysql://localhost/system?#characterEncoding=UTF-8");
query.setQuery("select * from courses_sessions;");
// You can declare that your data set is sparse
// query.setSparseData(true);
Instances data = query.retrieveInstances();
data.setClassIndex(data.numAttributes() - 1);
final NumericToNominal filter = new NumericToNominal();
filter.setInputFormat(data);
data = Filter.useFilter(data, filter);
if (data.size() > 0) {
// build associator
Apriori apriori = new Apriori();
apriori.setClassIndex(data.classIndex());
apriori.buildAssociations(data);
return String.valueOf(apriori);
} else {
return "Not enough data provided";
}
}
开发者ID:ejesposito,项目名称:CS6310O01,代码行数:26,代码来源:WekaDataMiner.java
示例2: getClassifierClassName
import weka.associations.Apriori; //导入依赖的package包/类
/**
* Get classifier's class name by a short name
* */
public static String getClassifierClassName(String classifierName) {
String className = "";
switch (classifierName) {
case "SGD":
className = SGD.class.toString();
break;
case "SGDText":
className = SGDText.class.toString();
break;
case "J48":
className = J48.class.toString();
break;
case "PART":
className = PART.class.toString();
break;
case "NaiveBayes":
className = NaiveBayes.class.toString();
break;
case "NBUpdateable":
className = NaiveBayesUpdateable.class.toString();
break;
case "AdaBoostM1":
className = AdaBoostM1.class.toString();
break;
case "LogitBoost":
className = LogitBoost.class.toString();
break;
case "Bagging":
className = Bagging.class.toString();
break;
case "Stacking":
className = Stacking.class.toString();
break;
case "AdditiveRegression":
className = AdditiveRegression.class.toString();
break;
case "Apriori":
className = Apriori.class.toString();
break;
default:
className = SGD.class.toString();
}
className = className.substring(6);
return className;
}
开发者ID:Eyasics,项目名称:recon,代码行数:49,代码来源:Util.java
示例3: main
import weka.associations.Apriori; //导入依赖的package包/类
public static void main(String args[]) throws Exception {
// load data
Instances data = new Instances(new BufferedReader(new FileReader("data/supermarket.arff")));
// build model
Apriori model = new Apriori();
model.buildAssociations(data);
System.out.println(model);
FPGrowth fpgModel = new FPGrowth();
fpgModel.buildAssociations(data);
System.out.println(fpgModel);
}
开发者ID:PacktPublishing,项目名称:Machine-Learning-End-to-Endguide-for-Java-developers,代码行数:15,代码来源:Supermarket.java
示例4: generateRule
import weka.associations.Apriori; //导入依赖的package包/类
public void generateRule(){
apriori = new Apriori();
try {
// apriori.setNumRules(20);
apriori.buildAssociations(superMarket);
System.out.println(apriori);
} catch (Exception e) {
}
}
开发者ID:PacktPublishing,项目名称:Java-Data-Science-Cookbook,代码行数:10,代码来源:WekaAssociationRuleTest.java
示例5: DataMiningControl
import weka.associations.Apriori; //导入依赖的package包/类
public DataMiningControl() {
this.selectedTag = new SelectedTag(0, Apriori.TAGS_SELECTION); //confiddence ref weka.Apriori.
this.minMetric = Constantes.CONFIANCA_MIN_PADRAO;
this.minSup = Constantes.SUPORTE_MIN_PADRAO;
this.verboseMode = Constantes.VERBOSE_MODE;
this.maxRules = Constantes.MAX_RULES;
}
开发者ID:gems-uff,项目名称:oceano,代码行数:8,代码来源:DataMiningControl.java
示例6: getPossibleMetricTypes
import weka.associations.Apriori; //导入依赖的package包/类
public static String[] getPossibleMetricTypes() {
String[] metricTypes = new String[Apriori.TAGS_SELECTION.length];
for (int i = 0; i < metricTypes.length; i++) {
metricTypes[i] = Apriori.TAGS_SELECTION[i].getReadable();
}
return metricTypes;
}
开发者ID:gems-uff,项目名称:oceano,代码行数:9,代码来源:DataMiningControl.java
示例7: setMetricType
import weka.associations.Apriori; //导入依赖的package包/类
public void setMetricType(int tagID) {
try {
TAGS_SELECTION[tagID].getID();
} catch (ArrayIndexOutOfBoundsException ex) {
throw new RuntimeException("TagId not known. Metric's TagId type must be one of: 0, 1, 2, 3");
}
this.setSelectedTag(new SelectedTag(tagID, Apriori.TAGS_SELECTION));
}
开发者ID:gems-uff,项目名称:oceano,代码行数:9,代码来源:DataMiningControl.java
注:本文中的weka.associations.Apriori类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论