<jupyter_start><jupyter_text>This example comes from the ML.NET documentation: https://docs.microsoft.com/en-us/dotnet/api/microsoft.ml.categoricalcatalog.onehothashencoding?view=ml-dotnet<jupyter_code>class DataPoint
{
    public string Education { get; set; }

    public string ZipCode { get; set; }
}

class TransformedData
{
    public float[] Education { get; set; }

    public float[] ZipCode { get; set; }
}
var mlContext = new MLContext();
var samples = new[]
{
    new DataPoint {Education = "0-5yrs", ZipCode = "98005"},
    new DataPoint {Education = "0-5yrs", ZipCode = "98052"},
    new DataPoint {Education = "5-11yrs", ZipCode = "98005"},
    new DataPoint {Education = "5-11yrs", ZipCode = "98052"},
    new DataPoint {Education = "11-16yrs", ZipCode = "98005"}
};
IDataView data = mlContext.Data.LoadFromEnumerable(samples);<jupyter_output><empty_output><jupyter_text>Multi column example: A pipeline for one hot has encoding two columns 'Education' and 'ZipCode'.<jupyter_code>var multiColumnKeyPipeline = mlContext.Transforms.Categorical.OneHotHashEncoding(
    new[]
    {
        new InputOutputColumnPair("Education"),
        new InputOutputColumnPair("ZipCode")
    },
    numberOfBits: 3
);
var transformedData = multiColumnKeyPipeline.Fit(data).Transform(data);
mlContext.Data.CreateEnumerable<TransformedData>(transformedData, reuseRowObject: false)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.12357954545454546, 'fraction_numerical': 0.028409090909090908, 'mean_word_length': 5.073275862068965, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 10, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '548407', 'license': 'MIT', 'n_tokens_mistral': 496, 'n_tokens_neox': 438, 'n_words': 100, 'path': 'OneHotHashEncoding.ipynb', 'repo_name': 'rvernagus/simple-ml.net-examples', 'size': '1408'}