ILearningModelVariableDescriptorPreview.ModelFeatureKind 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
已弃用。 获取变量的数据类型。
public:
property LearningModelFeatureKindPreview ModelFeatureKind { LearningModelFeatureKindPreview get(); };
LearningModelFeatureKindPreview ModelFeatureKind();
/// [get: Windows.Foundation.Metadata.Deprecated("Use ILearningModelFeatureDescriptor instead of ILearningModelVariableDescriptorPreview. For more info, see MSDN.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 131072, "Windows.AI.MachineLearning.Preview.MachineLearningPreviewContract")]
LearningModelFeatureKindPreview ModelFeatureKind();
public LearningModelFeatureKindPreview ModelFeatureKind { get; }
public LearningModelFeatureKindPreview ModelFeatureKind { [Windows.Foundation.Metadata.Deprecated("Use ILearningModelFeatureDescriptor instead of ILearningModelVariableDescriptorPreview. For more info, see MSDN.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 131072, "Windows.AI.MachineLearning.Preview.MachineLearningPreviewContract")] get; }
var learningModelFeatureKindPreview = iLearningModelVariableDescriptorPreview.modelFeatureKind;
Public ReadOnly Property ModelFeatureKind As LearningModelFeatureKindPreview
属性值
变量的数据类型。
- 属性
示例
public void Evaluator(LearningModelPreview model)
{
// Retrieve the first input feature which is an image
ILearningModelVariableDescriptorPreview inputImageFeatureDescription = model.Description.InputFeatures.FirstOrDefault(feature=>feature.ModelFeatureKind == LearningModelFeatureKindPreview.Image);
ImageVariableDescriptorPreview imageDescriptor = (ImageVariableDescriptorPreview)inputImageFeatureDescription;
// Ensure the input feature is of type image
if (imageDescriptor.ModelFeatureKind != LearningModelFeatureKindPreview.Image)
{
Console.WriteLine($"Input Feature Name: {imageDescriptor.Name}. Feature type is not an image.");
}
}
注解
警告
这是一个已弃用的 API。 请改用 Windows.AI.MachineLearning 命名空间。