Machine Learning with ML.NET 1.0 from Build 2019



[Applause] all right so welcome back we're live at Build 2019 my name is Cecil Philip had with me I have Cesar who's gonna talk to us a little bit about ML dotnet so C's it what do we start with just telling us a little bit about who you are and what exactly do you do sure yeah my pleasure to be hearing in this session so my name is Cesar datura I work as principal program manager in the doublet team with the almost 100% focus on ML dog net so machine learning for dotnet and donut developers so I'm very much of a machine learning novice here this machine learning there's AI like are those the same things and those different things like how does that kind of work yeah so let's say like AI is kind of the bigger subset and you can have like pre-built AI like cognitive services or you can have custom AI so amount of that is customized so you can build your own models with ml dotnet with code okay so that's kind of the difference between like AI with quality services ml dotnet is a framework most of all it's just like a nougat packages or so you can run em on the bed on any doughnut application that you are building either for training your model creating your model or when running the model for doing the predictions okay so again so I'm a little bit of a novice right so he said model yeah like when you say model is that like it's like is that kind like man like a great question like when we say model it's um maybe we should say ml model or machine learning model this is a very different thing than you know like data model which is just about data so ml model is is can be all the algorithms you're gonna run to make predictions oh you it's at the end of the day you can sterilize and save a model in a model net in a zip file and that's kind of the all the logic it's kind of the magic ball right and then you load it you load into your program that model among model and then you do predictions okay so let's talk about I know and well done that I think this week has gone 1.0 yep right so we've we've had a little bit of a track record of iterating on this product and making a little bit better so so tell me exactly like why do we why do we create them all down that and like right exactly this able tour and also related to that like today we are releasing in Melbourne I do one Oh but this is not something that we just created in the last year or last month I meant under it was internally being used by Microsoft for many other product groups like it's been used by the Asha team office windows power bi many product groups in their products internally and what we are doing is to make it available as a framework to dot the developers and in the last year we've been working on previews to make a better API so it was better usage for dotnet developers that's definitely what we've done so it's even when we are racing v1 we can say that the algorithms and everything it's is battle proofed on high scale on large project groups in in Microsoft that's one thing the other thing is why would you want to use a meld of that because there's also many other frameworks and approaches for for machine learning right so the first thing is that ml Dannette is especially made for dotnet developers if you have dogged skills you're a c-sharp developer and you don't need to learn a different language like python or psyche learn or different frameworks it just it's very simple to get a start with ml dotnet in c-sharp or F sharp or even this for basic and uncreate those models so that's one reason the other reason is where are you gonna run the models writing the that's this kind of engine for the models if you're most of your applications are net like ASP or net in production and so forth and you create models with non dotnet framework like in Python then you're gonna have a an issue on how to pass that into production if you do it with ml on that then it's straightforward you just build a model put it in your application run three lines of code and boom you have it okay so you mentioned that I can put ml down on in my application I could run these models yeah we have all done that dua is it purely for running models or can I train models and also consume them inside after that that's a great time because for instance so if you use Windows ml that's only to run models in Windows very with a very powerful way but ml dotnet is also for creating your models so you have your custom data in databases or in files datasets and then you create your model with that data and from scratch very specific to your industry or your business and then you you can do that in a console application you train the model in there and then once you have the model the zip file sterilized then you put it in your production application and run it for predictions okay so but the fundamental thing here for ml or not is that you create your custom models with your own data sign it so like ml for me has always been one of those things that sounds super cool like this is amazing this sounds like magic to me but like I find it hard sometimes for me to try and figure out well what are some good use cases for me to bring it inside of my application like what could I use it for how's it going to help my business right like let's say I'm in education or I'm in finance or something like that like Hulk in ml helped my own because we won anyone don't let developers there are not you know data scientist a per they are getting started we like to start from scenarios business reviews right instead of machine learning algorithms for machine learning tasks so for instance in the dotnet page you can see here quite a few scenarios right so you can create a custom sentiment analysis like getting tweets or or customer product reviews and see what kind of the the sentiment is about that or you can do product recommendations or or price prediction for houses or for any any other article or you can have a model for doing a sales forecasting fraud detection in like in credit card operations and so forth right all this is not just like that it's it's you could you could have like Android's of scenarios at the end of the day those scenarios you map it to machine learning tasks which are basically these ones like binary classification multi-class classification regression clustering ranking those kind of tasks but we like to start from from the scenarios so you can then understand what to use right so like all those things you said so amazing but I have no idea what those mean so as a.net developer that is never played with ml before and I don't have a background in like statistics or data analysis like what's the best way for me to get started mm-hm so to get a started you can get you can go to the to the side see different scenarios and then you can click on the samples so precisely we are highlighting these scenarios you can see here sentiment analysis spawn detection fraud and those are grouped by the ML tasks binary classification or classic classifying issues or classifying type of flowers that would be multi class so you can see kind of a way to see samples and then what's gonna be internally done right but eventually you will need to understand what are the machine learning tasks in order to map from your business problem to a machine learning task that's why we are providing all these samples and but again ml donor is a framework so it's most of all about the API so what developers will need to see in order to train a model and I'm showing now a sample it's like a console application where you will train a model so basically you see this API you are loading your data from a file in this case would be I have a bunch of customer feedback and then I want to get I want to know about the sentiment analysis about that so I load the data and then I transform the data I need to transfer all the text to numeric vectors I select the algorithm in this case SDA is the CA and finally you can training right just call the method fit and and at the end you save it into a file so this is not a lot of code it's just a few lines like 20 lines but there are a few challenging points here which is okay how do I know what kind of algorithm should I use here right if you are not you know specialized on machine learning you're just not developer these are challenging challenge challenges that you will get right so um that's why we are also creating and by the way I just want to run it this demo so basically you created the DES model yeah you put it in a wool application in this case it's a web app and I'm showing here and while I'm typing here because it's blaze 4 as well in the client side it will tell you what what's the sentiment right so for instance I could say this is bad and it's bad sentiment I can say this is awesome and then it's a great sentiment right or whatever you want to type here but in order to create a model what we are doing is we we are not just providing tutorials on how to do it and explaining all the API we are also creating automation or automatic generation of the models based on your data and even generate the code for you so that's a great way to get started because you provide your data not just the data that we use in the in the sample and you can here you can do it on two ways one way in relative three ways one way would be to use the CLI tool that we have so for instance here you can see that I just have some data in the in this this file in fact I'm gonna I'm gonna remove this folder because it's gonna be what I'm gonna generate later so I have just data like comments about customers with feedback so for instance you can see that this is why I love this place so this is good sentiment or this one would know would not go back that's bad so that's negative and then you have all that data here with this data you train your model you could do it with the code that I previously showed but then it would be a little bit challenging for someone getting started but just with the data you can use the CLI and if I type this line you can see Emma let out a train the task is binary classification I'd want to know if the comment is good or bad then I provide my data and here I provide the label column which is what I want to predict which is true or false and finally how much time is going to be looking for that in this case just twenty seconds in twenty seconds is going to be trying different combinations different models different algorithms for you and at the end is going to generate that code of course in 20 seconds it's going to be just some best model but if you are working with a lot of data large data sets then this can be maybe hours but it'll do the work for you but you can see you have the the different algorithms that were it was trying yeah and then also the generated code if I go now to the same folder I see now this sample with a solution with the code that I'm not going to get into it now but it's it would be pretty similar to the sample that I was showing but how to generate it for you and targeting your own data so so two questions I kind of have coming off of that yeah now cheap-looking when you have like a fairly significant application my data is in different formats I might have something in a sequel database I might have maybe a collection of files that are just in a folder somewhere or I mask some stuff in Excel or something like that like what do I have to do to prepare my application to be ml ready or what I have to do to actually get it prepared to be trained Oh data to be used for training right yeah that's a great question so the most typical way is to have just files like text files or CSV with each columns separated for the other one with coma or or or tops that's the most typical thing but also we support reading your data from relational database okay so for instance even when most of the samples are using just datasets and files if I go to here to the samples here you can see we also have one sample where you can train your model reading data from a database which is using any different where in this case okay cool that's also and then the second question I wanted to ask you I saw you had a CLI yeah right so so where did that come from that's not let's see a lie that's something different yeah so that's your I told ml Nets your lie so there's a special command line tools for MLM net for generating this code and your model and you have all the information in Doc's marker so calm but basically I'm by the way the CLI and the tooling is in preview and although that as a framework is released well but the CLI is previewed at but since this tooling is perfectly fine for for production as well but you would go here and you can see how to install the CLI but basically it's as simple as running daughter to install ml n so it's a global tool you you install it with that line it's a newly package that will get installed in your machine and once you have run this this line then you have it here in your machine like ml net help and it's in there okay okay also so then pretty much like we just get asked folks to go over to the dots make sure they check it out and then I'm guessing you're it's open source and get up so they can submit issues and give you feedback so let them know what you think about it in in a very similar way than the CLI we also improve you have created this source to the extension which is called model builder okay so you could do the same thing like with the custom scenario it will ask you for your data you know from a file like text file or you can also point to a database and get the data from a table in the database and a guided step-by-step so from data train evaluate and then generate the code darkling in your business to do cars as well also so so I'm all done that where is this available like can I can I put this in my Yammer nap and my dotnet desktop app can I put it my web app like is it dotnet framework is it down at core like how exactly yeah we consume this so basically ml of that is it's a framework nougat packages and you can run it on dotnet core or fooled or dotnet framework traditional dot the framework and then we support as of today 32 bits or 64 bits yeah okay so that means donut core can run on Linux Mac OS or Windows or if you run it on on donna Strangler then would be Windows in upcoming versions we will support also arm as a processor so we will support also running your model on a mobile device like summer in but currently we still don't support that or any other ARM based device like IOT okay right now it has to be x86 or x64 Linux Windows Mac or Windows 10 it alright cool so we have some questions coming in let's let's check this out really quickly from Kevin and Kevin is asking how challenging would it be to run OCR in ml down that compared to you using something like as your OCR cognitive service so cognitive services is complimentary with with Semillon ed for higher level scenarios and cognitive submission Aereo's might be challenging but you you also have text analysis in ml of net for instance you could have a bunch of text coming from I don't know like github issues that people are submitting and you want to classify all those issues or bugs and analyze that and classified those bugs if they are related to networking or related to data or different things so you can train a model with text as well so text analytics and uncreate these kind of things but we we don't provide like higher level scenarios like OCR because that would be done with with this lower level so it's a it's a framework you can create those scenarios but it's a it's about machine learning tasks not great well hey season thank you so much for coming out I really appreciate it and we hope all of you enjoyed everything you learned from Caesar today make sure you go to Docs that Microsoft calm and check out ml dotnet and let us know what you can start a build with machine learning and dotnet thank you [Applause]

2 thoughts on “Machine Learning with ML.NET 1.0 from Build 2019”

Leave a Reply

Your email address will not be published. Required fields are marked *