ML.NET Model Builder: Machine learning with .NET

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] hey everyone my name's brie achman and i'm the pm for ml.net and if you don't know ml.net is the machine learning framework for net developers it's open source and cross-platform um it allows you to build custom models without having a background in data science or machine learning um and you can also stay in the net ecosystem and use the tools and languages that you already know now that malibu's not hogging the camera i'm going to give a quick demo to show you what the ml.net team has been working on and show you a little sneak peek of what we're going to do at net conf um some really exciting news model builder is finally going to ga which is uh if you haven't used model builder it's ml.net's tooling and visual studio um so that's what i'm going to show off here today for this demo i'm going to use ml.net and model builder to build train deploy and consume a machine learning model for predictive maintenance so say you wanted to automate predicting when a device is going to need maintenance using sensor data and that's the data set that i have here there's about 10 000 rows so 10 000 entries of different devices with a product id a type some sensor readings such as air temperature the torque tool wear number minutes the process temperature rotational speed and so on and i'm going to use these features in order to predict whether a machine is going to fail or not but i'm going to do this with a twist i'm going to try and build train deploy and consume this model in three minutes or less and i'm going to put the timer on the screen so you all can follow along and make sure that i can actually do it so here i have visual studio 2022 open and i've gone ahead and created a new.net 6 console application you can see it just prints hello world out to the console right now but this is the app that i want to add machine learning to so with that let's start the countdown and first thing i'm going to do is right click on my project in the solution explorer and add a machine learning model here it'll open up the add new item dialog and defaults to machine learning model for ml.net and i can name it whatever i want let's call it machine failure predictor and once i hit add it will open up the model builder ui as well as create this mb config file that saves the state of the ui there's a variety of scenarios to choose from but i want to predict whether a machine will fail or not so that's classifying tabular data so we'll choose data classification and i'm going to train locally on my cpu and i'm going to choose my data set i can choose it from a file or sql from sql server i just have it locally and then i'm going to choose the machine failure to predict because that's so that's i want to predict whether a machine will fail or not so that will be this column right here zero for no failure one for failure and there's a few columns that i really don't need for my prediction and it might actually make my model worse so i'm gonna go to advanced data options and hit and choose to ignore these columns um so for instance twf and hdf and all of these these columns indicate what the failure was and we don't need that for trying to predict um whether there was a failure or not okay so from there i'll save my preferences and you can see um a little preview of the data here to make sure all is good and so i'm going to give it 60 seconds to train as soon as i start training and you'll see down in the output window um automated machine learning or automl is being used to iterate through different models so it's trying out different algorithms algorithm options different data transformations in order to find the best model so you'll see a bunch of the different algorithms that are being tried out and so far in the 20 seconds that it's been training it's found a great model that's about 98 let's say i'm happy with that so i'm going to hit stop training and instead of having to wait the whole entire time or having to cancel and start over um i can just take the model that it's found so the best model it's found so far this fast forest ova model so i'm going to go over to evaluate and here it just takes the first row my data i can try out and predict right in the ui use my model and it predicts that with these stats it would uh it's a machine that wouldn't fail which makes sense for something that probably hasn't been used or hasn't been used and then i'm going to go to the consume step so here what i could do is copy and paste this into the console application but i actually want to deploy it as a web api so i'm going to add the web api to my solution and you can see it generates all the code that i need and um this is the consumption logic right here the training code if you wanted to retrain in the actual model file is here um the program.cs is where that uh prediction route and handler are so this is one of those minimal web apis you might have seen and from here all i would have to do is right click and publish and walk through to publish it to azure and from there i could use it like any other dot net web api as you can see i'm that was under three minutes i know i didn't technically publish it um but it would take a few minutes to do publish that to azure but at least you can see how easy it is to build train deploy and then use these machine learning models and i'll show you real quick how you would use it as well locally just to try it out so i'll change my startup project to the web api and i'll run it and then once it starts running we'll give it a try and of course i didn't write any code yet so let me once it starts running i'll switch over and this is going to be the um where the web api is and we'll call that predict handler and hit send and there you go it predicted this is again that first row of data here it predicted it predicted that the machine was not a failure with a confidence of 99 and if we played around with it a bit more let's add some zeros and try again you can see this time it predicted um with pretty high confidence that the machine would would actually fail so this demo showed a really simple example and in the real world you'd want to understand your problem really dig into your data and be able to explain your model but for net conf on wednesday november 10th louise and i will have a session all about ml.net to talk about the new features and show a really awesome demo in model builder so make sure you tune in
Info
Channel: dotnet
Views: 33,993
Rating: undefined out of 5
Keywords: .NET
Id: cUqNzZwzUV0
Channel Id: undefined
Length: 6min 52sec (412 seconds)
Published: Wed Nov 10 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.