public class AttributeDataset extends Dataset<double[]>
| Modifier and Type | Class and Description |
|---|---|
class |
AttributeDataset.Row |
data, DATASET_HAS_NO_RESPONSE, description, name, response, RESPONSE_NOT_NOMINAL, RESPONSE_NOT_NUMERIC| Constructor and Description |
|---|
AttributeDataset(java.lang.String name,
Attribute[] attributes)
Constructor.
|
AttributeDataset(java.lang.String name,
Attribute[] attributes,
Attribute response)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
AttributeDataset.Row |
add(AttributeDataset.Row x)
Add a datum item into the dataset.
|
Datum<double[]> |
add(Datum<double[]> x)
Add a datum item into the dataset.
|
AttributeDataset.Row |
add(double[] x)
Add a datum item into the dataset.
|
AttributeDataset.Row |
add(double[] x,
double y)
Add a datum item into the dataset.
|
AttributeDataset.Row |
add(double[] x,
double y,
double weight)
Add a datum item into the dataset.
|
AttributeDataset.Row |
add(double[] x,
int y)
Add a datum item into the dataset.
|
AttributeDataset.Row |
add(double[] x,
int y,
double weight)
Add a datum item into the dataset.
|
Attribute[] |
attributes()
Returns the list of attributes in this dataset.
|
AttributeVector |
column(int i)
Returns a column.
|
AttributeVector |
column(java.lang.String col)
Returns a column.
|
AttributeDataset |
columns(java.lang.String... cols)
Returns a dataset with selected columns.
|
AttributeDataset |
head(int n)
returns the first few rows.
|
AttributeDataset |
range(int from,
int to)
Returns the rows in the given range [from, to).
|
AttributeDataset |
remove(java.lang.String... cols)
Returns a new dataset without given columns.
|
AttributeDataset |
summary()
Returns statistic summary.
|
AttributeDataset |
tail(int n)
Returns the last few rows.
|
java.lang.String |
toString() |
java.lang.String |
toString(int from,
int to)
Stringify dataset.
|
double[][] |
x()
Returns the array of data items.
|
data, get, getDescription, getName, iterator, labels, remove, response, responseAttribute, setDescription, setName, size, toArray, toArray, toArray, toArray, toArray, ypublic AttributeDataset(java.lang.String name,
Attribute[] attributes)
name - the name of dataset.attributes - the list of attributes in this dataset.public Attribute[] attributes()
public double[][] x()
public Datum<double[]> add(Datum<double[]> x)
Datasetpublic AttributeDataset.Row add(AttributeDataset.Row x)
x - a datum item.public AttributeDataset.Row add(double[] x)
Datasetpublic AttributeDataset.Row add(double[] x, int y)
Datasetpublic AttributeDataset.Row add(double[] x, int y, double weight)
Datasetadd in class Dataset<double[]>x - a datum item.y - the class label of the datum.weight - the weight of datum. The particular meaning of weight
depends on applications and machine learning algorithms.
Although there are on explicit requirements on the weights,
in general, they should be positive.public AttributeDataset.Row add(double[] x, double y)
Datasetpublic AttributeDataset.Row add(double[] x, double y, double weight)
Datasetadd in class Dataset<double[]>x - a datum item.weight - the weight of datum. The particular meaning of weight
depends on applications and machine learning algorithms.
Although there are on explicit requirements on the weights,
in general, they should be positive.public java.lang.String toString()
toString in class java.lang.Objectpublic AttributeDataset head(int n)
public AttributeDataset tail(int n)
public AttributeDataset range(int from, int to)
public java.lang.String toString(int from,
int to)
from - starting row (inclusive)to - ending row (exclusive)public AttributeVector column(int i)
public AttributeVector column(java.lang.String col)
public AttributeDataset columns(java.lang.String... cols)
public AttributeDataset remove(java.lang.String... cols)
public AttributeDataset summary()