org.apache.ignite.ml.structures

## Class Dataset<Row extends DatasetRow>

- java.lang.Object
- - org.apache.ignite.ml.structures.Dataset<Row>

- All Implemented Interfaces:
    Externalizable, Serializable
  Direct Known Subclasses:
    LabeledVectorSet

      public class Dataset<Row extends DatasetRow>
      extends Object
      implements Externalizable

  Class for set of vectors. This is a base class in hierarchy of datasets.
  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected int` | `colSize` Amount of attributes in each vector.
    `protected Row[]` | `data` Data to keep.
    `protected FeatureMetadata[]` | `meta` Metadata to identify feature.
    `protected int` | `rowSize` Amount of instances.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Dataset()` Default constructor (required by Externalizable).
    `Dataset(int rowSize, int colSize, String[] featureNames)` Creates new Dataset and initialized with empty data structure.
    `Dataset(Row[] data)` Creates new Dataset by given data.
    `Dataset(Row[] data, FeatureMetadata[] meta)` Creates new Dataset by given data.
    `Dataset(Row[] data, int colSize)` Creates new Dataset by given data.
    `Dataset(Row[] data, String[] featureNames, int colSize)` Creates new Dataset by given data.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `colSize()` Gets amount of attributes.
    `protected void` | `convertStringNamesToFeatureMetadata(String[] featureNames)`
    `DatasetRow[]` | `data()`
    `boolean` | `equals(Object o)`
    `Vector` | `features(int idx)` Get the features.
    `protected void` | `generateFeatureNames()`
    `String` | `getFeatureName(int i)` Returns feature name for column with given index.
    `Row` | `getRow(int idx)` Retrieves Labeled Vector by given index.
    `int` | `hashCode()`
    `FeatureMetadata[]` | `meta()`
    `void` | `readExternal(ObjectInput in)`
    `int` | `rowSize()` Gets amount of observation.
    `void` | `setData(Row[] data)`
    `void` | `setMeta(FeatureMetadata[] meta)`
    `void` | `writeExternal(ObjectOutput out)`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### data

          protected Row extends DatasetRow[] data

      Data to keep.

    - #### meta

          protected FeatureMetadata[] meta

      Metadata to identify feature.

    - #### rowSize

          protected int rowSize

      Amount of instances.

    - #### colSize

          protected int colSize

      Amount of attributes in each vector.

  - ### Constructor Detail

    - #### Dataset

          public Dataset()

      Default constructor (required by Externalizable).

    - #### Dataset

          public Dataset(Row[] data,
                         FeatureMetadata[] meta)

      Creates new Dataset by given data.
      Parameters:
        `data` - Given data. Should be initialized with one vector at least.
        `meta` - Feature's metadata.

    - #### Dataset

          public Dataset(Row[] data,
                         String[] featureNames,
                         int colSize)

      Creates new Dataset by given data.
      Parameters:
        `data` - Given data. Should be initialized with one vector at least.
        `featureNames` - Column names.
        `colSize` - Amount of observed attributes in each vector.

    - #### Dataset

          public Dataset(Row[] data,
                         int colSize)

      Creates new Dataset by given data.
      Parameters:
        `data` - Should be initialized with one vector at least.
        `colSize` - Amount of observed attributes in each vector.

    - #### Dataset

          public Dataset(Row[] data)

      Creates new Dataset by given data.
      Parameters:
        `data` - Should be initialized with one vector at least.

    - #### Dataset

          public Dataset(int rowSize,
                         int colSize,
                         String[] featureNames)

      Creates new Dataset and initialized with empty data structure.
      Parameters:
        `rowSize` - Amount of instances. Should be > 0.
        `colSize` - Amount of attributes. Should be > 0
        `featureNames` - Column names.

  - ### Method Detail

    - #### convertStringNamesToFeatureMetadata

          protected void convertStringNamesToFeatureMetadata(String[] featureNames)

    - #### generateFeatureNames

          protected void generateFeatureNames()

    - #### getFeatureName

          public String getFeatureName(int i)

      Returns feature name for column with given index.
      Parameters:
        `i` - The given index.
      Returns:
        Feature name.

    - #### data

          public DatasetRow[] data()

    - #### setData

          public void setData(Row[] data)

    - #### meta

          public FeatureMetadata[] meta()

    - #### setMeta

          public void setMeta(FeatureMetadata[] meta)

    - #### colSize

          public int colSize()

      Gets amount of attributes.
      Returns:
        Amount of attributes in each Labeled Vector.

    - #### rowSize

          public int rowSize()

      Gets amount of observation.
      Returns:
        Amount of rows in dataset.

    - #### getRow

          public Row getRow(int idx)

      Retrieves Labeled Vector by given index.
      Parameters:
        `idx` - Index of observation.
      Returns:
        Labeled features.

    - #### features

          public Vector features(int idx)

      Get the features.
      Parameters:
        `idx` - Index of observation.
      Returns:
        Vector with features.

    - #### equals

          public boolean equals(Object o)

      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### writeExternal

          public void writeExternal(ObjectOutput out)
                             throws IOException

      Specified by:
        `writeExternal` in interface `Externalizable`
      Throws:
        `IOException`

    - #### readExternal

          public void readExternal(ObjectInput in)
                            throws IOException,
                                   ClassNotFoundException

      Specified by:
        `readExternal` in interface `Externalizable`
      Throws:
        `IOException`
        `ClassNotFoundException`

2021 Copyright © Apache Software Foundation
| Follow @ApacheIgnite
Ignite Database and Caching Platform | : ver. 2.10.0
Release Date | : March 10 2021