JavaScript
  • NatML for JavaScript
  • Preliminaries
    • Getting Started
  • Using Predictors
    • Core Concepts
    • Fetching Predictors
  • API Reference
    • IMLPredictor
    • IMLAsyncPredictor
    • MLModelData
    • MLModel
      • MLHubModel
      • MLEdgeModel
    • MLFeature
      • MLArrayFeature
      • MLAudioFeature
      • MLImageFeature
      • MLTextFeature
    • MLFeatureType
      • MLArrayType
      • MLAudioType
      • MLImageType
      • MLTextType
  • Insiders
    • Distributing Predictors
    • Changelog
    • GitHub
    • Discord
    • Blog
Powered by GitBook
On this page
  • Inspecting the Name
  • Inspecting the Data Type

Was this helpful?

  1. API Reference

MLFeatureType

abstract class MLFeatureType

PreviousMLTextFeatureNextMLArrayType

Last updated 3 years ago

Was this helpful?

The MLFeatureType class is an abstract base class providing information that fully describes the structure of an .

Every has a corresponding MLFeatureType.

Inspecting the Name

/**
 * Feature name.
 */
name: string | undefined;

Some feature types include a name. This is usually the case with feature types provided by MLModel instances. However, most feature types attached to features do not have a name.

Inspecting the Data Type

/**
 * Feature data type.
 */
type: MLDataType;

This is the data type of each element within a given feature. This is usually a signed numeric type. Below are possible values:

// Feature data type.
enum MLDataType {
    // Single precision floating point number.
    Float = "FLOAT32",
    // Double precision floating point number.
    Double = "FLOAT64",
    // Signed 8-bit integer.
    SByte = "INT8",
    // Signed 16-bit integer.
    Short = "INT16",
    // Signed 32-bit integer.
    Int = "INT32",
    // Signed 64-bit integer.
    Long = "INT64",
    // Unsigned 8-bit integer.
    Byte = "UINT8",
    // Unsigned 16-bit integer.
    UShort = "UINT16",
    // Unsigned 32-bit integer.
    UInt = "UINT32",
    // Unsigned 64-bit integer.
    ULong = "UINT64",
    // Encoded image.
    Image = "IMAGE",
    // Encoded audio.
    Audio = "AUDIO",
    // Plain text.
    String = "STRING"
}
MLFeature
MLFeature