Package com.tibco.patterns.learn.training

## Class FeatureVector

- java.lang.Object
- - com.tibco.patterns.learn.training.FeatureVector

-     public class FeatureVector
      extends java.lang.Object

  Stores a feature vector that can be predicted by a Learn model.

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `FeatureVector​(double[] featureValues)` | Creates the feature vector.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `double[]` | `getFeatureValues()` |
    `int` | `getNFeatures()` |
    `RLinkOut` | `predict​(int modelId, PredictOptions predictOpts)` | Calculates prediction using the given model and options.
    `java.lang.String` | `toString()` |

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

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### FeatureVector

          public FeatureVector​(double[] featureValues)

      Creates the feature vector.
      Parameters:
        `featureValues` - - the feature values. Not null.
      Throws:
        `java.lang.IllegalArgumentException` - if featureValues is null, empty, or contains an invalid value. All values must be between 0 and 1, or -1 for an empty feature.

  - ### Method Detail

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`

    - #### getFeatureValues

          public double[] getFeatureValues()

      Returns:
        a copy of the feature values array.

    - #### getNFeatures

          public int getNFeatures()

      Returns:
        the number of features in the feature vector.

    - #### predict

          public RLinkOut predict​(int modelId,
                                  PredictOptions predictOpts)

      Calculates prediction using the given model and options.
      Parameters:
        `modelId` - - ID of an existing RLink model.
        `predictOpts` - - the options to use for this prediction. If null, uses default uptions.
      Returns:
        the RLink prediction for this feature vector.