|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdatabionics.io.BaseFile
databionics.io.Array2DFile
databionics.io.LrnFile
public class LrnFile
File that stores multivariate data sets in a 2D array.
Field Summary | |
---|---|
protected int |
classColumnIndex
Index of class column. |
protected java.lang.String |
classColumnName
Name of class column. |
protected cern.colt.list.IntArrayList |
classes
Column with class numbers, not stored in the main array. |
static int |
CLS_COLUMN
|
static int |
DAT_COLUMN
|
protected cern.colt.list.IntArrayList |
defines
Type of data columns from header. |
static int |
KEY_COLUMN
|
protected int |
keyColumnIndex
Index of key column. |
protected java.lang.String |
keyColumnName
Name of key column. |
protected cern.colt.list.IntArrayList |
keys
Column with unique keys, not stored in the main array. |
protected static org.apache.log4j.Logger |
log
Log4j logging. |
protected StringList |
names
Names of data columns from header. |
static int |
NUL_COLUMN
constants for column definitions. |
protected cern.colt.list.IntArrayList |
nullColumns
Column to be ignored. |
Fields inherited from class databionics.io.Array2DFile |
---|
data |
Fields inherited from class databionics.io.BaseFile |
---|
allowEmptyLines, comment, commentPrefix, delimiter, delimiters, file, header, headerPrefix, loc, nf |
Constructor Summary | |
---|---|
LrnFile()
Standard constructor |
|
LrnFile(int rows,
int cols)
Constructor with size for an empty array. |
|
LrnFile(LrnFile file)
Clone constructor |
|
LrnFile(java.lang.String filename)
Constructor with a filename |
Method Summary | |
---|---|
protected void |
buildHeader()
Generate header. |
protected java.lang.String |
buildLine(int row)
Construct a line for saving. |
protected void |
checkHeader()
Check consistency of header information. |
cern.colt.matrix.DoubleMatrix1D |
getByIndex(int i)
Get a datavector by it's keyValue returns DoubleMatrix1D |
int |
getClassColumnIndex()
Get class column index. |
java.lang.String |
getClassColumnName()
Get class column name. |
cern.colt.list.IntArrayList |
getClasses()
Get classes. |
cern.colt.list.IntArrayList |
getDefines()
Get defines. |
static FileType |
getFileType()
Get the type of file. |
int |
getKeyColumnIndex()
Get key column index. |
java.lang.String |
getKeyColumnName()
Get key column nams. |
cern.colt.list.IntArrayList |
getKeys()
Get keys. |
StringList |
getNames()
Get names. |
protected void |
init(int rows,
int cols)
Initialize 2D array and class and key columns. |
void |
initTest()
|
protected void |
parseHeader()
Parse the header. |
protected void |
parseLine(int row,
java.lang.String line)
Parse a line. |
protected void |
parseNames(java.lang.String line)
Parse line for names with custom delimiters. |
void |
removeColumn(int col)
|
void |
setClassColumnName(java.lang.String name)
Set class column nams. |
void |
setClasses(int[] classes)
Set classes. |
void |
setClasses(cern.colt.list.IntArrayList classes)
Set classes. |
void |
setDefines()
Set automatically generated defines. |
void |
setDefines(int[] defines)
Set defines. |
void |
setDefines(cern.colt.list.IntArrayList defines)
Set defines. |
void |
setKeyColumnName(java.lang.String name)
Set key column nams. |
void |
setKeys()
Add automatically generated keys. |
void |
setKeys(int[] keys)
Set keys. |
void |
setKeys(cern.colt.list.IntArrayList keys)
Set keys. |
void |
setNames()
Set automatically generated names. |
void |
setNames(StringList names)
Set names. |
Methods inherited from class databionics.io.Array2DFile |
---|
get, getColumns, getData, getRows, getSize, set, setData, setData |
Methods inherited from class databionics.io.BaseFile |
---|
checkHeaderAgainstSize, getComment, getFile, getFilename, getHeader, getLocale, getNumberFormat, isHeader, isNaN, isNumber, load, load, parseError, save, save, setComment, setFilename, setLocale, writeStringList, writeStringList |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static org.apache.log4j.Logger log
public static final int NUL_COLUMN
public static final int DAT_COLUMN
public static final int CLS_COLUMN
public static final int KEY_COLUMN
protected StringList names
protected cern.colt.list.IntArrayList defines
protected cern.colt.list.IntArrayList nullColumns
protected cern.colt.list.IntArrayList keys
protected int keyColumnIndex
protected java.lang.String keyColumnName
protected cern.colt.list.IntArrayList classes
protected int classColumnIndex
protected java.lang.String classColumnName
Constructor Detail |
---|
public LrnFile()
public LrnFile(java.lang.String filename)
filename
- Name of the filepublic LrnFile(int rows, int cols)
rows
- Rows of data array.cols
- Columns of data array.public LrnFile(LrnFile file)
Method Detail |
---|
protected void parseNames(java.lang.String line)
public void initTest()
protected void parseHeader()
parseHeader
in class BaseFile
protected void init(int rows, int cols)
init
in class Array2DFile
rows
- Rows of data array.cols
- Columns of data array.protected void parseLine(int row, java.lang.String line)
parseLine
in class Array2DFile
row
- Number of current line.line
- Current line.protected void checkHeader()
checkHeader
in class BaseFile
protected void buildHeader()
buildHeader
in class Array2DFile
protected java.lang.String buildLine(int row)
buildLine
in class Array2DFile
row
- Number of current line.
public StringList getNames()
public void setNames(StringList names)
public void setNames()
public cern.colt.list.IntArrayList getDefines()
public void setDefines(cern.colt.list.IntArrayList defines)
public void setDefines(int[] defines)
public void removeColumn(int col)
public void setDefines()
public int getKeyColumnIndex()
public java.lang.String getKeyColumnName()
public void setKeyColumnName(java.lang.String name)
public cern.colt.list.IntArrayList getKeys()
public void setKeys(cern.colt.list.IntArrayList keys)
public void setKeys(int[] keys)
public void setKeys()
public int getClassColumnIndex()
public java.lang.String getClassColumnName()
public void setClassColumnName(java.lang.String name)
public cern.colt.list.IntArrayList getClasses()
public void setClasses(cern.colt.list.IntArrayList classes)
public void setClasses(int[] classes)
public static FileType getFileType()
public cern.colt.matrix.DoubleMatrix1D getByIndex(int i)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |