public class Dataset extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Dataset.Attribute
Attributes type
|
| Modifier | Constructor and Description |
|---|---|
protected |
Dataset() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
static Dataset |
fromJSON(String json)
De-serialize an instance from a string
|
Dataset.Attribute |
getAttribute(int attr) |
int[] |
getIgnored() |
double |
getLabel(Instance instance) |
int |
getLabelId() |
String |
getLabelString(double code)
Returns the label value in the data
This method can be used when the criterion variable is the categorical attribute.
|
int |
hashCode() |
boolean |
isNumerical(int attr)
Is this a numerical attribute ?
|
int |
labelCode(String label)
Returns the code used to represent the label value in the data
|
String[] |
labels() |
static Dataset |
load(org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.fs.Path path)
Loads the dataset from a file
|
int |
nbAttributes() |
int |
nblabels() |
int |
nbValues(int attr) |
String |
toJSON()
Serialize this instance to JSON
|
String |
toString() |
int |
valueOf(int attr,
String token)
Converts a token to its corresponding integer code for a given attribute
|
public int nbValues(int attr)
public String[] labels()
public int nblabels()
public int getLabelId()
public double getLabel(Instance instance)
public Dataset.Attribute getAttribute(int attr)
public int labelCode(String label)
label - label's value to codepublic String getLabelString(double code)
code - label's codepublic int valueOf(int attr,
String token)
attr - attribute indexpublic int[] getIgnored()
public int nbAttributes()
public boolean isNumerical(int attr)
attr - index of the attribute to checkpublic static Dataset load(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.Path path) throws IOException
IOExceptionpublic String toJSON()
Copyright © 2008–2015 The Apache Software Foundation. All rights reserved.