{"id":264,"date":"2020-09-24T19:51:39","date_gmt":"2020-09-24T19:51:39","guid":{"rendered":"https:\/\/machine-learning.webcloning.com\/2020\/09\/24\/score-streaming-data-with-a-machine-learning-model\/"},"modified":"2020-09-24T19:51:39","modified_gmt":"2020-09-24T19:51:39","slug":"score-streaming-data-with-a-machine-learning-model","status":"publish","type":"post","link":"https:\/\/salarydistribution.com\/machine-learning\/2020\/09\/24\/score-streaming-data-with-a-machine-learning-model\/","title":{"rendered":"Score streaming data with a machine learning model"},"content":{"rendered":"<div id=\"\">\n<!-- begin main body content --><\/p>\n<p><strong>This is part of the <a href=\"https:\/\/developer.ibm.com\/series\/getting-started-with-ibm-streams-learning-path\">Learning path: Get started with IBM Streams<\/a><\/strong>.<\/p>\n<h2 id=\"summary\">Summary<\/h2>\n<p>In this developer code pattern, we will be streaming online shopping data and using the data to track the products that each customer has added to the cart. We will build a k-means clustering model with scikit-learn to group customers according to the contents of their shopping carts. The cluster assignment can be used to predict additional products to recommend.<\/p>\n<h2 id=\"description\">Description<\/h2>\n<p>Our application will be built using IBM Streams on IBM Cloud Pak\u00ae for Data. IBM Streams provides a built-in IDE, called Streams Flows, that allows you to visually create a streaming app. The IBM Cloud Pak for Data platform provides additional support, such as integration with multiple data sources, built-in analytics, Jupyter Notebooks, and machine learning.<\/p>\n<p>To build and deploy our machine learning model, we will use a Jupyter Notebook in IBM Watson\u00ae Studio and a Watson Machine Learning instance. In our examples, both are running on IBM Cloud Pak for Data.<\/p>\n<p>Using the Streams Flows editor, we will create a streaming app with the following operators:<\/p>\n<ul>\n<li>A Source operator that generates sample clickstream data<\/li>\n<li>A Filter operator that keeps only the \u201cadd to cart\u201d events<\/li>\n<li>A Code operator where we use Python code to arrange the shopping cart items into an input array for scoring<\/li>\n<li>A WML Deployment operator to assign the customer to a cluster<\/li>\n<li>A Debug operator to demonstrate the results<\/li>\n<\/ul>\n<h2 id=\"flow\">Flow<\/h2>\n<p><img class=\"lazycontent\" data-src=\"https:\/\/developer.ibm.com\/developer\/default\/patterns\/score-streaming-data-with-a-machine-learning-model\/images\/flow.png\" alt=\"flow\"><\/p>\n<ol>\n<li>User builds and deploys a machine learning model.<\/li>\n<li>User creates and runs an IBM Streams application.<\/li>\n<li>The Streams Flow UI shows streaming, filtering, and scoring in action.<\/li>\n<\/ol>\n<h2 id=\"instructions\">Instructions<\/h2>\n<p>Ready to get started? The <a href=\"https:\/\/github.com\/IBM\/ibm-streams-with-ml-model\/blob\/master\/README.md\">README<\/a> explains the steps to:<\/p>\n<ol>\n<li>Verify access to your IBM Streams instance on Cloud Pak for Data.<\/li>\n<li>Create a new project in Cloud Pak for Data.<\/li>\n<li>Build and store a model.<\/li>\n<li>Associate the deployment space with the project.<\/li>\n<li>Deploy the model.<\/li>\n<li>Create and run a Streams Flow application.<\/li>\n<\/ol>\n<p>Congratulations! This code pattern wraps up the <a href=\"https:\/\/developer.ibm.com\/series\/getting-started-with-ibm-streams-learning-path\">Get started with IBM Streams series<\/a>. In addition to explaining IBM Streams, we\u2019ve shown how to: <\/p>\n<ul>\n<li>Create your first IBM Streams app without writing code<\/li>\n<li>Build an Apache Kafka streaming app<\/li>\n<li>Build a streaming app using a Python API<\/li>\n<li>Score streaming data with a machine learning model<\/li>\n<\/ul>\n<p>You should now have a fundamental understanding of IBM Streams and some of its features. If you want to learn more, take a look at the <a href=\"https:\/\/developer.ibm.com\/series\/introduction-to-streaming-analytics-with-ibm-streams\/\">Introduction to streaming analytics with IBM Streams<\/a> video series.<\/p>\n<\/p><\/div>\n","protected":false},"excerpt":{"rendered":"<p>https:\/\/developer.ibm.com\/patterns\/score-streaming-data-with-a-machine-learning-model\/<\/p>\n","protected":false},"author":0,"featured_media":265,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[3],"tags":[],"_links":{"self":[{"href":"https:\/\/salarydistribution.com\/machine-learning\/wp-json\/wp\/v2\/posts\/264"}],"collection":[{"href":"https:\/\/salarydistribution.com\/machine-learning\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/salarydistribution.com\/machine-learning\/wp-json\/wp\/v2\/types\/post"}],"replies":[{"embeddable":true,"href":"https:\/\/salarydistribution.com\/machine-learning\/wp-json\/wp\/v2\/comments?post=264"}],"version-history":[{"count":0,"href":"https:\/\/salarydistribution.com\/machine-learning\/wp-json\/wp\/v2\/posts\/264\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/salarydistribution.com\/machine-learning\/wp-json\/wp\/v2\/media\/265"}],"wp:attachment":[{"href":"https:\/\/salarydistribution.com\/machine-learning\/wp-json\/wp\/v2\/media?parent=264"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/salarydistribution.com\/machine-learning\/wp-json\/wp\/v2\/categories?post=264"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/salarydistribution.com\/machine-learning\/wp-json\/wp\/v2\/tags?post=264"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}