MLFeature
abstract class NatML.MLFeature
The MLFeature
class is an abstract base class representing input and output features used in making predictions. All predictors accept one or more features, which are then provided to the model to make predictions.
Creating a Feature
NatML provides implicit conversions from common data types into MLFeature
instances:
From an Array
NatML provides an implicit conversion from a float[]
to an MLArrayFeature
.
When this conversion is used, the created feature will have no shape
information.
From a Texture2D
NatML provides an implicit conversion from a Texture2D
to an MLImageFeature
.
The MLImageFeature
class will handle any conversions of pixel data to match a model's required input type.
From a WebCamTexture
NatML provides an implicit conversion from a WebCamTexture
to an MLImageFeature
.
From an AudioClip
NatML provides an implicit conversion from an AudioClip
to an MLAudioFeature
.
From a String
NatML provides an implicit conversion from a string
to an MLTextFeature
.
Inspecting the Feature
Every feature has a corresponding MLFeatureType
that provides information about the feature's shape, data type, and so on.
The feature type
is immutable and can never be null
.
Last updated