}
// copy full model for output
SerializedObject so = new SerializedObject(clusterer);
fullClusterer = (Clusterer) so.getObject();
ClusterEvaluation eval = new ClusterEvaluation();
eval.setClusterer(clusterer);
switch (testMode) {
case 3: case 5: // Test on training
m_Log.statusMessage(Messages.getInstance().getString("ClustererPanel_StartClusterer_Run_Log_StatusMessage_Third"));
eval.evaluateClusterer(trainInst, "", false);
predData = setUpVisualizableInstances(inst,eval);
outBuff.append(Messages.getInstance().getString("ClustererPanel_StartClusterer_Run_OutBuffer_Text_TwentySecond"));
break;
case 2: // Percent split
m_Log.statusMessage(Messages.getInstance().getString("ClustererPanel_StartClusterer_Run_Log_StatusMessage_Fourth"));
inst.randomize(new Random(1));
trainInst.randomize(new Random(1));
int trainSize = trainInst.numInstances() * percent / 100;
int testSize = trainInst.numInstances() - trainSize;
Instances train = new Instances(trainInst, 0, trainSize);
Instances test = new Instances(trainInst, trainSize, testSize);
Instances testVis = new Instances(inst, trainSize, testSize);
m_Log.statusMessage(Messages.getInstance().getString("ClustererPanel_StartClusterer_Run_Log_StatusMessage_Fifth"));
trainTimeStart = System.currentTimeMillis();
clusterer.buildClusterer(train);
trainTimeElapsed = System.currentTimeMillis() - trainTimeStart;
m_Log.statusMessage(Messages.getInstance().getString("ClustererPanel_StartClusterer_Run_Log_StatusMessage_Sixth"));
eval.evaluateClusterer(test, "", false);
predData = setUpVisualizableInstances(testVis, eval);
outBuff.append(Messages.getInstance().getString("ClustererPanel_StartClusterer_Run_OutBuffer_Text_TwentyThird"));
outBuff.append(clusterer.toString() + '\n');
outBuff.append(Messages.getInstance().getString("ClustererPanel_StartClusterer_Run_OutBuffer_Text_TimeTakenPercentage") +
Utils.doubleToString(trainTimeElapsed / 1000.0,2)
+ " " + Messages.getInstance().getString("ClassifierPanel_StartClassifier_OutBuffer_Text_TwentyNineth"));
break;
case 4: // Test on user split
m_Log.statusMessage(Messages.getInstance().getString("ClustererPanel_StartClusterer_Run_Log_StatusMessage_Seventh"));
Instances userTestT = new Instances(userTest);
if (!m_ignoreKeyList.isSelectionEmpty()) {
userTestT = removeIgnoreCols(userTestT);
}
eval.evaluateClusterer(userTestT, "", false);
predData = setUpVisualizableInstances(userTest, eval);
outBuff.append(Messages.getInstance().getString("ClustererPanel_StartClusterer_Run_OutBuffer_Text_TwentyFourth"));
break;
default:
throw new Exception(Messages.getInstance().getString("ClustererPanel_StartClusterer_Run_Exception_Text_Sixth"));
}
outBuff.append(eval.clusterResultsToString());
outBuff.append("\n");
m_History.updateResult(name);
m_Log.logMessage(Messages.getInstance().getString("ClustererPanel_StartClusterer_Run_Log_LogMessage_Text_Third") + cname);
m_Log.statusMessage(Messages.getInstance().getString("ClustererPanel_StartClusterer_Run_Log_StatusMessage_Eighth"));
} catch (Exception ex) {