本文整理汇总了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;
}
示例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;
}
示例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
}
}
}