|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--lnsc.Tools
Set tool functions.
Method Summary | |
static java.io.Serializable |
copyObject(java.io.Serializable obj)
Copies an object by writing it to a temp file and reading it afterwards. |
static FunctionalUnit[] |
createUnitArray(int newCount,
FunctionalUnit newUnit)
Takes a unit and a count and creates and array of that unit and count (by copy to the provided units). |
int[][][] |
GIFEncoder(java.awt.Image image)
Takes an images and returns and r,g,b arrays of values between 0 and 256. |
static DataSet |
importDataSet(java.lang.String fileName,
int inputCount,
int outputCount,
int patternCount)
Imports a data set from a file. |
static DataSet |
loadDataSet(java.io.File file)
Loads a data set (saved using saveDataSet(java.lang.String, lnsc.DataSet) ) from a file. |
static DataSet |
loadDataSet(java.lang.String fileName)
Loads a data set (saved using saveDataSet(java.lang.String, lnsc.DataSet) ) from a file. |
static DataSetCollection |
makeCrossValidationSets(DataSet data,
int foldCount)
Takes a set of data an generate k train sets and test sets by splitting the data into k folds and using each fold as a test set for the train set made of the other k-1 folds. |
static double[][] |
makeGrid(int size)
Generates a set of coordinates that form a grid in the [-1,1]x[-1,1] space (including the boundary). |
static void |
saveDataSet(java.io.File file,
DataSet dataSet)
Saves a data set to a file. |
static void |
saveDataSet(java.lang.String fileName,
DataSet dataSet)
Saves a data set to a file. |
static java.lang.String |
tabText(java.lang.String text,
int tabCount)
Tabulates text. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static java.io.Serializable copyObject(java.io.Serializable obj)
obj
- A serializable object.
public static FunctionalUnit[] createUnitArray(int newCount, FunctionalUnit newUnit)
newCount
- Number of units in the arraynewUnit
- Units to initialise the array with.
public int[][][] GIFEncoder(java.awt.Image image) throws java.awt.AWTException, java.lang.InterruptedException
image
- The image to transform.
java.awt.AWTException
java.lang.InterruptedException
public static DataSet importDataSet(java.lang.String fileName, int inputCount, int outputCount, int patternCount) throws java.io.IOException
fileName
- The name of the file.inputCount
- Number of input values per row.outputCount
- Number of output values per row.patternCount
- Total number of pattern pairs to expect.
DataNames.TRAIN_SET
.
The file must contain 1 pattern per row, the first few elements being the
input values and the last few the output values.
java.io.IOException
public static DataSet loadDataSet(java.io.File file) throws java.io.IOException, java.lang.ClassNotFoundException
saveDataSet(java.lang.String, lnsc.DataSet)
) from a file.
file
- The file descriptor.
java.io.IOException
java.lang.ClassNotFoundException
public static DataSet loadDataSet(java.lang.String fileName) throws java.io.IOException, java.lang.ClassNotFoundException
saveDataSet(java.lang.String, lnsc.DataSet)
) from a file.
fileName
- The name of the file.
java.io.IOException
java.lang.ClassNotFoundException
public static final DataSetCollection makeCrossValidationSets(DataSet data, int foldCount)
data
- A valid DataNames.TRAIN_SET
.foldCount
- Number of folds into which the data must be split.
DataNames.TRAIN_SET
and DataNames.TEST_SET
.public static final double[][] makeGrid(int size)
[-1,1]x[-1,1]
space (including the boundary).
size
- Number of grid element along both
dimensions.
size*size
bi-dimensional vectors
equally spaced in the range [-1,1]x[-1,1]
.public static void saveDataSet(java.io.File file, DataSet dataSet) throws java.io.IOException
file
- The file descriptor.dataSet
- The data set to save.
java.io.IOException
public static void saveDataSet(java.lang.String fileName, DataSet dataSet) throws java.io.IOException
fileName
- The name of the file.dataSet
- The data set to save.
java.io.IOException
public static java.lang.String tabText(java.lang.String text, int tabCount)
text
- Text to be tabulated.tabCount
- Number of tab to add.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |