|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.mahout.df.data.Dataset
public class Dataset
Contains informations about the attributes.
Nested Class Summary | |
---|---|
static class |
Dataset.Attribute
Attributes type |
Constructor Summary | |
---|---|
protected |
Dataset(Dataset.Attribute[] attrs,
java.util.List<java.lang.String>[] values,
int nbInstances)
Should only be called by a DataLoader |
Method Summary | |
---|---|
protected static int |
countAttributes(Dataset.Attribute[] attrs)
Counts the number of attributes, except IGNORED and LABEL |
boolean |
equals(java.lang.Object obj)
|
int[] |
getIgnored()
|
java.lang.String |
getLabel(int code)
|
int |
getLabelId()
|
int |
hashCode()
|
boolean |
isNumerical(int attr)
Is this a numerical attribute ? |
int |
labelCode(java.lang.String label)
Returns the code used to represent the label value in the data |
java.lang.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 |
nbInstances()
|
int |
nblabels()
|
static Dataset |
read(java.io.DataInput in)
|
void |
readFields(java.io.DataInput in)
|
int |
valueOf(int attr,
java.lang.String token)
Converts a token to its corresponding int code for a given attribute |
void |
write(java.io.DataOutput out)
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected Dataset(Dataset.Attribute[] attrs, java.util.List<java.lang.String>[] values, int nbInstances)
attrs
- attributes descriptionvalues
- distinct values for all CATEGORICAL attributesnbInstances
- Method Detail |
---|
public java.lang.String[] labels()
public int nblabels()
public int getLabelId()
public int nbInstances()
public int labelCode(java.lang.String label)
label
- label's value to code
public java.lang.String getLabel(int code)
public int valueOf(int attr, java.lang.String token)
attr
- attribute's indexpublic int[] getIgnored()
protected static int countAttributes(Dataset.Attribute[] attrs)
public int nbAttributes()
public boolean isNumerical(int attr)
attr
- index of the attribute to check
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public static Dataset load(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.Path path) throws java.io.IOException
java.io.IOException
public static Dataset read(java.io.DataInput in) throws java.io.IOException
java.io.IOException
public void readFields(java.io.DataInput in) throws java.io.IOException
readFields
in interface org.apache.hadoop.io.Writable
java.io.IOException
public void write(java.io.DataOutput out) throws java.io.IOException
write
in interface org.apache.hadoop.io.Writable
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |