 Hello everyone, my name is Luis Cabrera and I work in the Azure Machine Learning Organization, but today we're going to cook ourselves a recommendations model. One of the missions of Cortana Analytics is to in a sense democratize machine learning. We want to make sure machine learning is available to everyone, not just to data scientists but also to developers. We want to make sure that everyone has the capabilities to harness the power of machine learning. One way in which we're doing that is by providing to you what we call machine learning APIs. These machine learning APIs are completed services that you can find today in the Cortana Analytics Gallery. These are already baked, they use machine learning capabilities but you do not need to be a data scientist in order to use them. Today we're going to be talking about one specific API called the Recommendations API. Let me start with the story. When I was a kid and I wanted to watch a cooking show in my native country of Guatemala, there were only two channels that I could watch at any time. So my probability of getting the best channel at any time was about 50 percent and that was great. But today my children, you know, if you have a service like Xbox, you really have over 100,000 streaming options to prick from, which makes it very, very hard to find the content that you need. So actually for Xbox, we built a recommendations engine and in our desire to democratize or to bring to the world these capabilities, we put these capabilities together in the Recommendations API. So let's get cooking. What you're going to need to create a recommendations model is some catalog data. These are like the items that you want to sell, for instance, or that you want to recommend. You will need some usage data which represent the previous transactions that you have seen in your application or your retail site, for instance. So you mix these two pieces together, I will show you what these files look like. You mix them in this beautiful recommendations builder, you let it bake for a few minutes and then you are ready to serve in your favorite website or mobile application. Okay, so let's get cooking here. So first of all, I am going to gallery.cortanaanalytics.com where I can see several machine learning related resources for you, including machine learning APIs. So if I click on machine learning APIs, it will show me a catalog of different APIs that we have available for you. For instance, we have face APIs, text analytics, computer vision APIs, et cetera, but today we're interested in the recommendations API. So I'm going to select that one where now you can see a description of the service and links to the documentation and so forth. You will notice that you can also sign up for the service. I have already signed up, so I am not going to do it right now, but I have to tell you that you actually are able to sign up for 10,000 free transactions per month and not for you to be able to play with the service. And once you have signed up for the service, you can use the recommendations UI which is in beta right now, and I actually have already opened the service which is right here. Once you are in the recommendations UI, you can create new projects. Let me create a new project, I will call it connect, and this project is going to be my container where I can add the usage, the catalog files, and where I can later train my model. So it just created the model, and step by step it asks me to add a catalog file. So I actually have a catalog file with transactions from the Microsoft Store actually. So I am going to use my catalog from the Microsoft Store. As you can see, it was able to upload the catalog. Now the question that you may have is, what does that catalog actually look like? Let me show you. So that catalog has a very simple format. It shows you that there is items, the identifier for each of the items. In the next row, it will give you a description of the items and then a description of what type of item is in my catalog. So in this case, these are all items from the Microsoft Store, for instance. So I want to be able to recommend to a customer when they are buying one product what other type of product will make sense for them to purchase as well. It will allow them to discover those items faster as well. So I need information or metadata about my catalog, and then I also need information about each of the transactions. In column A here, I have the actual identifier for users, and in column B here, I have the identifier for particular products. So for instance, in the first row here, I know that a person with ID 3BFF, DC, blah, blah, blah, but item QR 2000011, which may be a piece of software or a piece of hardware, for instance. So the system is able to take the catalog and then the usage files, and I will just add a usage file here, and you can see that it's starting to upload the usage file as well. So once it has both of these pieces of information, it can crunch the information to create a recommendations model for you. I should point out that usage files should be less than 200 megabytes in size, and if you have more than 200 megabytes of information, you are allowed to upload several files. Okay, so once you have the catalog and usage file, you can actually create a new build. The first file uploaded, and I am in the process of uploading a second file. Once the files have uploaded to the system, you can create a new build. And you can pick a type of build. We have two types of build recommendations and frequently bought together. We also have a ranking build, but that's an advanced feature that you can check in the documentation for now. So let's say that we want a recommendations build, and then all I will have to do here is click build, and then this is going to take about 30 minutes. Okay, so after the 30 minutes, we are able to see our build, and we can actually score it. So in this case, I have to tell you that I did add images, and you don't see how I am adding the images, but when you select an item, you will be able to see the recommendations for that item. So in this case, we have Mike Wosowski, the infinity figure, and you can see the recommendations for that item right here are other infinity figures, which makes sense. You know, if a child buys this item, they may want to buy the other ones as well. So if someone on the other hand were to buy a game like Assassin's Creed, which is a more mature game, we will expect to get recommendations that are a little bit more mature, right? So Sage Anarchy Reigns, Men in Black, Fuse, which makes sense, right? These are other games for Xbox 360, which people purchase when they purchase the Assassin's Creed game. So in this case, you can see how as I pass one item to the recommendations engine, it is able to return to me other items. Now, this is all great, and you already have a model by now, but I have to tell you that if you go to the gallery, you are also able to download the code to do exactly what we did in that UI. It's actually pretty simple, and I'll walk you through it. This is actually the exact code that you download in the sample. So all you need to do is, just like we did in the UI, you need to create a model, which is what we're doing there on the create model call. Then you need to import a catalog and a usage file, which are the selected lines right there. Once you have imported those lines, you want to trigger a build, which is done in the next line. So you want to build a model, you pass the model ID, and then the rest of the code really is in a tight loop, just waiting for that build to be completed. Once the build is completed, you need to update the model to use that build ID or that build as the default build. This will allow you in the future to have several builds and then select which one is the one that your model should be returning recommendations from. So it was actually very simple. You notice how we were able to use the UI to create a recommendations engine, but you can also automate it in code as well. I should point out that you can retrain the model as you get new usage data as well. I should point out that there is other related content that you may be interested in. We actually gave a presentation on intelligent retail scenarios at the Cortana Analytics Workshop, and it's on Channel 9, so this is the link. And you can find me at luiscaatmicrosoft.com, and that's my Twitter tag as well. Thank you so much, and it has been a pleasure spending some time cooking with you.