public class Result extends Object implements Serializable
Jesse Read, Bernhard Pfahringer, Geoff Holmes, Eibe Frank. Classifier Chains for Multi-label Classification. Machine Learning Journal. Springer (2011).
Jesse Read, Scalable Multi-label Classification. PhD Thesis, University of Waikato, Hamilton, New Zealand (2010).
Modifier and Type | Field and Description |
---|---|
ArrayList<int[]> |
actuals |
HashMap<String,String> |
info |
int |
L
The number of label (target) variables in the problem
|
HashMap<String,String> |
model |
HashMap<String,Object> |
output |
ArrayList<double[]> |
predictions |
HashMap<String,Object> |
vals |
Constructor and Description |
---|
Result() |
Result(int L) |
Result(int N,
int L) |
Modifier and Type | Method and Description |
---|---|
void |
addResult(double[] pred,
weka.core.Instance real)
AddResult - Add an entry.
|
double[][] |
allPredictions()
AllPredictions - Retrieve all prediction confidences in an L * N matrix (2d array).
|
int[][] |
allPredictions(double t)
AllPredictions - Retrieve all predictions (according to threshold t) in an L * N matrix.
|
int[][] |
allTrueValues()
AllTrueValues - Retrieve all true values in an L x N matrix.
|
Set<String> |
availableMetrics()
Return the set of metrics for which measurements are available.
|
double[] |
colConfidence(int j)
ColConfidence - Retrieve the prediction confidences for the j-th label (column).
|
String |
getInfo(String cat)
GetInfo.
|
Object |
getMeasurement(String metric)
Retrieve the measurement for metric 'metric'.
|
String |
getModel(String key)
Get the model value.
|
static weka.core.Instances |
getPredictionsAsInstances(Result result)
Convert predictions into Instances (and true values).
|
static String |
getResultAsString(Result s)
GetResultAsString - print out each prediction in a Result along with its true labelset.
|
static String |
getResultAsString(Result result,
int adp)
GetResultAsString - print out each prediction in a Result (to a certain number of decimal points) along with its true labelset.
|
static weka.core.Instances |
getResultsAsInstances(ArrayList<HashMap<String,Object>> metrics)
Convert a list of Results into an Instances.
|
static HashMap<String,Object> |
getStats(Result r,
String vop)
GetStats.
|
Object |
getValue(String metric)
AddValue.
|
double[] |
rowConfidence(int i)
RowConfidence - Retrieve the prediction confidences for the i-th instance.
|
int[] |
rowPrediction(int i)
RowPrediction - Retrieve the predicted values for the i-th instance according to pre-calibrated/chosen threshold.
|
int[] |
rowPrediction(int i,
double t)
RowPrediction - Retrieve the predicted values for the i-th instance according to threshold t.
|
int[] |
rowTrue(int i)
RowActual - Retrieve the true values for the i-th instance.
|
void |
setInfo(String cat,
String val)
SetInfo.
|
void |
setMeasurement(String metric,
Object stat)
Set the measurement for metric 'metric'.
|
void |
setModel(String key,
String val)
Set a model string.
|
void |
setValue(String metric,
double v)
SetValue.
|
int |
size()
The number of value-prediction pairs stared in this Result
|
String |
toString()
Provides a nice textual output of all evaluation information.
|
static void |
writeResultToFile(Result result,
String fname)
WriteResultToFile -- write a Result 'result' out in plain text format to file 'fname'.
|
public int L
public ArrayList<double[]> predictions
public ArrayList<int[]> actuals
public Result()
public Result(int L)
public Result(int N, int L)
public int size()
public String toString()
public void addResult(double[] pred, weka.core.Instance real)
pred
- predictionsreal
- an instance containing the true label valuespublic int[] rowTrue(int i)
public double[] rowConfidence(int i)
public int[] rowPrediction(int i, double t)
public int[] rowPrediction(int i)
public double[] colConfidence(int j)
public double[][] allPredictions()
public int[][] allPredictions(double t)
public int[][] allTrueValues()
public Set<String> availableMetrics()
public void setMeasurement(String metric, Object stat)
public Object getMeasurement(String metric)
public void setValue(String metric, double v)
public void setInfo(String cat, String val)
public static HashMap<String,Object> getStats(Result r, String vop)
public static String getResultAsString(Result s)
public static void writeResultToFile(Result result, String fname) throws Exception
result
- Resultfname
- file nameException
public static weka.core.Instances getResultsAsInstances(ArrayList<HashMap<String,Object>> metrics)
results
- An ArrayList of Resultspublic static weka.core.Instances getPredictionsAsInstances(Result result)
result
- A ResultCopyright © 2017. All Rights Reserved.