Documentation of 'org.encog.ml.data.sparse.SparseMLData' Java class
SparseMLData
org.encog.ml.data.sparse

Class SparseMLData

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, MLData, CentroidFactory<MLData>


    public class SparseMLData
    extends java.lang.Object
    implements MLData, java.io.Serializable, java.lang.Cloneable
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor and Description
      SparseMLData(double[] d)
      Construct this object with the specified data.
      SparseMLData(double[] d, int[] i)
      Construct this object with the specified data.
      SparseMLData(int size)
      Construct this object with blank data and a specified size.
      SparseMLData(MLData d)
      Construct a new BasicMLData object from an existing one.
    • Constructor Detail

      • SparseMLData

        public SparseMLData(double[] d)
        Construct this object with the specified data.
        Parameters:
        d - The data to construct this object with.
      • SparseMLData

        public SparseMLData(double[] d,
                            int[] i)
        Construct this object with the specified data.
        Parameters:
        d - The data to construct this object with.
        i - The index.
      • SparseMLData

        public SparseMLData(int size)
        Construct this object with blank data and a specified size.
        Parameters:
        size - The amount of data to store.
      • SparseMLData

        public SparseMLData(MLData d)
        Construct a new BasicMLData object from an existing one. This makes a copy of an array.
        Parameters:
        d - The object to be copied.
    • Method Detail

      • findIndex

        public int findIndex(int index)
      • add

        public void add(int index,
                        double value)
        Add a value to the specified index.
        Specified by:
        add in interface MLData
        Parameters:
        index - The index to add to.
        value - The value to add.
      • clear

        public void clear()
        Clear any data to zero.
        Specified by:
        clear in interface MLData
      • clone

        public MLData clone()
        Clone this object.
        Specified by:
        clone in interface MLData
        Overrides:
        clone in class java.lang.Object
        Returns:
        A cloned version of this object.
      • getData

        public double[] getData()
        Specified by:
        getData in interface MLData
        Returns:
        All of the elements as an array.
      • getData

        public double getData(int index)
        Get the element specified index value.
        Specified by:
        getData in interface MLData
        Parameters:
        index - The index to read.
        Returns:
        The value at the specified inedx.
      • setData

        public void setData(double[] theData)
        Set all of the data as an array of doubles.
        Specified by:
        setData in interface MLData
        Parameters:
        theData - An array of doubles.
      • setData

        public void setData(int index,
                            double d)
        Set the specified element.
        Specified by:
        setData in interface MLData
        Parameters:
        index - The index to set.
        d - The data for the specified element.
      • size

        public int size()
        Specified by:
        size in interface MLData
        Returns:
        How many elements are stored in this object.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • getSparseIndex

        public int[] getSparseIndex()
      • getSparseData

        public double[] getSparseData()

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.