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


Java KohonenNet.setTrainingRounds方法代码示例

本文整理汇总了Java中com.rapidminer.tools.math.som.KohonenNet.setTrainingRounds方法的典型用法代码示例。如果您正苦于以下问题:Java KohonenNet.setTrainingRounds方法的具体用法?Java KohonenNet.setTrainingRounds怎么用?Java KohonenNet.setTrainingRounds使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.rapidminer.tools.math.som.KohonenNet的用法示例。


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

示例1: prepareSOM

import com.rapidminer.tools.math.som.KohonenNet; //导入方法依赖的package包/类
private KohonenNet prepareSOM(ExampleSet exampleSet, int netDimensions, int netSize, int trainingRounds,
		double learningRateStart, double learningRateEnd, double adaptionRadiusStart, double adaptionRadiusEnd)
		throws ProcessStoppedException {
	// generating data for SOM
	int dataDimension;
	RandomDataContainer data = new RandomDataContainer();
	synchronized (exampleSet) {
		Iterator<Example> iterator = exampleSet.iterator();
		dataDimension = exampleSet.getAttributes().size();
		while (iterator.hasNext()) {
			data.addData(getDoubleArrayFromExample(iterator.next()));
			this.checkForStop();
		}
	}
	// generating SOM
	KohonenNet net = new KohonenNet(data);
	RitterAdaptation adaptionFunction = new RitterAdaptation();
	adaptionFunction.setAdaptationRadiusStart(adaptionRadiusStart);
	adaptionFunction.setAdaptationRadiusEnd(adaptionRadiusEnd);
	adaptionFunction.setLearnRateStart(learningRateStart);
	adaptionFunction.setLearnRateEnd(learningRateEnd);
	net.setAdaptationFunction(adaptionFunction);
	int[] dimensions = new int[netDimensions];
	for (int i = 0; i < netDimensions; i++) {
		dimensions[i] = netSize;
	}
	net.init(dataDimension, dimensions, false);
	// train SOM
	net.setTrainingRounds(trainingRounds);
	this.checkForStop();
	net.train(this);
	return net;
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:34,代码来源:SOMDimensionalityReduction.java

示例2: prepareSOM

import com.rapidminer.tools.math.som.KohonenNet; //导入方法依赖的package包/类
private KohonenNet prepareSOM(ExampleSet exampleSet, int netDimensions, int netSize, int trainingRounds, double learningRateStart, double learningRateEnd, double adaptionRadiusStart, double adaptionRadiusEnd) {
	// generating data for SOM
	int dataDimension;
	RandomDataContainer data = new RandomDataContainer();
	synchronized (exampleSet) {
		Iterator<Example> iterator = exampleSet.iterator();
		dataDimension = exampleSet.getAttributes().size();
		while (iterator.hasNext()) {
			data.addData(getDoubleArrayFromExample(iterator.next()));
		}
	}

	// generating SOM
	KohonenNet net = new KohonenNet(data);
	RitterAdaptation adaptionFunction = new RitterAdaptation();
	adaptionFunction.setAdaptationRadiusStart(adaptionRadiusStart);
	adaptionFunction.setAdaptationRadiusEnd(adaptionRadiusEnd);
	adaptionFunction.setLearnRateStart(learningRateStart);
	adaptionFunction.setLearnRateEnd(learningRateEnd);
	net.setAdaptationFunction(adaptionFunction);
	int[] dimensions = new int[netDimensions];
	for (int i = 0; i < netDimensions; i++)
		dimensions[i] = netSize;
	net.init(dataDimension, dimensions, false);
	// train SOM
	net.setTrainingRounds(trainingRounds);
	net.train();
	return net;
}
 
开发者ID:rapidminer,项目名称:rapidminer-5,代码行数:30,代码来源:SOMDimensionalityReduction.java

示例3: prepareSOM

import com.rapidminer.tools.math.som.KohonenNet; //导入方法依赖的package包/类
public void prepareSOM(DataTable dataTable, double adaptationRadius, int trainRounds, boolean threadMode) {
	// reseting Data already applied flag
	examplesApplied = false;
	// generating data for SOM
	int dataDimension = 0;
	synchronized (dataTable) {
		Iterator iterator = dataTable.iterator();
		dataDimension = dataTable.getNumberOfColumns() - dataTable.getNumberOfSpecialColumns();

		iterator = dataTable.iterator();
		while (iterator.hasNext()) {
			data.addData(getDoubleArrayFromRow((DataTableRow) iterator.next(), dataTable));
		}
	}
	// generating SOM
	net = new KohonenNet(data);
	RitterAdaptation adaptationFunction = new RitterAdaptation();
	adaptationFunction.setAdaptationRadiusStart(adaptationRadius);
	adaptationFunction.setLearnRateStart(0.8);
	net.setAdaptationFunction(adaptationFunction);
	net.init(dataDimension, dimensions, false);

	net.setTrainingRounds(trainRounds);

	// train SOM
	if (threadMode) {
		// registering this as ProgressListener
		net.addProgressListener(this);
		Thread trainThread = new Thread() {
			@Override
			public void run() {
				net.train();
			}
		};			
		trainThread.start();
	} else {
		net.train();
		createMatrices();
		try {
			// necessary for preventing graphical errors in reporting
			Thread.sleep(1000);
		} catch (InterruptedException e) {
			// do nothing
		}
	}
}
 
开发者ID:rapidminer,项目名称:rapidminer-5,代码行数:47,代码来源:SOMPlotter.java


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