Data object
Stores data into two components X (input) and Y (output).
An object is created with:
data('name',X,Y);
or
data(X,Y); (no name)
or
data(X); (in case there's no output, e.g clustering)
Public attributes:
X -- input matrix
Y -- output matrix
index -- original parent indices of examples
findex -- original parent indices of features
Public methods:
d=get(data,index,featInd) -- return data,index only (ind)examples,(find)features
x=get_x(data,index,fInd) -- return x,index only (ind)examples,(find)features
y=get_y(data,index,fInd) -- return y,index only (ind)examples,(find)features
d=set_x(data,X,indes,featInd) -- set inputs indexed by (ind)examples,(find)features
d=set_y(data,Y,index,featInd) -- set outputs indxed by (ind)examples,(find)features
[indes,featInd]=get_index(d) -- returns example and feature indices
[numEx,vDim,oDim,numCls]=get_dim(d) -- returns number of examples,features,output dimensions,classes
Import methods:
The Data object can import libsvm or arff files for file exchange with weka/libsvm.
Note that arff does not encode what is input or output thus the resulting data object has an empty Y member.
Nominal attributes are mapped to an index value and missing attributes are indicated by "NaN".
Example:
get_x(data([1:5;6:10;11:15]),[1 3],[3:5])
dlibsvm=readfrom(data,'libsvm','mylibsvmtrainingfile');
darff=readfrom(data,'arff','mywekafile.arff');
There is more than one data available. See also
help data/data.m