IMLFeatureProvider インターフェイス

定義

入力または出力機能を定義し、その値へのアクセスを許可するインターフェイス。

[Foundation.Protocol(Name="MLFeatureProvider", WrapperType=typeof(CoreML.MLFeatureProviderWrapper))]
[ObjCRuntime.Introduced(ObjCRuntime.PlatformName.WatchOS, 4, 0, ObjCRuntime.PlatformArchitecture.All, null)]
[ObjCRuntime.Introduced(ObjCRuntime.PlatformName.TvOS, 11, 0, ObjCRuntime.PlatformArchitecture.All, null)]
[ObjCRuntime.Introduced(ObjCRuntime.PlatformName.MacOSX, 10, 13, ObjCRuntime.PlatformArchitecture.Arch64, null)]
[ObjCRuntime.Introduced(ObjCRuntime.PlatformName.iOS, 11, 0, ObjCRuntime.PlatformArchitecture.All, null)]
public interface IMLFeatureProvider : IDisposable, ObjCRuntime.INativeObject
type IMLFeatureProvider = interface
    interface INativeObject
    interface IDisposable
派生
属性
実装

注釈

CoreML は、システム ネイティブ データの読み取りと書き込みを直接行いません。 代わりに、このクラスを使用して、オブジェクトの入力と出力の値に文字列を MLModel マップします。

次の例は、3 つの入力変数 (すべての型double) を提供する T:Monotouch.CoreML.IMLFeatureProvider を示しています。

public class MarsHabitatPricerInput : NSObject, IMLFeatureProvider
{
	public double SolarPanels { get; set; }
	public double Greenhouses { get; set; }
	public double Size { get; set; }

	public NSSet<NSString> FeatureNames => new NSSet<NSString>(new NSString("solarPanels"), new NSString("greenhouses"), new NSString("size"));

	public MLFeatureValue GetFeatureValue(string featureName)
	{
		switch (featureName)
		{
			case "solarPanels":
				return MLFeatureValue.Create(SolarPanels);
			case "greenhouses":
				return MLFeatureValue.Create(Greenhouses);
			case "size":
				return MLFeatureValue.Create(Size);
			default:
				return MLFeatureValue.Create(0);
		}
	}
}

プロパティ

FeatureNames

によって定義されている機能の MLModel名前。

Handle

アンマネージド オブジェクト表現へのハンドル (ポインター)。

(継承元 INativeObject)

メソッド

GetFeatureValue(String)

の値を取得します。

適用対象