• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java Apriori类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ColumnFamilySplit类代码示例发布时间:2022-05-22
下一篇:
Java ParsedOutput类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap