-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Description
We have a fun class called RoleMappedSchema. It operates over a class called ColumnInfo that looks like this:
machinelearning/src/Microsoft.ML.Core/Data/RoleMappedSchema.cs
Lines 18 to 22 in 98163f9
| public sealed class ColumnInfo | |
| { | |
| public readonly string Name; | |
| public readonly int Index; | |
| public readonly ColumnType Type; |
This structure is quite useful -- oftentimes we want to have names and types and indices of columns, all bundled together. We used this hundreds of places. In fact it was so useful we decided to build something Schema.Column that looked a little something like this:
machinelearning/src/Microsoft.ML.Core/Data/Schema.cs
Lines 86 to 106 in 98163f9
| public struct Column | |
| { | |
| /// <summary> | |
| /// The name of the column. | |
| /// </summary> | |
| public string Name { get; } | |
| /// <summary> | |
| /// The column's index in the schema. | |
| /// </summary> | |
| public int Index { get; } | |
| /// <summary> | |
| /// Whether this column is hidden (accessible only by index). | |
| /// </summary> | |
| public bool IsHidden { get; } | |
| /// <summary> | |
| /// The type of the column. | |
| /// </summary> | |
| public ColumnType Type { get; } |
Clearly this new more fundamental structure and the older legacy structure have some things in common. In fact, the newer structure is what we are going with for our public API, so we should probably remove that older legacy structure.
We will shift usage of ColumnInfo to use Schema.Column instead (nullables where appropriate, where things can be null), and then remove ColumnInfo.