sfspark.org: Kenneth Chan, PredictionIO
Recording: sfspark.org: Kenneth Chan, PredictionIO
so today I'm going to have a critic Chanel so so just in the zoo myself I'm co-founder of traditional and Laconia I'm the product manager of the Salesforce Einstein so today agenda we talk about what its protection angle and I would give time allows you I'll do a quick demo and I will also share more or less than I've learned since I've joining Salesforce so here I just give you a brief history of petitioner so we founded the company in 2013 as an open source machine learning server framework so our mission is to help companies to easily boom we were learning applications so in traumatic thing we bought the applaud party Salesforce and as we are part of the Apache Incubator project so in 2017 we are like thinking we are one of the top scholar open source project so here just to give a bit of traditional how do you speak into the cells of Einstein so we relational part of the app cow I'm fine so we offer prediction now on route code as a surface so it's an enterprise service we provide a high code like solution for YouTube to the machining application so so back in 2015 like our vision is we are when we started you know we have the following questions like why why white web application paper and so popular like why mobile application development is so popular so why so difficult appeal of machine learning application how do we make it easier to make everyone can do machine learning application and integrated AI intelligence into their apps so so in the lab I mean like when you do a machine on like the test what you do like you you write some code in the LabVIEW you just write like with the training data you Korean you train a model and then you make a prediction that's how you do you know you into ad hoc machine learning for all like this but then when you do a when you go to the production that you get a lot of things you need to consider like how do you how do you retain a model based on the new data or how do you like deployed model to to to serve a real-time curry how do you monitor the model so there's a lot of stuff to consider when you feel an affinity for machine learning into the real-world applications so if you look at today's machine earnings tax so basically we have like to be a machining okay you need to have a like underlying you have a data layer to get all the data and then you have a positing latitude to process the data to do the machining training to train a model and you have different kind of algorithms libraries that you can use on this positing layer and then the higher layers the other ABR the a player that serve the machine earnings model so prediction now is like a framework to help you to integrate all these pieces together so that you can focus on your business logic instead of just ended up doing all the integration works so prediction out musica p1 is be on top of these technologies but we be is gonna be on top of spark and we support HBase post-grant as the data store layer and we provide an API then you can do different kinds of machine learning engines on particular and then you can be product engine to be integrating into your application so this is a high-level overview of particular architecture so basically we have a different server that collect the defense from your app and then you can create your own prediction engine that take the data from the defense server and the engine can take the wheel charm query from your app and then January the political results based on your engine based on your model so I want to talk about the abstraction this is a very simple abstraction of the engine or petition out but actually is a very powerful because it fit to how you apply when you think about how you use machinery in a web application that's how you think about the problem so so basically depends curly and predictably salt so for example let's say unit you know video recommendation your defense basically is your user viewing behavior they view this video they get look at that video and you're clearly physical you're asking give me the top five videos so this user then you're the Pacific resulted mitigate the top five video IDs another example is like your for example is going let's say you want to predict how likely someone will stay on my my web service then your defense is your like browsing browsing behavior your to divide the envelope and then your career is like you asking the question how likely this visitor will spy on my surface then the potato resources like the probability the visit is potato will sign up the surface similar for sparing detection so the defense data basically it's a very simple structure that allows you to to model it for different kind of applications basically it's like event entity type who performed depends what kind of defenses in the time of the defense and we can you can also additional optional like properties to describe the defense like maybe to use a buy the item and the price is like $5 then you can edit the properties of the defense so so we have the defense took defenders collected a given server and in the engine can take the event data to train a model and then use the model to do the prediction to fill the prediction so I will talk about more about the engine so you do look at two days do you think about like like what's the machine learning process basically you follow these steps right you you read the data from the sources and then you with the train it up in the sources different kind of data sources and then you prepare data for the training purpose and then you train a model using a training data I think once you get a model given the query you use the model to make a prediction and then if the prediction you surf the fitting result results back to the applications and then till you vary the model basically you're comparing the particular stock with the actual result so the way we abstract it is we call the quality as a framework so basically we have data salt component they'd appropriate a component and algorithm components to take care for each time like serving component and you vary the component to take care of each of the function and then the DSP basic is the is the component to that concept the engine as a pretty expositional engine so this is a more details we want the engine basically decide we have the default sample to prepare the training data and you fit to the data preparation to prepare data for training purpose and then you prepared it again fit into the multiple algorithms with each one can shrink each their own model and this is the first phase of training training phase the next phase is the journey to serve the prediction so basically the algorithm would we take each model and then take the input curry from your applications each algorithm we use the model to generate the predict result and then combine the serving Campania we study the serving layer and then a serving lyric we serve the final predictive result back to the application so this is the architecture review like so physical addiction out internal server to collect the design from your mobile web server or web server then the data will be offline with fit into the engine training courses to train a model we use you can use part ml to train a model and then the model can the engine can forget the engine can get the model and be positive prediction server the particulars are basically served a real-time query and insert return the critic result at the same time you can also achieve the real-time data from the defense to to to make a prediction based on for example you can paste on the reason user history to make the January or features in a real-time and then use combined with the model and ensuring the predict result so prediction now over different kind of engine engine can place to help you to bootstrap your machine learning vacation so they're different kinds of engines and plate up we are pleased scoring we have recommendation or similar product or we have a universal recommender so these are contribute by many contributor and also somewhat official template we offer to help you let's say you are doing recommendations you can just download the recommendation 10 page and then you can start building your your integrity into your application right away so actually is to use very high technology so it is very easy you just build an engine trainer trainer model in a deployed basically free cup my line you can deploy machine learning application and then in decoded into your application let me see if I have enough time to show you I can show you a quick demo to kind of be to show you what I am talking about so first I will start on application ok first I will do the startup additional server so basically you will bring up the defense server and they can collect the defense and then here I've done ok I I use the tax tax classification as an example template so litigate this time I will show you to use the tactic of test classification that you can protect how likely this email is that spam or not spam so let me show you the code it's basically this is the the template the text classification can make I'm not sure can you see the is it too small so here you can see this is a text classification engine econ sort of B consists of data source separator algorithm and a serving later the algorithm you use stock ml basically the algorithm basically is take the tax data and into the ITF IDF transformation tokenize it and then use the language base to train a model on your based algorithm the trainer model and then there's the engine touches and basically is specified parameters to the engine so you can easily change the different parameters when you train the engine for example this is to define how many features generate the for the text so to trigger engine basically we do PIL train so in the wrong direction so this educational training please take a look back job and then start the training process in the meantime I'll show you the so these are all the defense I have already imported to the defense over here you can see the the text the subject and the label in the spam or not spam and when I click off the PR training basically you take all the defense data and ensuring the modem and you can see that model strain successfully then I can feed toilet so once that be part of the Apollo engine basically is the real-time server that can response the wing time crew and I can also go to this page to look at the status of the engine so please give you an information of the engine being deported is like the IB and also the parameters of the data preparation data solves an algorithm actually is a logic degree but an algorithm so let me show you this real-time curry for example s okay so up after I won the POV point basically there's a server running and a port a Dalton then I can send a real time to into the server to predict how likely it is a spam or not like very mature cache so we can see you with sponsoring time picketed without spam confidently you could give you the content in 0.7 and you can also changed deepen engine engine parameters and then you can create if an engine variant and then you can be prime multiple engines on two different parts and then you can have a make sure you can do AP testing of different engine as well and you can you know you know in a wheel drive application you can do like a be testing so you can have that you can run the traffic to the engine one and engine two and then you can compare to its out as well so only share a bit more lessons I've learned since we started to traditional so the one of the problem of them with data science on machine learning is how to translate your business problem to a machine learning problem so very often is not about choosing the right algorithms is more about like the feature and hearing part how what features you should use for to solve the your problem and how to know to do that you ki require lots of domain knowledge and lots of iterations and also how to test machine learning application is that is a challenge because think about it if I we should keep let's say for example if I tell you the spam is it is not spam and they give you the confidence but how do you know tip is not about I mean how do you notice it right along because you could be about there that affect the performance or or just because of the model so how the test the functionality is a challenge and and also the model quality is with you how do you currently every time you deploy a new model from the model perform at least satisfy certain criteria before you use the model and also you need to think about how to do the business metrics or performance metrics how do you measure let's say you do a recommendation video recommendation how do you measure the effect that the performance of your recommendation so you need to get a user feedback and annida to do some kind of offline metrics to to analyze this does the user actually click my recommendation and there are more things in the thing about the monitoring like how to you monitor the whole system and how do you manage all the different kinds of model for each kind of application so prediction is open source so you proofread the Charter and join our community and South loss also has the good trailhead program to to help you to understand the design nai any questions yeah so traditional is the framework that the TSV thing but then you can use different kind of library for to the feature engineering like in example we use spot ml to do the tf-idf transformation so to build it up to the developer to customize what we want to use but we provide a framework to integrate the whole stack like the data layer to collect all the defense and an integrated part and you can also deploy as a service to so if we return curly yeah I'm not expert of deep learning so I'm not creating it so basically you can use depending to create and they call embeddings so basically some kind of pattern features that I mean conceptually you can use the network to to generate features from image and you use this feature to to dance remodeling purpose I'm not experienced so that's the best I can okay thank you [Music] [Applause] [Music]