{"record":{"id":"c983e9d04e3d57b5","repo":"dotnet/machinelearning","slug":"only-supported-feature-column-types-are-booleanda","errorCode":null,"errorMessage":"Only supported feature column types are {BooleanDataViewType.Instance}, {NumberDataViewType.Single}, and {TextDataViewType.Instance}. Please change the feature column {column.Name} of type {column.Type} to one of the supported types.","messagePattern":"Only supported feature column types are (.+?), (.+?), and (.+?)\\. Please change the feature column (.+?) of type (.+?) to one of the supported types\\.","errorType":"validation","errorClass":"ArgumentException","httpStatus":null,"severity":"error","filePath":"src/Microsoft.ML.AutoML/Utils/UserInputValidationUtil.cs","lineNumber":97,"sourceCode":"            }\n\n            foreach (var column in trainData.Schema)\n            {\n                if (column.Name == DefaultColumnNames.Features && column.Type.GetItemType() != NumberDataViewType.Single)\n                {\n                    throw new ArgumentException($\"{DefaultColumnNames.Features} column must be of data type {NumberDataViewType.Single}\", nameof(trainData));\n                }\n\n                if ((column.Name != columnInformation.LabelColumnName &&\n                    column.Name != columnInformation.UserIdColumnName &&\n                    column.Name != columnInformation.ItemIdColumnName &&\n                    column.Name != columnInformation.GroupIdColumnName)\n                    &&\n                        column.Type.GetItemType() != BooleanDataViewType.Instance &&\n                        column.Type.GetItemType() != NumberDataViewType.Single &&\n                        column.Type.GetItemType() != TextDataViewType.Instance)\n                {\n                    throw new ArgumentException($\"Only supported feature column types are \" +\n                        $\"{BooleanDataViewType.Instance}, {NumberDataViewType.Single}, and {TextDataViewType.Instance}. \" +\n                        $\"Please change the feature column {column.Name} of type {column.Type} to one of \" +\n                        $\"the supported types.\", nameof(trainData));\n                }\n            }\n        }\n\n        private static void ValidateColumnInformation(IDataView trainData, ColumnInformation columnInformation, TaskKind task)\n        {\n            ValidateColumnInformation(columnInformation);\n            ValidateTrainDataColumn(trainData, columnInformation.LabelColumnName, LabelColumnPurposeName, GetAllowedLabelTypes(task));\n            ValidateTrainDataColumn(trainData, columnInformation.ExampleWeightColumnName, WeightColumnPurposeName);\n            ValidateTrainDataColumn(trainData, columnInformation.SamplingKeyColumnName, SamplingKeyColumnPurposeName);\n            ValidateTrainDataColumn(trainData, columnInformation.UserIdColumnName, UserIdColumnPurposeName);\n            ValidateTrainDataColumn(trainData, columnInformation.ItemIdColumnName, ItemIdColumnPurposeName);\n            ValidateTrainDataColumn(trainData, columnInformation.GroupIdColumnName, GroupIdColumnPurposeName);\n            ValidateTrainDataColumns(trainData, columnInformation.CategoricalColumnNames, CategoricalColumnPurposeName,\n                new DataViewType[] { NumberDataViewType.Single, TextDataViewType.Instance });","sourceCodeStart":79,"sourceCodeEnd":115,"githubUrl":"https://github.com/dotnet/machinelearning/blob/7b76e69cf964daeca3f1377af6bc5543284d56c6/src/Microsoft.ML.AutoML/Utils/UserInputValidationUtil.cs#L79-L115","documentation":"Thrown when a training-data column that is not the label/userId/itemId/groupId column (i.e. is treated as a feature column) has an item type other than Boolean, Single (float), or Text. AutoML featurization only supports these primitive types for feature columns; everything else (double, int vectors, key types, DateTime) is rejected.","triggerScenarios":"Passing data with numeric columns typed as double/int/short, DateTime columns, or key-typed columns that are not declared as label/ignore/userId/itemId/groupId and are not pre-converted.","commonSituations":"C# model classes using double for measurements; CSV inference producing double columns; loading parquet/SQL data with int32 columns; forgetting to mark metadata/id columns as ignored.","solutions":["Convert unsupported numeric columns to float (Single) before Execute, e.g. via ConvertTransform.Type.Conversion to I8→R4 or by changing the C# type to float","Mark columns that are not real features as ignored columns (IgnoredColumnNames)","Pre-convert DateTime or key columns to text/float features with your own transforms before handing data to AutoML"],"exampleFix":"// before\npublic class ModelInput {\n    public double Temperature { get; set; } // unsupported feature type\n    public string Label { get; set; }\n}\n\n// after\npublic class ModelInput {\n    public float Temperature { get; set; }\n    public string Label { get; set; }\n}","handlingStrategy":"validation","validationCode":"foreach (var col in trainData.Schema)\n{\n    if (col.Name == colInfo.LabelColumnName) continue;\n    var t = col.Type.GetItemType();\n    if (t != BooleanDataViewType.Instance && t != NumberDataViewType.Single && t != TextDataViewType.Instance)\n        throw new InvalidOperationException($\"Column {col.Name} of type {t} is unsupported\");\n}","typeGuard":null,"tryCatchPattern":"try { var r = experiment.Execute(data, label, \"A\"); }\ncatch (ArgumentException ex) when (ex.Message.Contains(\"supported feature column types\")) { /* convert or ignore offending column, retry */ }","preventionTips":["Use float (not double/int) for numeric feature properties in ModelInput classes","Mark id/metadata columns as ignored in ColumnInformation","Pre-transform DateTime and key columns before handing data to AutoML"],"tags":["dotnet","mlnet","automl","schema","unsupported-type"],"backgroundTag":"unsupported-dtype","analyzedSha":"7b76e69cf964daeca3f1377af6bc5543284d56c6","analyzedAt":"2026-09-11T12:35:38.930Z","contentChangedAt":"2026-09-11T12:35:38.930Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}