org.encog.ml.data.specific
Class BiPolarNeuralData
- java.lang.Object
-
- org.encog.ml.data.specific.BiPolarNeuralData
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, MLData, CentroidFactory<MLData>
public class BiPolarNeuralData extends java.lang.Object implements MLData, java.io.Serializable
A NeuralData implementation designed to work with bipolar data. Bipolar data contains two values. True is stored as 1, and false is stored as -1.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description BiPolarNeuralData(boolean[] d)Construct this object with the specified data.BiPolarNeuralData(int size)Construct a data object with the specified size.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidadd(int index, double value)This will throw an error, as "add" is not supported for bipolar.voidclear()Set all data to false.MLDataclone()Clone this object.Centroid<MLData>createCentroid()Not supported.booleangetBoolean(int i)Get the specified data item as a boolean.double[]getData()Get the data held by this object as an array of doubles.doublegetData(int index)Get the data held by the index.voidsetData(double[] theData)Store the array.voidsetData(int index, boolean value)Set the specified index of this object as a boolean.voidsetData(int index, double d)Set the specified index of this object as a double.intsize()Get the size of this data object.java.lang.StringtoString()
-
-
-
Constructor Detail
-
BiPolarNeuralData
public BiPolarNeuralData(boolean[] d)
Construct this object with the specified data.- Parameters:
d- The data to create this object with.
-
BiPolarNeuralData
public BiPolarNeuralData(int size)
Construct a data object with the specified size.- Parameters:
size- The size of this data object.
-
-
Method Detail
-
add
public void add(int index, double value)This will throw an error, as "add" is not supported for bipolar.
-
getBoolean
public boolean getBoolean(int i)
Get the specified data item as a boolean.- Parameters:
i- The index to read.- Returns:
- The specified data item's value.
-
getData
public double[] getData()
Get the data held by this object as an array of doubles.
-
getData
public double getData(int index)
Get the data held by the index.
-
setData
public void setData(double[] theData)
Store the array.
-
setData
public void setData(int index, boolean value)Set the specified index of this object as a boolean. This value will be converted into bipolar.- Parameters:
index- The index to set.value- The value to set.
-
setData
public void setData(int index, double d)Set the specified index of this object as a double. This value will be converted into bipolar.
-
size
public int size()
Get the size of this data object.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
createCentroid
public Centroid<MLData> createCentroid()
Not supported.- Specified by:
createCentroidin interfaceCentroidFactory<MLData>- Returns:
- Nothing.
-
-
DMelt 3.0 © DataMelt by jWork.ORG