org.encog.ml.data.basic
Class BasicMLDataPair
- java.lang.Object
-
- org.encog.ml.data.basic.BasicMLDataPair
-
- All Implemented Interfaces:
- java.io.Serializable, MLDataPair, CentroidFactory<MLDataPair>
- Direct Known Subclasses:
- BasicNeuralDataPair
public class BasicMLDataPair extends java.lang.Object implements MLDataPair, java.io.Serializable
A basic implementation of the MLDataPair interface. This implementation simply holds and input and ideal MLData object. For supervised training both input and ideal should be specified. For unsupervised training the input property should be valid, however the ideal property should contain null.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description BasicMLDataPair(MLData theInput)Construct the object with only input.BasicMLDataPair(MLData theInput, MLData theIdeal)Construct a BasicMLDataPair class with the specified input and ideal values.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description Centroid<MLDataPair>createCentroid()static MLDataPaircreatePair(int inputSize, int idealSize)Create a new data pair object of the correct size for the machine learning method that is being trained.MLDatagetIdeal()double[]getIdealArray()MLDatagetInput()double[]getInputArray()doublegetSignificance()Get the significance, 1.0 is neutral.booleanisSupervised()voidsetIdealArray(double[] data)Set the ideal data, the desired output.voidsetInputArray(double[] data)Set the input.voidsetSignificance(double significance)Set the significance, 1.0 is neutral.java.lang.StringtoString()
-
-
-
Constructor Detail
-
BasicMLDataPair
public BasicMLDataPair(MLData theInput)
Construct the object with only input. If this constructor is used, then unsupervised training is being used.- Parameters:
theInput- The input to the machine learning method.
-
-
Method Detail
-
createPair
public static MLDataPair createPair(int inputSize, int idealSize)
Create a new data pair object of the correct size for the machine learning method that is being trained. This object will be passed to the getPair method to allow the data pair objects to be copied to it.- Parameters:
inputSize- The size of the input data.idealSize- The size of the ideal data.- Returns:
- A new data pair object.
-
getIdeal
public MLData getIdeal()
- Specified by:
getIdealin interfaceMLDataPair- Returns:
- The ideal data that the neural network should produce for the specified input.
-
getIdealArray
public double[] getIdealArray()
- Specified by:
getIdealArrayin interfaceMLDataPair- Returns:
- The ideal data that the machine learning method should produce for the specified input.
-
getInput
public MLData getInput()
- Specified by:
getInputin interfaceMLDataPair- Returns:
- The input that the neural network
-
getInputArray
public double[] getInputArray()
- Specified by:
getInputArrayin interfaceMLDataPair- Returns:
- The input that the neural network
-
isSupervised
public boolean isSupervised()
- Specified by:
isSupervisedin interfaceMLDataPair- Returns:
- True if this training pair is supervised. That is, it has both input and ideal data.
-
setIdealArray
public void setIdealArray(double[] data)
Set the ideal data, the desired output.- Specified by:
setIdealArrayin interfaceMLDataPair- Parameters:
data- The ideal data.
-
setInputArray
public void setInputArray(double[] data)
Set the input.- Specified by:
setInputArrayin interfaceMLDataPair- Parameters:
data- The input.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getSignificance
public double getSignificance()
Get the significance, 1.0 is neutral.- Specified by:
getSignificancein interfaceMLDataPair- Returns:
- The significance.
-
setSignificance
public void setSignificance(double significance)
Set the significance, 1.0 is neutral.- Specified by:
setSignificancein interfaceMLDataPair- Parameters:
significance- The significance.
-
createCentroid
public Centroid<MLDataPair> createCentroid()
- Specified by:
createCentroidin interfaceCentroidFactory<MLDataPair>- Returns:
- The centroid.
-
-
DMelt 3.0 © DataMelt by jWork.ORG