Delen via


MLContext Class

Definition

The common context for all ML.NET operations. Once instantiated by the user, it provides a way to create components for data preparation, feature engineering, training, prediction, and model evaluation. It also allows logging, execution control, and the ability to set repeatable random numbers.

public sealed class MLContext
public sealed class MLContext : Microsoft.ML.Runtime.IHostEnvironment
type MLContext = class
    interface IHostEnvironment
    interface IChannelProvider
    interface IExceptionContext
    interface IProgressChannelProvider
Public NotInheritable Class MLContext
Public NotInheritable Class MLContext
Implements IHostEnvironment
Inheritance
MLContext
Implements

Constructors

MLContext(Nullable<Int32>)

Create the ML context.

Properties

AnomalyDetection

Trainers and tasks specific to anomaly detection problems.

BinaryClassification

Trainers and tasks specific to binary classification problems.

Clustering

Trainers and tasks specific to clustering problems.

ComponentCatalog

This is a catalog of components that will be used for model loading.

Data

Data loading and saving.

FallbackToCpu

Allow falling back to run on CPU if couldn't run on GPU.

Forecasting

Trainers and tasks specific to forecasting problems.

GpuDeviceId

GPU device ID to run execution on, null to run on CPU.

Model

Operations with trained models.

MulticlassClassification

Trainers and tasks specific to multiclass classification problems.

Ranking

Trainers and tasks specific to ranking problems.

Regression

Trainers and tasks specific to regression problems.

TempFilePath

Gets or sets the location for the temp files created by ML.NET.

Transforms

Data processing operations.

Events

Log

The handler for the log messages.

Explicit Interface Implementations

IChannelProvider.Start(String)
IChannelProvider.StartPipe<TMessage>(String)
IExceptionContext.ContextDescription
IExceptionContext.Process<TException>(TException)
IHostEnvironment.Register(String, Nullable<Int32>, Nullable<Boolean>)
IProgressChannelProvider.StartProgressChannel(String)

Applies to