Skip to content

CookBook sample - Could not find input column 'CategoricalOneHot' #2485

Closed
@sdg002

Description

@sdg002

System information

  • OS version/distro:Windows 10
  • .NET Version (eg., dotnet --info): 4.6

Issue

Source code / logs

        // Build several alternative featurization pipelines.
        var pipeline =
            // Convert each categorical feature into one-hot encoding independently.
            mlContext.Transforms.Categorical.OneHotEncoding("CategoricalFeatures", "CategoricalOneHot")
            // Convert all categorical features into indices, and build a 'word bag' of these.
            .Append(mlContext.Transforms.Categorical.OneHotEncoding("CategoricalFeatures", "CategoricalBag", Microsoft.ML.Transforms.Categorical.OneHotEncodingTransformer.OutputKind.Bag))
            // One-hot encode the workclass column, then drop all the categories that have fewer than 10 instances in the train set.
            .Append(mlContext.Transforms.Categorical.OneHotEncoding("Workclass", "WorkclassOneHot"))
            .Append(mlContext.Transforms.FeatureSelection.SelectFeaturesBasedOnCount("WorkclassOneHot", "WorkclassOneHotTrimmed", count: 10));

Please paste or attach the code or logs or traces that would be helpful to diagnose the issue you are reporting.
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    need infoThis issue needs more info before triage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions