November 2018
Intermediate to advanced
300 pages
7h 42m
English
Now, let's take a closer look at the evaluation function. The evaluation function accepts an initialized model, cross-validates the model on all three problems, and reports the results as an area under the ROC curve (AUC), as follows:
public static double[] evaluate(Classifier model) throws Exception {
double results[] = new double[4];
String[] labelFiles = new String[]{
"churn", "appetency", "upselling"};
double overallScore = 0.0;
for (int i = 0; i < labelFiles.length; i++) {
First, we call the Instance loadData(String, String) function that we implemented earlier to load the training data and merge it with the selected labels:
// Load data Instances train_data = loadData( path + "orange_small_train.data", path+"orange_small_train_"+labelFiles[i]+".labels.txt"); ...