org.encog.persist
Class EncogWriteHelper
- java.lang.Object
-
- org.encog.persist.EncogWriteHelper
-
public class EncogWriteHelper extends java.lang.ObjectUsed to write an Encog EG/EGA file. EG files are used to hold Encog objects. EGA files are used to hold Encog Analyst scripts.
-
-
Field Summary
Fields Modifier and Type Field and Description static charCOMMAA comma char.static charQUOTEA quote char.
-
Constructor Summary
Constructors Constructor and Description EncogWriteHelper(java.io.OutputStream stream)Construct the object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidaddColumn(ActivationFunction act)voidaddColumn(boolean b)Add a boolean value as a column.voidaddColumn(double d)Add a column as a double.voidaddColumn(int i)Add a column as an integer.voidaddColumn(java.lang.String str)Add a column as a string.voidaddColumns(java.util.List<java.lang.String> cols)Add a list of string columns.voidaddLine(java.lang.String l)Add a line.voidaddProperties(java.util.Map<java.lang.String,java.lang.String> properties)Add the specified properties.voidaddSection(java.lang.String str)Add a new section.voidaddSubSection(java.lang.String str)Add a new subsection.voidflush()Flush the file.java.lang.StringgetCurrentSection()voidwrite(java.lang.String str)Write the specified string.voidwriteLine()Write the line.voidwriteProperty(java.lang.String name, ActivationFunction act)Write a property as an activation function.voidwriteProperty(java.lang.String name, boolean value)Write the property as a boolean.voidwriteProperty(java.lang.String name, CSVFormat csvFormat)Write a property as a CSV format.voidwriteProperty(java.lang.String name, double value)Write the property as a double.voidwriteProperty(java.lang.String name, double[] d)Write the property as a double array.voidwriteProperty(java.lang.String name, int value)Write a property as an int value.voidwriteProperty(java.lang.String name, int[] array)Write a property as an int array.voidwriteProperty(java.lang.String name, Matrix matrix)Write a matrix as a property.voidwriteProperty(java.lang.String name, java.lang.String value)Write the property a s string.
-
-
-
Field Detail
-
QUOTE
public static final char QUOTE
A quote char.- See Also:
- Constant Field Values
-
COMMA
public static final char COMMA
A comma char.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
EncogWriteHelper
public EncogWriteHelper(java.io.OutputStream stream)
Construct the object.- Parameters:
stream- The stream to write to.
-
-
Method Detail
-
addColumn
public final void addColumn(boolean b)
Add a boolean value as a column.- Parameters:
b- The boolean value.
-
addColumn
public final void addColumn(double d)
Add a column as a double.- Parameters:
d- The double to add.
-
addColumn
public final void addColumn(int i)
Add a column as an integer.- Parameters:
i- The integer to add.
-
addColumn
public final void addColumn(java.lang.String str)
Add a column as a string.- Parameters:
str- The string to add.
-
addColumns
public final void addColumns(java.util.List<java.lang.String> cols)
Add a list of string columns.- Parameters:
cols- The columns to add.
-
addLine
public final void addLine(java.lang.String l)
Add a line.- Parameters:
l- The line to add.
-
addProperties
public final void addProperties(java.util.Map<java.lang.String,java.lang.String> properties)
Add the specified properties.- Parameters:
properties- The properties.
-
addSection
public final void addSection(java.lang.String str)
Add a new section.- Parameters:
str- The section to add.
-
addSubSection
public final void addSubSection(java.lang.String str)
Add a new subsection.- Parameters:
str- The subsection.
-
flush
public final void flush()
Flush the file.
-
getCurrentSection
public final java.lang.String getCurrentSection()
- Returns:
- The current section.
-
write
public final void write(java.lang.String str)
Write the specified string.- Parameters:
str- The string to write.
-
writeLine
public final void writeLine()
Write the line.
-
writeProperty
public final void writeProperty(java.lang.String name, ActivationFunction act)Write a property as an activation function.- Parameters:
name- The name of the property.act- The activation function.
-
writeProperty
public final void writeProperty(java.lang.String name, boolean value)Write the property as a boolean.- Parameters:
name- The name of the property.value- The boolean value.
-
writeProperty
public final void writeProperty(java.lang.String name, CSVFormat csvFormat)Write a property as a CSV format.- Parameters:
name- The name of the property.csvFormat- The format.
-
writeProperty
public final void writeProperty(java.lang.String name, double value)Write the property as a double.- Parameters:
name- The name of the property.value- The value.
-
writeProperty
public final void writeProperty(java.lang.String name, double[] d)Write the property as a double array.- Parameters:
name- The name of the property.d- The double value.
-
writeProperty
public final void writeProperty(java.lang.String name, int value)Write a property as an int value.- Parameters:
name- The name of the property.value- The int value.
-
writeProperty
public final void writeProperty(java.lang.String name, int[] array)Write a property as an int array.- Parameters:
name- The name of the property.array- The array.
-
writeProperty
public final void writeProperty(java.lang.String name, Matrix matrix)Write a matrix as a property.- Parameters:
name- The property name.matrix- The matrix.
-
writeProperty
public final void writeProperty(java.lang.String name, java.lang.String value)Write the property a s string.- Parameters:
name- The name of the property.value- The value.
-
addColumn
public void addColumn(ActivationFunction act)
-
-
DMelt 3.0 © DataMelt by jWork.ORG