2
2
// The .NET Foundation licenses this file to you under the MIT license.
3
3
// See the LICENSE file in the project root for more information.
4
4
5
+ using System ;
5
6
using System . Collections . Generic ;
6
7
using Microsoft . Data . DataView ;
7
8
@@ -18,7 +19,7 @@ namespace Microsoft.ML.Data
18
19
/// features column. New predictors can implement <see cref="ISchemaBindableMapper"/> directly. Implementing <see cref="ISchemaBindableMapper"/>
19
20
/// includes implementing a corresponding <see cref="ISchemaBoundMapper"/> (or <see cref="ISchemaBoundRowMapper"/>) and a corresponding ISchema
20
21
/// for the output schema of the <see cref="ISchemaBoundMapper"/>. In case the <see cref="ISchemaBoundRowMapper"/> interface is implemented,
21
- /// the SimpleRow class can be used in the <see cref="IRowToRowMapperBase .GetRow"/> method.
22
+ /// the SimpleRow class can be used in the <see cref="IRowToRowMapper .GetRow"/> method.
22
23
/// </summary>
23
24
[ BestFriend ]
24
25
internal interface ISchemaBindableMapper
@@ -55,20 +56,36 @@ internal interface ISchemaBoundMapper
55
56
}
56
57
57
58
/// <summary>
58
- /// This interface combines <see cref="ISchemaBoundMapper"/> with <see cref="IRowToRowMapper "/>.
59
+ /// This interface extends <see cref="ISchemaBoundMapper"/>.
59
60
/// </summary>
60
61
[ BestFriend ]
61
- internal interface ISchemaBoundRowMapper : ISchemaBoundMapper , IRowToRowMapperBase
62
+ internal interface ISchemaBoundRowMapper : ISchemaBoundMapper
62
63
{
63
64
/// <summary>
64
- /// There are two schemas from <see cref="ISchemaBoundMapper"/> and <see cref="IRowToRowMapper"/>.
65
- /// Since the two parent schema's are identical in all derived classes, we merge them into <see cref="OutputSchema"/>.
65
+ /// Input schema accepted.
66
66
/// </summary>
67
- new DataViewSchema OutputSchema { get ; }
67
+ DataViewSchema InputSchema { get ; }
68
68
69
69
/// <summary>
70
70
/// Given a set of columns, from the newly generated ones, return the input columns that are needed to generate those output columns.
71
71
/// </summary>
72
72
IEnumerable < DataViewSchema . Column > GetDependenciesForNewColumns ( IEnumerable < DataViewSchema . Column > dependingColumns ) ;
73
+
74
+ /// <summary>
75
+ /// Get an <see cref="DataViewRow"/> with the indicated active columns, based on the input <paramref name="input"/>.
76
+ /// The active columns are those for which <paramref name="active"/> returns true. Getting values on inactive
77
+ /// columns of the returned row will throw. Null predicates are disallowed.
78
+ ///
79
+ /// The <see cref="DataViewRow.Schema"/> of <paramref name="input"/> should be the same object as
80
+ /// <see cref="InputSchema"/>. Implementors of this method should throw if that is not the case. Conversely,
81
+ /// the returned value must have the same schema as <see cref="ISchemaBoundMapper.OutputSchema"/>.
82
+ ///
83
+ /// This method creates a live connection between the input <see cref="DataViewRow"/> and the output <see
84
+ /// cref="DataViewRow"/>. In particular, when the getters of the output <see cref="DataViewRow"/> are invoked, they invoke the
85
+ /// getters of the input row and base the output values on the current values of the input <see cref="DataViewRow"/>.
86
+ /// The output <see cref="DataViewRow"/> values are re-computed when requested through the getters. Also, the returned
87
+ /// <see cref="DataViewRow"/> will dispose <paramref name="input"/> when it is disposed.
88
+ /// </summary>
89
+ DataViewRow GetRow ( DataViewRow input , Func < int , bool > active ) ;
73
90
}
74
91
}
0 commit comments