Share via


CustomMappingCatalog.FilterByStatefulCustomPredicate<TSrc,TState> Method

Definition

Drop rows where a specified predicate returns true. This filter allows to maintain a per-cursor state.

public static Microsoft.ML.IDataView FilterByStatefulCustomPredicate<TSrc,TState> (this Microsoft.ML.DataOperationsCatalog catalog, Microsoft.ML.IDataView input, Func<TSrc,TState,bool> filterPredicate, Action<TState> stateInitAction) where TSrc : class, new() where TState : class, new();
static member FilterByStatefulCustomPredicate : Microsoft.ML.DataOperationsCatalog * Microsoft.ML.IDataView * Func<'Src, 'State, bool (requires 'Src : null and 'Src : (new : unit -> 'Src) and 'State : null and 'State : (new : unit -> 'State))> * Action<'State (requires 'State : null and 'State : (new : unit -> 'State))> -> Microsoft.ML.IDataView (requires 'Src : null and 'Src : (new : unit -> 'Src) and 'State : null and 'State : (new : unit -> 'State))
<Extension()>
Public Function FilterByStatefulCustomPredicate(Of TSrc As {Class, New}, TState As {Class, New}) (catalog As DataOperationsCatalog, input As IDataView, filterPredicate As Func(Of TSrc, TState, Boolean), stateInitAction As Action(Of TState)) As IDataView

Type Parameters

TSrc

The class defining which columns to take from the incoming data.

TState

The type that describes per-cursor state.

Parameters

catalog
DataOperationsCatalog

The data operations catalog.

input
IDataView

The input data.

filterPredicate
Func<TSrc,TState,Boolean>

A predicate, that takes an input of type TSrc and a state object of type TState, and returns true if the row should be filtered (dropped) and false otherwise.

stateInitAction
Action<TState>

The action to initialize the state object, that is called once before the cursor is initialized.

Returns

Applies to