org.apache.ignite.ml.structures

## Class DatasetRow<V extends Vector>

- java.lang.Object
- - org.apache.ignite.ml.structures.DatasetRow<V>

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

      public class DatasetRow<V extends Vector>
      extends Object
      implements Externalizable

  Class to keep one observation in dataset. This is a base class for labeled and unlabeled rows.
  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected V` | `vector` Vector.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DatasetRow()` Default constructor (required by Externalizable).
    `DatasetRow(V vector)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(Object o)`
    `V` | `features()` Get the vector.
    `double` | `get(int idx)` Gets the value at specified index.
    `Serializable` | `getRaw(int idx)` Gets the value at specified index.
    `V` | `getVector()`
    `int` | `hashCode()`
    `void` | `readExternal(ObjectInput in)`
    `void` | `set(int idx, double val)` Sets value.
    `int` | `size()` Gets cardinality of dataset row (maximum number of the elements).
    `void` | `writeExternal(ObjectOutput out)`

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

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

- - ### Field Detail

    - #### vector

          protected V extends Vector vector

      Vector.

  - ### Constructor Detail

    - #### DatasetRow

          public DatasetRow()

      Default constructor (required by Externalizable).

    - #### DatasetRow

          public DatasetRow(V vector)

  - ### Method Detail

    - #### features

          public V features()

      Get the vector.
      Returns:
        Vector.

    - #### 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`

    - #### size

          public int size()

      Gets cardinality of dataset row (maximum number of the elements).
      Returns:
        This dataset row's cardinality.

    - #### get

          public double get(int idx)

      Gets the value at specified index.
      Parameters:
        `idx` - DatasetRow index.
      Returns:
        DatasetRow value.
      Throws:
        `IndexException` - Throw if index is out of bounds.

    - #### getRaw

          public Serializable getRaw(int idx)

      Gets the value at specified index.
      Parameters:
        `idx` - DatasetRow index.
      Returns:
        DatasetRow value.
      Throws:
        `IndexException` - Throw if index is out of bounds.

    - #### set

          public void set(int idx,
                          double val)

      Sets value.
      Parameters:
        `idx` - Dataset row index to set value at.
        `val` - Value to set.
      Throws:
        `IndexException` - Throw if index is out of bounds.

    - #### getVector

          public V getVector()

2022 Copyright © Apache Software Foundation
| Follow @ApacheIgnite
Ignite Database and Caching Platform | : ver. 2.12.0
Release Date | : January 10 2022