85 references to ColumnPurpose
Microsoft.ML.AutoML (84)
API\AutoCatalog.cs (5)
821var textFeatures = columnPurposes.Where(c => c.Purpose == ColumnPurpose.TextFeature); 822var numericFeatures = columnPurposes.Where(c => c.Purpose == ColumnPurpose.NumericFeature 825var booleanFeatures = columnPurposes.Where(c => c.Purpose == ColumnPurpose.NumericFeature && !numericFeatures.Contains(c)); 826var catalogFeatures = columnPurposes.Where(c => c.Purpose == ColumnPurpose.CategoricalFeature); 827var imagePathFeatures = columnPurposes.Where(c => c.Purpose == ColumnPurpose.ImagePath);
ColumnInference\ColumnGroupingInference.cs (11)
29public ColumnPurpose Purpose; 32public GroupingColumn(string name, DataKind kind, ColumnPurpose purpose, Range[] ranges) 85private static int GetPurposeGroupId(int columnIndex, ColumnPurpose purpose) 87if (purpose == ColumnPurpose.CategoricalFeature || 88purpose == ColumnPurpose.TextFeature || 89purpose == ColumnPurpose.Ignore) 94private static string GetName(DataKind itemKind, ColumnPurpose purpose, List<GroupingColumn> previousColumns) 108private static string GetPurposeName(ColumnPurpose purpose, DataKind itemKind) 112case ColumnPurpose.NumericFeature: 121case ColumnPurpose.CategoricalFeature: 124return Enum.GetName(typeof(ColumnPurpose), purpose);
ColumnInference\ColumnInferenceApi.cs (1)
72IEnumerable<(string, ColumnPurpose)> purposeResults = null;
ColumnInference\ColumnInformationUtil.cs (26)
12internal static ColumnPurpose? GetColumnPurpose(this ColumnInformation columnInfo, string columnName) 16return ColumnPurpose.Label; 21return ColumnPurpose.Weight; 26return ColumnPurpose.GroupId; 31return ColumnPurpose.SamplingKey; 36return ColumnPurpose.CategoricalFeature; 41return ColumnPurpose.NumericFeature; 46return ColumnPurpose.TextFeature; 51return ColumnPurpose.Ignore; 56return ColumnPurpose.UserId; 61return ColumnPurpose.ItemId; 66return ColumnPurpose.ImagePath; 72internal static ColumnInformation BuildColumnInfo(IEnumerable<(string name, ColumnPurpose purpose)> columnPurposes) 80case ColumnPurpose.Label: 83case ColumnPurpose.Weight: 86case ColumnPurpose.SamplingKey: 89case ColumnPurpose.CategoricalFeature: 92case ColumnPurpose.Ignore: 95case ColumnPurpose.NumericFeature: 98case ColumnPurpose.UserId: 101case ColumnPurpose.ItemId: 104case ColumnPurpose.GroupId: 107case ColumnPurpose.TextFeature: 110case ColumnPurpose.ImagePath: 145public static IDictionary<ColumnPurpose, int> CountColumnsByPurpose(ColumnInformation columnInformation) 147var result = new Dictionary<ColumnPurpose, int>();
ColumnInference\PurposeInference.cs (15)
23public readonly ColumnPurpose Purpose; 25public Column(int columnIndex, ColumnPurpose purpose) 48private ColumnPurpose _suggestedPurpose; 55public ColumnPurpose SuggestedPurpose 69public IntermediateColumn(IDataView data, int columnId, ColumnPurpose suggestedPurpose = ColumnPurpose.Ignore) 152column.SuggestedPurpose = ColumnPurpose.CategoricalFeature; 156column.SuggestedPurpose = ColumnPurpose.TextFeature; 158column.SuggestedPurpose = ColumnPurpose.Ignore; 161column.SuggestedPurpose = ColumnPurpose.ImagePath; 175column.SuggestedPurpose = ColumnPurpose.NumericFeature; 189column.SuggestedPurpose = ColumnPurpose.NumericFeature; 203column.SuggestedPurpose = ColumnPurpose.TextFeature; 215column.SuggestedPurpose = ColumnPurpose.Ignore; 255intermediateCol = new IntermediateColumn(data, i, ColumnPurpose.Ignore);
DatasetDimensions\DatasetDimensionsApi.cs (1)
31if (itemType.IsText() && purpose.Purpose == ColumnPurpose.CategoricalFeature)
TransformInference\TransformInference.cs (22)
72public readonly ColumnPurpose Purpose; 75public IntermediateColumn(string name, DataViewType type, ColumnPurpose purpose, ColumnDimensions dimensions) 179var lastLabelColId = Array.FindLastIndex(columns, x => x.Purpose == ColumnPurpose.Label); 207if (column.Purpose == ColumnPurpose.UserId || 208column.Purpose == ColumnPurpose.ItemId) 230if (column.Purpose == ColumnPurpose.GroupId && !column.Type.IsKey()) 253if (column.Purpose != ColumnPurpose.CategoricalFeature) 300if (!column.Type.GetItemType().IsBool() || column.Purpose != ColumnPurpose.NumericFeature) 328if (!column.Type.GetItemType().IsText() || column.Purpose != ColumnPurpose.TextFeature) 354&& column.Purpose == ColumnPurpose.NumericFeature 380if (!column.Type.GetItemType().IsText() || column.Purpose != ColumnPurpose.ImagePath) 397var intermediateCols = columns.Where(c => c.Purpose != ColumnPurpose.Ignore) 437if (intermediateCol.Purpose == ColumnPurpose.NumericFeature && 445var labelColumnName = intermediateCols.FirstOrDefault(c => c.Purpose == ColumnPurpose.Label)?.ColumnName; 449var groupColumnName = intermediateCols.FirstOrDefault(c => c.Purpose == ColumnPurpose.GroupId)?.ColumnName; 452intermediateCols = intermediateCols.Where(c => c.Purpose == ColumnPurpose.NumericFeature || 453c.Purpose == ColumnPurpose.CategoricalFeature || c.Purpose == ColumnPurpose.TextFeature || 454c.Purpose == ColumnPurpose.ImagePath); 465intermediateCols.First().Purpose == ColumnPurpose.CategoricalFeature || 466intermediateCols.First().Purpose == ColumnPurpose.TextFeature || 467intermediateCols.First().Purpose == ColumnPurpose.ImagePath))
TransformInference\TransformPostTrainerInference.cs (1)
34var labelColumn = columns.First(c => c.Purpose == ColumnPurpose.Label);
Utils\DatasetColumnInfo.cs (2)
13public readonly ColumnPurpose Purpose; 16public DatasetColumnInfo(string name, DataViewType type, ColumnPurpose purpose, ColumnDimensions dimensions)
Microsoft.ML.AutoML.Tests (1)
TransformInferenceTests.cs (1)
669foreach (var columnPurpose in new[] { ColumnPurpose.UserId, ColumnPurpose.ItemId })