Microsoft.ML.Runtime Namespace

Namespace containing types needed by the ML.NET runtime.

Classes

ComponentCatalog

This catalogs instantiable components (aka, loadable classes). Components are registered via a descendant of Microsoft.ML.LoadableClassAttributeBase, identifying the names and signature types under which the component type should be registered. Signatures are delegate types that return void and specify that parameter types for component instantiation. Each component may also specify an "arguments object" that should be provided at instantiation time.

ProgressHeader

This is the 'header' of the progress report.

Structs

ChannelMessage

A channel message.

Interfaces

IChannel

A standard communication channel.

IChannelProvider

A channel provider can create new channels and generic information pipes.

IComponentFactory

This is a token interface that all component factories must implement.

IComponentFactory<TComponent>

An interface for creating a component with no extra parameters (other than an IHostEnvironment).

IComponentFactory<TArg1,TComponent>

An interface for creating a component when we take one extra parameter (and an IHostEnvironment).

IComponentFactory<TArg1,TArg2,TComponent>

An interface for creating a component when we take two extra parameters (and an IHostEnvironment).

IComponentFactory<TArg1,TArg2,TArg3,TComponent>

An interface for creating a component when we take three extra parameters (and an IHostEnvironment).

IExceptionContext

Interface for "processing" exceptions before they are thrown. This can be used to add context to the exception, wrap the exception in another one, totally replace the exception, etc. It is not legal to return null from Process (unless null was passed in, which really shouldn't happen).

IHost

A host is coupled to a component and provides random number generation and concurrency guidance. Note that the random number generation, like the host environment methods, should be accessed only from the main thread for the component.

IHostEnvironment

The host environment interface creates hosts for components. Note that the methods of this interface should be called from the main thread for the environment. To get an environment to service another thread, call Fork and pass the return result to that thread.

IPipe<TMessage>

A generic information pipe. Note that pipes are disposable. Generally, Done should be called before disposing to signal a normal shut-down of the pipe, as opposed to an aborted completion.

IProgressChannel

A common interface for progress reporting. It is expected that the progress channel interface is used from only one thread.

Supported workflow:

  1. Create the channel via StartProgressChannel(String).
  2. Call SetHeader(ProgressHeader, Action<IProgressEntry>) as many times as desired (including 0). Each call to SetHeader(ProgressHeader, Action<IProgressEntry>) supersedes the previous one.
  3. Report checkpoints (0 or more) by calling Checkpoint(Nullable<Double>[]).
  4. Repeat steps 2-3 as often as necessary.
  5. Dispose the channel.
IProgressChannelProvider

This is a factory interface for IProgressChannel. Both IHostEnvironment and IProgressChannel implement this interface, to allow for nested progress reporters.

REVIEW: make IChannelProvider implement this, instead of the environment?

IProgressEntry

A metric/progress holder item.

Enums

ChannelMessageKind

The kinds of standard channel messages. Note: These values should never be changed. We can add new kinds, but don't change these values. Other code bases, including native code for other projects depends on these values.

MessageSensitivity

A flag that can be attached to a message or exception to indicate that it has a certain class of sensitive data. By default, messages should be specified as being of unknown sensitivity, which is to say, every sensitivity flag is turned on, corresponding to Unknown. Messages that are totally safe should be marked as None. However, if, say, one prints out data from a file (for example, this might be done when expressing parse errors), it should be flagged in that case with UserData.