private String getExportString(String delimiter, String note, VotingScheme votingScheme) { StringBuilder s = new StringBuilder(); String featureModel = this._featureModel; String kernel = _cMode.ToString(); if (_svmConfig != null) { kernel = this._svmConfig.Kernel.ToString(); } ConfusionMatrix cm = null; ReceiverOperatingCharacteristic roc = null; SchemeSumPredictions sumPredictions = null; SchemeMajorityVote majorityVote = null; switch (votingScheme) { case VotingScheme.NONE: { cm = _voter.AggregatedConfusionMatrix; roc = _voter.getROC(); break; } case VotingScheme.ADDITIVE_PREDICTIONS: { sumPredictions = _voter.getSumPredictions(); cm = null; roc = sumPredictions.getROC(); break; } case VotingScheme.MAJORITY_VOTE: { majorityVote = _voter.getMajorityVote(); cm = null; roc = majorityVote.getROC(); break; } } if (votingScheme == VotingScheme.NONE && roc != null && cm != null) { roc.Compute(100); s.Append(featureModel + delimiter); s.Append(votingScheme + delimiter); s.Append(kernel + delimiter); s.Append(note + delimiter); s.Append(this._numRuns + delimiter); s.Append(this._numFolds + delimiter); s.Append(this._timeElapsedMS + delimiter); s.Append(this._memoryUsedBytes + delimiter); s.Append(Utility.formatNumber(Utility.BytesToGB(this._memoryUsedBytes)) + delimiter); s.Append(cm.Samples + delimiter); s.Append(Utility.formatNumber(roc.Area) + delimiter); s.Append(Utility.formatNumber(cm.Sensitivity) + delimiter); s.Append(Utility.formatNumber(cm.Specificity) + delimiter); s.Append(Utility.formatNumber(cm.FalsePositiveRate) + delimiter); s.Append(Utility.formatNumber(cm.FalseDiscoveryRate) + delimiter); s.Append(Utility.formatNumber(cm.Accuracy) + delimiter); s.Append(Utility.formatNumber(cm.PositivePredictiveValue) + delimiter); s.Append(Utility.formatNumber(cm.Precision) + delimiter); s.Append(Utility.formatNumber(cm.Recall) + delimiter); s.Append(Utility.formatNumber(cm.FScore) + delimiter); s.Append(cm.ActualPositives + delimiter); s.Append(cm.ActualNegatives + delimiter); s.Append(cm.TruePositives + delimiter); s.Append(cm.TrueNegatives + delimiter); s.Append(cm.FalsePositives + delimiter); s.Append(cm.FalseNegatives); } else if (votingScheme == VotingScheme.ADDITIVE_PREDICTIONS && sumPredictions != null && roc != null) { roc.Compute(100); s.Append(featureModel + delimiter); s.Append(votingScheme + delimiter); s.Append(kernel + delimiter); s.Append(note + delimiter); s.Append(this._numRuns + delimiter); s.Append(this._numFolds + delimiter); s.Append(this._timeElapsedMS + delimiter); s.Append(this._memoryUsedBytes + delimiter); s.Append(Utility.formatNumber(Utility.BytesToGB(this._memoryUsedBytes)) + delimiter); s.Append(sumPredictions.NumSamples + delimiter); s.Append(Utility.formatNumber(sumPredictions.ROCAreaVoter) + delimiter); s.Append(Utility.formatNumber(sumPredictions.Sensitivity) + delimiter); s.Append(Utility.formatNumber(sumPredictions.Specificity) + delimiter); s.Append(Utility.formatNumber(sumPredictions.FalsePositiveRate) + delimiter); s.Append(Utility.formatNumber(sumPredictions.FalseDiscoveryRate) + delimiter); s.Append(Utility.formatNumber(sumPredictions.Accuracy) + delimiter); s.Append(Utility.formatNumber(sumPredictions.PositivePredictiveValue) + delimiter); s.Append(Utility.formatNumber(sumPredictions.Precision) + delimiter); s.Append(Utility.formatNumber(sumPredictions.Recall) + delimiter); s.Append(Utility.formatNumber(sumPredictions.FScore) + delimiter); s.Append(sumPredictions.ActualPositives + delimiter); s.Append(sumPredictions.ActualNegatives + delimiter); s.Append(sumPredictions.TruePositives + delimiter); s.Append(sumPredictions.TrueNegatives + delimiter); s.Append(sumPredictions.FalsePositives + delimiter); s.Append(sumPredictions.FalseNegatives); } else if (votingScheme == VotingScheme.MAJORITY_VOTE && majorityVote != null && roc != null) { roc.Compute(100); s.Append(featureModel + delimiter); s.Append(votingScheme + delimiter); s.Append(kernel + delimiter); s.Append(note + delimiter); s.Append(this._numRuns + delimiter); s.Append(this._numFolds + delimiter); s.Append(this._timeElapsedMS + delimiter); s.Append(this._memoryUsedBytes + delimiter); s.Append(Utility.formatNumber(Utility.BytesToGB(this._memoryUsedBytes)) + delimiter); s.Append(majorityVote.NumSamples + delimiter); s.Append(Utility.formatNumber(majorityVote.ROCAreaVoter) + delimiter); s.Append(Utility.formatNumber(majorityVote.Sensitivity) + delimiter); s.Append(Utility.formatNumber(majorityVote.Specificity) + delimiter); s.Append(Utility.formatNumber(majorityVote.FalsePositiveRate) + delimiter); s.Append(Utility.formatNumber(majorityVote.FalseDiscoveryRate) + delimiter); s.Append(Utility.formatNumber(majorityVote.Accuracy) + delimiter); s.Append(Utility.formatNumber(majorityVote.PositivePredictiveValue) + delimiter); s.Append(Utility.formatNumber(majorityVote.Precision) + delimiter); s.Append(Utility.formatNumber(majorityVote.Recall) + delimiter); s.Append(Utility.formatNumber(majorityVote.FScore) + delimiter); s.Append(majorityVote.ActualPositives + delimiter); s.Append(majorityVote.ActualNegatives + delimiter); s.Append(majorityVote.TruePositives + delimiter); s.Append(majorityVote.TrueNegatives + delimiter); s.Append(majorityVote.FalsePositives + delimiter); s.Append(majorityVote.FalseNegatives); } return(s.ToString()); }
internal SchemeMajorityVote getMajorityVote() { SchemeMajorityVote scheme = new SchemeMajorityVote(_totalClassification); return(scheme); }