当前位置: 首页>>代码示例>>Java>>正文


Java HierarchicalClusterModel类代码示例

本文整理汇总了Java中com.rapidminer.operator.clustering.HierarchicalClusterModel的典型用法代码示例。如果您正苦于以下问题:Java HierarchicalClusterModel类的具体用法?Java HierarchicalClusterModel怎么用?Java HierarchicalClusterModel使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


HierarchicalClusterModel类属于com.rapidminer.operator.clustering包,在下文中一共展示了HierarchicalClusterModel类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: TopDownClustering

import com.rapidminer.operator.clustering.HierarchicalClusterModel; //导入依赖的package包/类
public TopDownClustering(OperatorDescription description) {
	super(description, "Clustering Process");

	exampleSetInput.addPrecondition(new SimplePrecondition(exampleSetInput, new ExampleSetMetaData()));
	getTransformer().addRule(new PassThroughRule(exampleSetInput, exampleSetInnerSource, false));

	getTransformer().addRule(new SubprocessTransformRule(getSubprocess(0)));
	modelInnerSink.addPrecondition(new SimplePrecondition(modelInnerSink, new MetaData(ClusterModel.class)));

	getTransformer().addRule(new ExampleSetPassThroughRule(exampleSetInput, exampleSetOutput, SetRelation.EQUAL) {

		@Override
		public ExampleSetMetaData modifyExampleSet(ExampleSetMetaData metaData) {
			if (addsClusterAttribute()) {
				metaData.addAttribute(new AttributeMetaData(Attributes.CLUSTER_NAME, Ontology.NOMINAL,
						Attributes.CLUSTER_NAME));
			}
			MetaDataTools.checkAndCreateIds(metaData);
			return metaData;
		}
	});
	getTransformer().addRule(new GenerateNewMDRule(modelOutput, new MetaData(HierarchicalClusterModel.class)));
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:24,代码来源:TopDownClustering.java

示例2: AgglomerativeClustering

import com.rapidminer.operator.clustering.HierarchicalClusterModel; //导入依赖的package包/类
public AgglomerativeClustering(OperatorDescription description) {
	super(description);

	exampleSetInput.addPrecondition(new DistanceMeasurePrecondition(exampleSetInput, this));
	exampleSetInput.addPrecondition(new CapabilityPrecondition(this, exampleSetInput));

	getTransformer().addRule(new GenerateNewMDRule(modelOutput, new MetaData(HierarchicalClusterModel.class)));
	getTransformer().addRule(new ExampleSetPassThroughRule(exampleSetInput, exampleSetOutput, SetRelation.EQUAL) {

		@Override
		public ExampleSetMetaData modifyExampleSet(ExampleSetMetaData metaData) {
			metaData.addAttribute(new AttributeMetaData(Attributes.ID_NAME, Ontology.INTEGER, Attributes.ID_NAME));
			return metaData;
		}
	});
}
 
开发者ID:rapidminer,项目名称:rapidminer-studio,代码行数:17,代码来源:AgglomerativeClustering.java

示例3: TopDownClustering

import com.rapidminer.operator.clustering.HierarchicalClusterModel; //导入依赖的package包/类
public TopDownClustering(OperatorDescription description) {
	super(description, "Clustering Process");

	exampleSetInput.addPrecondition(new SimplePrecondition(exampleSetInput, new ExampleSetMetaData()));
	getTransformer().addRule(new PassThroughRule(exampleSetInput, exampleSetInnerSource, false));

	getTransformer().addRule(new SubprocessTransformRule(getSubprocess(0)));
	modelInnerSink.addPrecondition(new SimplePrecondition(modelInnerSink, new MetaData(ClusterModel.class)));

	getTransformer().addRule(new ExampleSetPassThroughRule(exampleSetInput, exampleSetOutput, SetRelation.EQUAL) {

		@Override
		public ExampleSetMetaData modifyExampleSet(ExampleSetMetaData metaData) {
			if (addsClusterAttribute()) {
				metaData.addAttribute(
						new AttributeMetaData(Attributes.CLUSTER_NAME, Ontology.NOMINAL, Attributes.CLUSTER_NAME));
			}
			MetaDataTools.checkAndCreateIds(metaData);
			return metaData;
		}
	});
	getTransformer().addRule(new GenerateNewMDRule(modelOutput, new MetaData(HierarchicalClusterModel.class)));
}
 
开发者ID:rapidminer,项目名称:rapidminer-studio,代码行数:24,代码来源:TopDownClustering.java

示例4: TopDownClustering

import com.rapidminer.operator.clustering.HierarchicalClusterModel; //导入依赖的package包/类
public TopDownClustering(OperatorDescription description) {
	super(description, "Clustering Process");

	exampleSetInput.addPrecondition(new SimplePrecondition(exampleSetInput, new ExampleSetMetaData()));
	getTransformer().addRule(new PassThroughRule(exampleSetInput, exampleSetInnerSource, false));

	getTransformer().addRule(new SubprocessTransformRule(getSubprocess(0)));
	modelInnerSink.addPrecondition(new SimplePrecondition(modelInnerSink, new MetaData(ClusterModel.class)));

	getTransformer().addRule(new ExampleSetPassThroughRule(exampleSetInput, exampleSetOutput, SetRelation.EQUAL) {
		@Override
		public ExampleSetMetaData modifyExampleSet(ExampleSetMetaData metaData) {
			if (addsClusterAttribute()) {
				metaData.addAttribute(new AttributeMetaData(Attributes.CLUSTER_NAME, Ontology.NOMINAL, Attributes.CLUSTER_NAME));
			}
			MetaDataTools.checkAndCreateIds(metaData);
			return metaData;
		}
	});
	getTransformer().addRule(new GenerateNewMDRule(modelOutput, new MetaData(HierarchicalClusterModel.class)));
}
 
开发者ID:rapidminer,项目名称:rapidminer-5,代码行数:22,代码来源:TopDownClustering.java

示例5: AgglomerativeClustering

import com.rapidminer.operator.clustering.HierarchicalClusterModel; //导入依赖的package包/类
public AgglomerativeClustering(OperatorDescription description) {
	super(description);

	exampleSetInput.addPrecondition(new DistanceMeasurePrecondition(exampleSetInput, this));

	getTransformer().addRule(new GenerateNewMDRule(modelOutput, new MetaData(HierarchicalClusterModel.class)));
	getTransformer().addRule(new ExampleSetPassThroughRule(exampleSetInput, exampleSetOutput, SetRelation.EQUAL) {

		@Override
		public ExampleSetMetaData modifyExampleSet(ExampleSetMetaData metaData) {
			metaData.addAttribute(new AttributeMetaData(Attributes.ID_NAME, Ontology.INTEGER, Attributes.ID_NAME));
			return metaData;
		}
	});
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:16,代码来源:AgglomerativeClustering.java

示例6: doWork

import com.rapidminer.operator.clustering.HierarchicalClusterModel; //导入依赖的package包/类
@Override
public void doWork() throws OperatorException {
	ExampleSet exampleSet = exampleSetInput.getData(ExampleSet.class);
	int maxLeafSize = getParameterAsInt(PARAMETER_MAX_LEAF_SIZE);

	// additional checks
	Tools.checkAndCreateIds(exampleSet);
	Tools.onlyNonMissingValues(exampleSet, getOperatorClassName(), this, new String[0]);

	// recursively descend until leaf_size smaller than max_leaf_size
	HierarchicalClusterNode root = new HierarchicalClusterNode("root");
	HierarchicalClusterModel model = new HierarchicalClusterModel(root);
	int createdLeafs = descend(exampleSet, root, 0, maxLeafSize, getParameterAsInt(PARAMETER_MAX_DEPTH) - 1);

	if (getParameterAsBoolean(PARAMETER_CREATE_CLUSTER_LABEL) && exampleSetOutput.isConnected()) {
		try {
			FlattenClusterModel flattener = OperatorService.createOperator(FlattenClusterModel.class);
			flattener.setParameter(FlattenClusterModel.PARAMETER_NUMBER_OF_CLUSTER, createdLeafs + "");
			ClusterModel flatModel = flattener.flatten(model, exampleSet);
			ClusterModel2ExampleSet applier = OperatorService.createOperator(ClusterModel2ExampleSet.class);
			ExampleSet labelledExampleSet = applier.addClusterAttribute(exampleSet, flatModel);
			exampleSetOutput.deliver(labelledExampleSet);
			modelOutput.deliver(model);
		} catch (OperatorCreationException e) {
			throw new OperatorException("Could not create FlattenClusterModel Operator: " + e, e);
		}
	} else {
		Attribute clusterAttribute = exampleSet.getAttributes().getCluster();
		if (clusterAttribute != null) {
			exampleSet.getAttributes().remove(clusterAttribute);
		}
		exampleSetOutput.deliver(exampleSet);
		modelOutput.deliver(model);
	}
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:36,代码来源:TopDownClustering.java

示例7: getVisualizationComponent

import com.rapidminer.operator.clustering.HierarchicalClusterModel; //导入依赖的package包/类
@Override
public Component getVisualizationComponent(Object renderable, IOContainer ioContainer) {
	HierarchicalClusterModel cm = (HierarchicalClusterModel) renderable;

	JPanel panel = new JPanel(new BorderLayout());
	JPanel innerPanel = new JPanel(new BorderLayout());
	innerPanel.add(new DendrogramPlotter(cm));
	innerPanel.setBorder(BorderFactory.createMatteBorder(10, 10, 5, 5, Colors.WHITE));
	panel.add(innerPanel, BorderLayout.CENTER);

	return panel;
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:13,代码来源:ClusterModelDendogrammRenderer.java

示例8: createReportable

import com.rapidminer.operator.clustering.HierarchicalClusterModel; //导入依赖的package包/类
@Override
public Reportable createReportable(Object renderable, IOContainer ioContainer, int width, int height) {
	HierarchicalClusterModel cm = (HierarchicalClusterModel) renderable;
	DendrogramPlotter plotter = new DendrogramPlotter(cm);
	plotter.setSize(width, height);
	return plotter;
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:8,代码来源:ClusterModelDendogrammRenderer.java

示例9: getGraphCreator

import com.rapidminer.operator.clustering.HierarchicalClusterModel; //导入依赖的package包/类
@Override
public GraphCreator<String, String> getGraphCreator(Object renderable, IOContainer ioContainer) {
	if (renderable instanceof HierarchicalClusterModel) {
		return new ClusterModelGraphCreator((HierarchicalClusterModel) renderable);
	} else if (renderable instanceof ClusterModel) {
		return new ClusterModelGraphCreator((ClusterModel) renderable);
	} else {
		return null;
	}
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:11,代码来源:ClusterModelGraphRenderer.java

示例10: DendrogramPlotter

import com.rapidminer.operator.clustering.HierarchicalClusterModel; //导入依赖的package包/类
public DendrogramPlotter(HierarchicalClusterModel hcm) {
	super(hcm, "dendogram_view");
	this.hcm = hcm;

	numObjects = hcm.getRootNode().getNumberOfExamplesInSubtree();
	minDistance = Double.POSITIVE_INFINITY;
	maxDistance = Double.NEGATIVE_INFINITY;
	findMinMaxDistance(hcm.getRootNode());
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:10,代码来源:DendrogramPlotter.java

示例11: ClusterTreeVisualization

import com.rapidminer.operator.clustering.HierarchicalClusterModel; //导入依赖的package包/类
public ClusterTreeVisualization(HierarchicalClusterModel cm) {
	DefaultTreeModel model = new DefaultTreeModel(generateTreeModel(cm.getRootNode()));
	setModel(model);
	addTreeSelectionListener(this);
	this.clusterModel = cm;
	setBackgroundWhite();
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:8,代码来源:ClusterTreeVisualization.java

示例12: doWork

import com.rapidminer.operator.clustering.HierarchicalClusterModel; //导入依赖的package包/类
@Override
public void doWork() throws OperatorException {
	ExampleSet exampleSet = exampleSetInput.getData(ExampleSet.class);
	int maxLeafSize = getParameterAsInt(PARAMETER_MAX_LEAF_SIZE);

	// additional checks
	Tools.checkAndCreateIds(exampleSet);
	Tools.onlyNonMissingValues(exampleSet, getOperatorClassName(), this, new String[0]);

	// recursively descend until leaf_size smaller than max_leaf_size
	HierarchicalClusterNode root = new HierarchicalClusterNode("root");
	HierarchicalClusterModel model = new HierarchicalClusterModel(root);
	int createdLeafs = descend(exampleSet, root, 0, maxLeafSize, getParameterAsInt(PARAMETER_MAX_DEPTH) - 1,
			getProgress());

	if (getParameterAsBoolean(PARAMETER_CREATE_CLUSTER_LABEL) && exampleSetOutput.isConnected()) {
		try {
			FlattenClusterModel flattener = OperatorService.createOperator(FlattenClusterModel.class);
			flattener.setParameter(FlattenClusterModel.PARAMETER_NUMBER_OF_CLUSTER, createdLeafs + "");
			ClusterModel flatModel = flattener.flatten(model, exampleSet);
			ClusterModel2ExampleSet applier = OperatorService.createOperator(ClusterModel2ExampleSet.class);
			ExampleSet labelledExampleSet = applier.addClusterAttribute(exampleSet, flatModel);
			exampleSetOutput.deliver(labelledExampleSet);
			modelOutput.deliver(model);
		} catch (OperatorCreationException e) {
			throw new OperatorException("Could not create FlattenClusterModel Operator: " + e, e);
		}
	} else {
		Attribute clusterAttribute = exampleSet.getAttributes().getCluster();
		if (clusterAttribute != null) {
			exampleSet.getAttributes().remove(clusterAttribute);
		}
		exampleSetOutput.deliver(exampleSet);
		modelOutput.deliver(model);
	}
}
 
开发者ID:rapidminer,项目名称:rapidminer-studio,代码行数:37,代码来源:TopDownClustering.java

示例13: AgglomerativeClustering

import com.rapidminer.operator.clustering.HierarchicalClusterModel; //导入依赖的package包/类
public AgglomerativeClustering(OperatorDescription description) {
	super(description);
	
	exampleSetInput.addPrecondition(new DistanceMeasurePrecondition(exampleSetInput, this));
	
	getTransformer().addRule(new GenerateNewMDRule(modelOutput, new MetaData(HierarchicalClusterModel.class)));
	getTransformer().addRule(new ExampleSetPassThroughRule(exampleSetInput, exampleSetOutput, SetRelation.EQUAL) {
		@Override
		public ExampleSetMetaData modifyExampleSet(ExampleSetMetaData metaData) {
			metaData.addAttribute(new AttributeMetaData(Attributes.ID_NAME, Ontology.INTEGER, Attributes.ID_NAME));
			return metaData;
		}
	});
}
 
开发者ID:rapidminer,项目名称:rapidminer-5,代码行数:15,代码来源:AgglomerativeClustering.java

示例14: doWork

import com.rapidminer.operator.clustering.HierarchicalClusterModel; //导入依赖的package包/类
@Override
public void doWork() throws OperatorException {
	ExampleSet exampleSet = exampleSetInput.getData(ExampleSet.class);
	int maxLeafSize = getParameterAsInt(PARAMETER_MAX_LEAF_SIZE);

	// additional checks
	Tools.checkAndCreateIds(exampleSet);
	Tools.onlyNonMissingValues(exampleSet, "AgglomerativeClustering");

	// recursively descend until leaf_size smaller than max_leaf_size
	HierarchicalClusterNode root = new HierarchicalClusterNode("root");
	HierarchicalClusterModel model = new HierarchicalClusterModel(root);
	int createdLeafs = descend(exampleSet, root, 0, maxLeafSize, getParameterAsInt(PARAMETER_MAX_DEPTH) - 1);

	if (getParameterAsBoolean(PARAMETER_CREATE_CLUSTER_LABEL) && exampleSetOutput.isConnected()) {
		try {
			FlattenClusterModel flattener = OperatorService.createOperator(FlattenClusterModel.class);
			flattener.setParameter(FlattenClusterModel.PARAMETER_NUMBER_OF_CLUSTER, createdLeafs + "");
			ClusterModel flatModel = flattener.flatten(model, exampleSet);
			ClusterModel2ExampleSet applier = OperatorService.createOperator(ClusterModel2ExampleSet.class);					
			ExampleSet labelledExampleSet = applier.addClusterAttribute(exampleSet, flatModel);
			exampleSetOutput.deliver(labelledExampleSet);
			modelOutput.deliver(model);
		} catch (OperatorCreationException e) {
			throw new OperatorException("Could not create FlattenClusterModel Operator: "+e, e);
		}
	} else {
		Attribute clusterAttribute = exampleSet.getAttributes().getCluster();
		if (clusterAttribute != null) {
			exampleSet.getAttributes().remove(clusterAttribute);
		}
		exampleSetOutput.deliver(exampleSet);
		modelOutput.deliver(model);
	}
}
 
开发者ID:rapidminer,项目名称:rapidminer-5,代码行数:36,代码来源:TopDownClustering.java

示例15: getGraphCreator

import com.rapidminer.operator.clustering.HierarchicalClusterModel; //导入依赖的package包/类
@Override
public GraphCreator<String, String> getGraphCreator(Object renderable, IOContainer ioContainer) {
	if (renderable instanceof HierarchicalClusterModel) {
		return new ClusterModelGraphCreator((HierarchicalClusterModel)renderable);
	} else if (renderable instanceof ClusterModel) {
		return new ClusterModelGraphCreator((ClusterModel)renderable);
	} else {
		return null;
	}
}
 
开发者ID:rapidminer,项目名称:rapidminer-5,代码行数:11,代码来源:ClusterModelGraphRenderer.java


注:本文中的com.rapidminer.operator.clustering.HierarchicalClusterModel类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。