本文整理汇总了Java中weka.clusterers.FilteredClusterer类的典型用法代码示例。如果您正苦于以下问题:Java FilteredClusterer类的具体用法?Java FilteredClusterer怎么用?Java FilteredClusterer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
FilteredClusterer类属于weka.clusterers包,在下文中一共展示了FilteredClusterer类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createClusterer
import weka.clusterers.FilteredClusterer; //导入依赖的package包/类
/**
*
* @param trainingData
* @param round
* @throws Exception
*/
protected AbstractClusterer createClusterer(MarkovAttributeSet aset, Instances trainingData) throws Exception {
if (trace.val) LOG.trace(String.format("Clustering %d %s instances with %d attributes", trainingData.numInstances(), CatalogUtil.getDisplayName(catalog_proc), aset.size()));
// Create the filter we need so that we only include the attributes in the given MarkovAttributeSet
Filter filter = aset.createFilter(trainingData);
// Using our training set to build the clusterer
int seed = this.rand.nextInt();
// SimpleKMeans inner_clusterer = new SimpleKMeans();
EM inner_clusterer = new EM();
String options[] = {
"-N", Integer.toString(1000), // num_partitions),
"-S", Integer.toString(seed),
"-I", Integer.toString(100),
};
inner_clusterer.setOptions(options);
FilteredClusterer filtered_clusterer = new FilteredClusterer();
filtered_clusterer.setFilter(filter);
filtered_clusterer.setClusterer(inner_clusterer);
AbstractClusterer clusterer = filtered_clusterer;
clusterer.buildClusterer(trainingData);
return (clusterer);
}