Interview - Machine Learning that's ACTUALLY easy with Richard Campbell
Do you want to try machine learning, but don't want to invest too much time learning a new programming language or some other complicated API or complicated online tools?
Richard Campbell and I are geeking out about why you would want to look at machine learning, how to get started, and what should you know when building your prototype. 🧐
ML.NET Model Builder opens up the world of Machine Learning to all developers.
I had a blast doing the interview. I hope you'll enjoy watching it as much as I enjoyed making it! 😁
Updated demo (screenshots)
Here are updated screenshots for ML .NET v1.4 Model Builder.
Figure: Start ML.NET Model Builder Wizzard.
Figure: Select Issue Classification.
Figure: Select file, column to predict (label) and input columns used for prediction.
Figure: Start training.
Figure: See results of training.
Figure: You can try out your model before generating the code.
Figure: Generate the code.
Figure: It generates 2 projects. ConsoleApp is testing purposes and Model project is the one that you can use in your apps.
Figure: In ConsoleApp you can see the usage of ML Model.
Bonus
When using ML .NET Model Builder, it will try to determine if a column should be a hash table or text, which can have a significant impact on your use case. It decides based on the ration of unique and duplicate values and it might choose the wrong type because of that.
However, after generating the code, you can change from a hash table to text and vice versa.
- In file
ModelBuilder.cs
in methodBuildTrainingPipeline
change the.Append
for desired column.
From:
.Append(mlContext.Transforms.Categorical.OneHotHashEncoding(new[] { new InputOutputColumnPair("Description", "Description") }))
To:
.Append(mlContext.Transforms.Text.FeaturizeText(inputColumnName: "Description", outputColumnName: "Description"))
Figure: Update the Append from Categorical hash to Featurize text.
- Retrain model by running
ModelBuilder.CreateModel();
inProgram.cs
. Return right after training because the model hasn't been copied yet tobin
folder.
Figure: Retrain model with feature text instead of categorical hash.
- Remove the code from step 2.
NOTE: If your project contains .
in it's name, chances are that the path to the model will be incorrect. (a bug since v1.3) Make sure that path MODEL_FILEPATH
in ModelBuilder.cs
is correct!
Figure: Model Builder has a bug in generating the right path if project contains a dot in the name.