{"id":1243,"date":"2021-11-20T08:29:17","date_gmt":"2021-11-20T08:29:17","guid":{"rendered":"https:\/\/salarydistribution.com\/machine-learning\/2021\/11\/20\/understand-drivers-that-influence-your-forecasts-with-explainability-impact-scores-in-amazon-forecast\/"},"modified":"2021-11-20T08:29:17","modified_gmt":"2021-11-20T08:29:17","slug":"understand-drivers-that-influence-your-forecasts-with-explainability-impact-scores-in-amazon-forecast","status":"publish","type":"post","link":"https:\/\/salarydistribution.com\/machine-learning\/2021\/11\/20\/understand-drivers-that-influence-your-forecasts-with-explainability-impact-scores-in-amazon-forecast\/","title":{"rendered":"Understand drivers that influence your forecasts with explainability impact scores in Amazon Forecast"},"content":{"rendered":"<div id=\"\">\n<p>We\u2019re excited to launch explainability impact scores in <a href=\"https:\/\/aws.amazon.com\/forecast\/\" target=\"_blank\" rel=\"noopener noreferrer\">Amazon Forecast<\/a>, which help you understand the factors that impact your forecasts for specific items and time durations of interest. Forecast is a managed service for developers that uses machine learning (ML) to generate more accurate demand forecasts, without requiring any ML experience. To increase forecast model accuracy, you can add additional information or attributes such as price, promotion, category details, holidays, or weather information to your forecasting model, but you may not know how each attribute influences your forecast. With today\u2019s launch, you can now understand how each attribute impacts your forecasted values using the explainability feature, which we discuss in this post.<\/p>\n<p>ML-based forecasting models, which are more accurate than heuristic rules or human judgment, can drive significant improvement in revenue and customer experience. However, business leaders often lose trust in technology when they see forecasted numbers drastically differing from their intuition, and may find it hard to trust ML systems. Because demand planning decisions have a high impact on the business, business leaders may end up overriding forecasts because they may believe that they have to take the forecast model predictions at face value to make critical business decisions, without understanding why those forecasts were generated and what factors are influencing forecasts to be higher or lower. This can lead to compromising forecast accuracy, and you may lose the benefit of ML forecasting.<\/p>\n<p>Amazon Forecast now provides explainability, which gives you item-level insights across your preferred time duration. Having a certain level of understanding on why a particular forecast value is high or low at a particular time is helpful for decision-making and building trust and confidence in your ML solutions. Explainability reports include impact scores, which help you understand how each attribute in your training data contributes to either increasing or decreasing your forecasted values for specific items. In addition, you can choose to understand explainability for your entire forecast horizon or for specific time durations. Explainability removes the need of running multiple manual analyses to understand past sales and external variable trends to explain forecast results.<\/p>\n<h2>How to interpret explainability impact scores<\/h2>\n<p>Explainability helps you better understand how the attributes, such as price, category, or holidays, in your datasets impact your forecast values. Forecast uses a metric called <em>impact scores<\/em> to quantify the relative impact of each attribute and determine whether they generally increase or decrease forecast values.<\/p>\n<p>Impact scores measure the relative impact attributes have on forecast values. For example, if the <code>price<\/code> attribute has an impact score that is twice as large as the <code>brand_id<\/code> attribute, you can conclude that the price of an item has twice the impact on forecast values than the product brand. Impact scores also provide information on whether an attribute increases or decreases the forecasted value. A negative impact score reflects that the attribute tends to decrease the value of the forecast.<\/p>\n<p>Impact scores measure the relative impact of attributes to each other, not the absolute impact. If an attribute has a low impact score, that doesn\u2019t necessarily mean that it has a low impact on forecast values; it means that it has a lower impact on forecast values than other attributes used by the predictor. If you change attributes in your predictor, the impact scores may differ, and the attribute with the low impact score may have a higher score relative to other attributes. Also, you can\u2019t use impact scores to determine whether particular attributes improve the model accuracy or not. You should use <a href=\"https:\/\/docs.aws.amazon.com\/forecast\/latest\/dg\/metrics.html\" target=\"_blank\" rel=\"noopener noreferrer\">accuracy metrics<\/a> such as weighted quantile loss and others provided by Forecast to access predictor accuracy.<\/p>\n<p>In the following graph, we take an example of an explainability report graph that shows the relative impact of different attributes on the forecasted value of item_d 1 across all the time points in the forecast horizon. We see that the relative impact is in the following order: <code>Price<\/code> has the highest impact, followed by <code>StoreLocation<\/code>, then <code>Promo<\/code> and <code>Holiday_US<\/code>. <code>Price<\/code> has the highest influence item_id 1 and tends to increase the forecast value. <code>StoreLocation<\/code> has the second highest impact on item_id 1 but tends to decrease the forecast value. Because <code>Promo<\/code> is close to 0.2 impact score, <code>Price<\/code> has five times more impact than <code>Promo<\/code> on the forecasted value of item_id 1, and both attributes tend to increase the forecast value. <code>Holiday_US<\/code> has an impact score of 0, which means that this attribute doesn\u2019t increase or decrease the forecast value for item_id 1 relative to other attributes.<\/p>\n<p><a href=\"https:\/\/d2908q01vomqb2.cloudfront.net\/f1f836cb4ea6efb2a0b1b99f41ad8b103eff4b59\/2021\/11\/18\/1-5898-Console.png\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-30997 size-full\" src=\"https:\/\/d2908q01vomqb2.cloudfront.net\/f1f836cb4ea6efb2a0b1b99f41ad8b103eff4b59\/2021\/11\/18\/1-5898-Console.png\" alt=\"\" width=\"800\" height=\"444\"><\/a><\/p>\n<p>The following image shows an example of the explainability report export file with the impact scores for specific time series and time points as well as aggregated scores across those time series and time points.<\/p>\n<p><a href=\"https:\/\/d2908q01vomqb2.cloudfront.net\/f1f836cb4ea6efb2a0b1b99f41ad8b103eff4b59\/2021\/11\/18\/image-29.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-31032 size-full\" src=\"https:\/\/d2908q01vomqb2.cloudfront.net\/f1f836cb4ea6efb2a0b1b99f41ad8b103eff4b59\/2021\/11\/18\/image-29.jpg\" alt=\"\" width=\"800\" height=\"364\"><\/a><\/p>\n<h2>Generate explainability impact scores<\/h2>\n<p>In this section, we walk through how to generate explainability impact scores for your forecasts using the Forecast console. To use the new <a href=\"https:\/\/docs.aws.amazon.com\/forecast\/latest\/dg\/API_CreateExplainability.html\" target=\"_blank\" rel=\"noopener noreferrer\">CreateExplainability API<\/a>, refer to the <a href=\"https:\/\/github.com\/aws-samples\/amazon-forecast-samples\/tree\/main\/notebooks\/advanced\/Item_Level_Explainability\" target=\"_blank\" rel=\"noopener noreferrer\">notebook<\/a> in our GitHub repo or review <a href=\"https:\/\/docs.aws.amazon.com\/forecast\/latest\/dg\/forecast-explainability.html\" target=\"_blank\" rel=\"noopener noreferrer\">Forecast Explainability<\/a>.<\/p>\n<ol>\n<li>On the Forecast console, create a dataset group. Upload your historical demand dataset as target time series followed by related time series or item metadata that you want to use for more accurate forecasting and for which you\u2019re interested in seeing explainability impact scores.<\/li>\n<\/ol>\n<p><a href=\"https:\/\/d2908q01vomqb2.cloudfront.net\/f1f836cb4ea6efb2a0b1b99f41ad8b103eff4b59\/2021\/11\/18\/3-5898-Dashboard.png\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-30999 size-full\" src=\"https:\/\/d2908q01vomqb2.cloudfront.net\/f1f836cb4ea6efb2a0b1b99f41ad8b103eff4b59\/2021\/11\/18\/3-5898-Dashboard.png\" alt=\"\" width=\"800\" height=\"522\"><\/a><\/p>\n<ol start=\"2\">\n<li>In the navigation pane, under your dataset, choose <strong>Predictors<\/strong>.<\/li>\n<li>Choose <strong>Train new<\/strong> <strong>predictor<\/strong>.<\/li>\n<\/ol>\n<p>Forecast defaults to <strong>AutoPredictor<\/strong> as the default training option. No further action is needed from you, but remember that only forecasts generated from a model that has been trained with AutoPredictor are eligible for later generating explainability impact scores for specific forecasts.<\/p>\n<ol start=\"4\">\n<li>Now that your model is trained, choose <strong>Forecasts<\/strong> in the navigation pane.<\/li>\n<li>Choose <strong>Create a forecast<\/strong>.<\/li>\n<li>Select your trained predictor to create a forecast.<\/li>\n<li>Choose <strong>Insights <\/strong>in the navigation pane.<\/li>\n<li>Choose <strong>Create explainability<\/strong>.<\/li>\n<\/ol>\n<p><a href=\"https:\/\/d2908q01vomqb2.cloudfront.net\/f1f836cb4ea6efb2a0b1b99f41ad8b103eff4b59\/2021\/11\/18\/4-5898-Insights.png\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-31001 size-full\" src=\"https:\/\/d2908q01vomqb2.cloudfront.net\/f1f836cb4ea6efb2a0b1b99f41ad8b103eff4b59\/2021\/11\/18\/4-5898-Insights.png\" alt=\"\" width=\"800\" height=\"553\"><\/a><\/p>\n<ol start=\"9\">\n<li>Choose the forecast that you want to generate explainability impact scores for.<\/li>\n<li>Choose if you want to see impact scores for all the time points in the forecast horizon or only for a specific time duration.<\/li>\n<\/ol>\n<p>You can specify up to 500 consecutive time points per explainability report.<\/p>\n<p><a href=\"https:\/\/d2908q01vomqb2.cloudfront.net\/f1f836cb4ea6efb2a0b1b99f41ad8b103eff4b59\/2021\/11\/18\/4-5898-Create.png\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-31000 size-full\" src=\"https:\/\/d2908q01vomqb2.cloudfront.net\/f1f836cb4ea6efb2a0b1b99f41ad8b103eff4b59\/2021\/11\/18\/4-5898-Create.png\" alt=\"\" width=\"800\" height=\"942\"><\/a><\/p>\n<ol start=\"11\">\n<li>Upload the list of specific time series for which you want to see explainability impact scores.<\/li>\n<\/ol>\n<p>A time series is a unique combination of item ID and dimension. You can specify up to 50 time series per Forecast explainability.<\/p>\n<p><a href=\"https:\/\/d2908q01vomqb2.cloudfront.net\/f1f836cb4ea6efb2a0b1b99f41ad8b103eff4b59\/2021\/11\/18\/5-5898.png\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-31002 size-full\" src=\"https:\/\/d2908q01vomqb2.cloudfront.net\/f1f836cb4ea6efb2a0b1b99f41ad8b103eff4b59\/2021\/11\/18\/5-5898.png\" alt=\"\" width=\"800\" height=\"938\"><\/a><\/p>\n<ol start=\"12\">\n<li>Specify the schema of the CSV file that you have uploaded.<\/li>\n<li>Choose <strong>Create explainability<\/strong>.<\/li>\n<\/ol>\n<p><a href=\"https:\/\/d2908q01vomqb2.cloudfront.net\/f1f836cb4ea6efb2a0b1b99f41ad8b103eff4b59\/2021\/11\/18\/6-5898-Create.png\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-31003 size-full\" src=\"https:\/\/d2908q01vomqb2.cloudfront.net\/f1f836cb4ea6efb2a0b1b99f41ad8b103eff4b59\/2021\/11\/18\/6-5898-Create.png\" alt=\"\" width=\"800\" height=\"942\"><\/a><\/p>\n<p>It takes less than an hour to generate the explainability impact scores.<\/p>\n<ol start=\"14\">\n<li>When the job status is active, choose the explainability job to view the impact score.<\/li>\n<\/ol>\n<p><a href=\"https:\/\/d2908q01vomqb2.cloudfront.net\/f1f836cb4ea6efb2a0b1b99f41ad8b103eff4b59\/2021\/11\/18\/7-5898-Insights.png\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-31004 size-full\" src=\"https:\/\/d2908q01vomqb2.cloudfront.net\/f1f836cb4ea6efb2a0b1b99f41ad8b103eff4b59\/2021\/11\/18\/7-5898-Insights.png\" alt=\"\" width=\"800\" height=\"528\"><\/a><\/p>\n<p>Here you can review the explainability impact score graph. You can use the controls at the top of the graph to drill down to specific time series or time points or view at an aggregated level.<\/p>\n<p><a href=\"https:\/\/d2908q01vomqb2.cloudfront.net\/f1f836cb4ea6efb2a0b1b99f41ad8b103eff4b59\/2021\/11\/18\/8-5898-my_explainability.png\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-31005 size-full\" src=\"https:\/\/d2908q01vomqb2.cloudfront.net\/f1f836cb4ea6efb2a0b1b99f41ad8b103eff4b59\/2021\/11\/18\/8-5898-my_explainability.png\" alt=\"\" width=\"800\" height=\"977\"><\/a><\/p>\n<ol start=\"15\">\n<li>To export all the impact scores, choose <strong>Create explainability export<\/strong> in the <strong>Explainability exports<\/strong><\/li>\n<li>Provide the export details and choose <strong>Create explainability export<\/strong>.<\/li>\n<\/ol>\n<p><a href=\"https:\/\/d2908q01vomqb2.cloudfront.net\/f1f836cb4ea6efb2a0b1b99f41ad8b103eff4b59\/2021\/11\/18\/9-5898-Create-explainability.png\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-31006 size-full\" src=\"https:\/\/d2908q01vomqb2.cloudfront.net\/f1f836cb4ea6efb2a0b1b99f41ad8b103eff4b59\/2021\/11\/18\/9-5898-Create-explainability.png\" alt=\"\" width=\"800\" height=\"551\"><\/a><\/p>\n<p>The export is saved in an <a href=\"http:\/\/aws.amazon.com\/s3\" target=\"_blank\" rel=\"noopener noreferrer\">Amazon Simple Storage Service<\/a> (Amazon S3) bucket that you specify.<\/p>\n<ol start=\"17\">\n<li>When the export is complete, navigate to your S3 bucket to review the explainability report CSV file.<\/li>\n<\/ol>\n<p><a href=\"https:\/\/d2908q01vomqb2.cloudfront.net\/f1f836cb4ea6efb2a0b1b99f41ad8b103eff4b59\/2021\/11\/18\/10-5898.png\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-31007 size-full\" src=\"https:\/\/d2908q01vomqb2.cloudfront.net\/f1f836cb4ea6efb2a0b1b99f41ad8b103eff4b59\/2021\/11\/18\/10-5898.png\" alt=\"\" width=\"800\" height=\"977\"><\/a><\/p>\n<p>The following is an example of your explainability export CSV file. Depending on how large your dataset is, multiple files may be exported.<\/p>\n<p><a href=\"https:\/\/d2908q01vomqb2.cloudfront.net\/f1f836cb4ea6efb2a0b1b99f41ad8b103eff4b59\/2021\/11\/18\/image-29.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-31032 size-full\" src=\"https:\/\/d2908q01vomqb2.cloudfront.net\/f1f836cb4ea6efb2a0b1b99f41ad8b103eff4b59\/2021\/11\/18\/image-29.jpg\" alt=\"\" width=\"800\" height=\"364\"><\/a><\/p>\n<h2>Aggregate explainability impact scores for category level analysis<\/h2>\n<p>You may want to review explainability for a group of items together, which can have more than 50 items. For example, a grocery retailer might be interested in understanding what is driving the forecasts for all their fruits and vegetables, and this category may consist of more than 50 SKUs in their data. However, Forecast lets you specify up to 50 time series per Forecast explainability job. If you have more than 50 time series, you need to run the explainability job multiple times with different items in each job and then combine them.<\/p>\n<p>The explainability export file provides two type of impact scores: normalized impact scores and raw impact scores. Raw impact scores are based on Shapley values and aren\u2019t scaled or bounded. Normalized impact scores scale the raw scores to a value between -1 and 1. Raw impact scores are useful for combining and comparing scores across different explainability resources. Use the raw impact scores of all the time series across multiple explainability jobs to aggregate, then compare it to find the relative influence of each attribute. You can view an example on how to do so by following the <a href=\"https:\/\/github.com\/aws-samples\/amazon-forecast-samples\/tree\/main\/notebooks\/advanced\/Item_Level_Explainability\" target=\"_blank\" rel=\"noopener noreferrer\">notebook<\/a> in our GitHub repo.<\/p>\n<h2>Conclusion<\/h2>\n<p>Forecast now provides explainability for specific items and time durations of interest. With the explainability feature, you can understand how each attribute impacts your forecasted values. To learn more, review <a href=\"https:\/\/docs.aws.amazon.com\/forecast\/latest\/dg\/forecast-explainability.html\" target=\"_blank\" rel=\"noopener noreferrer\">Forecast Explainability<\/a> and the <a href=\"https:\/\/github.com\/aws-samples\/amazon-forecast-samples\/tree\/main\/notebooks\/advanced\/Item_Level_Explainability\" target=\"_blank\" rel=\"noopener noreferrer\">notebook<\/a> in our GitHub repo. If you are interested in aggregated explainability for all your items at the predictor level, review our blog on using the CreateAutoPredictor API <a class=\"c-link\" href=\"https:\/\/aws.amazon.com\/blogs\/machine-learning\/new-amazon-forecast-api-that-creates-up-to-40-more-accurate-forecasts-and-provides-explainability\/\" target=\"_blank\" rel=\"noopener noreferrer\" data-stringify-link=\"https:\/\/aws.amazon.com\/blogs\/machine-learning\/new-amazon-forecast-api-that-creates-up-to-40-more-accurate-forecasts-and-provides-explainability\/\" data-sk=\"tooltip_parent\" data-remove-tab-index=\"true\">here<\/a>. Explainability is available in all Regions where Forecast is publicly available. For more information about Region availability, see <a href=\"https:\/\/aws.amazon.com\/about-aws\/global-infrastructure\/regional-product-services\/\" target=\"_blank\" rel=\"noopener noreferrer\">AWS Regional Services<\/a>.<\/p>\n<hr>\n<h3>About the Authors<\/h3>\n<p><strong><img decoding=\"async\" loading=\"lazy\" class=\"size-full wp-image-18301 alignleft\" src=\"https:\/\/d2908q01vomqb2.cloudfront.net\/f1f836cb4ea6efb2a0b1b99f41ad8b103eff4b59\/2020\/11\/12\/Namita-Das.jpg\" alt=\"\" width=\"100\" height=\"133\">Namita<\/strong> <strong>Das<\/strong> is a Sr. Product Manager for Amazon Forecast. Her current focus is to democratize machine learning by building no-code\/low-code ML services. On the side, she frequently advises startups and loves training her dog with new tricks.<\/p>\n<p><strong><img decoding=\"async\" loading=\"lazy\" class=\"size-full wp-image-31012 alignleft\" src=\"https:\/\/d2908q01vomqb2.cloudfront.net\/f1f836cb4ea6efb2a0b1b99f41ad8b103eff4b59\/2021\/11\/18\/Dima-Fayyad.jpg\" alt=\"\" width=\"100\" height=\"127\"> Dima Fayyad<\/strong> is a Software Development Engineer on the Amazon Forecast team. She is passionate about machine learning and AI and is currently working on large-scale distributed systems in the forecasting space. In her free time, she enjoys exploring different cuisines, traveling, and skiing.<\/p>\n<p><strong><img decoding=\"async\" loading=\"lazy\" class=\"size-full wp-image-31013 alignleft\" src=\"https:\/\/d2908q01vomqb2.cloudfront.net\/f1f836cb4ea6efb2a0b1b99f41ad8b103eff4b59\/2021\/11\/18\/Youngsuk-Park.png\" alt=\"\" width=\"100\" height=\"116\"><\/strong><strong>Youngsuk Park<\/strong> is a Machine Learning Scientist at AWS AI and Amazon Forecast. His research lies in the interplay between machine learning, optimization, and decision-making, with over 10 publications in top-notch ML\/AI venues. Before joining AWS, he obtained a PhD from Stanford University.<\/p>\n<p><strong><img decoding=\"async\" loading=\"lazy\" class=\"size-full wp-image-22475 alignleft\" src=\"https:\/\/d2908q01vomqb2.cloudfront.net\/f1f836cb4ea6efb2a0b1b99f41ad8b103eff4b59\/2021\/03\/09\/Shannon-Killingsworth.jpg\" alt=\"\" width=\"101\" height=\"116\">Shannon Killingsworth<\/strong> is a UX Designer for Amazon Forecast. His current work is creating console experiences that are usable by anyone, and integrating new features into the console experience. In his spare time, he is a fitness and automobile enthusiast.<\/p>\n<p>       <!-- '\"` -->\n      <\/div>\n","protected":false},"excerpt":{"rendered":"<p>https:\/\/aws.amazon.com\/blogs\/machine-learning\/understand-drivers-that-influence-your-forecasts-with-explainability-impact-scores-in-amazon-forecast\/<\/p>\n","protected":false},"author":0,"featured_media":1244,"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\/1243"}],"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=1243"}],"version-history":[{"count":0,"href":"https:\/\/salarydistribution.com\/machine-learning\/wp-json\/wp\/v2\/posts\/1243\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/salarydistribution.com\/machine-learning\/wp-json\/wp\/v2\/media\/1244"}],"wp:attachment":[{"href":"https:\/\/salarydistribution.com\/machine-learning\/wp-json\/wp\/v2\/media?parent=1243"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/salarydistribution.com\/machine-learning\/wp-json\/wp\/v2\/categories?post=1243"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/salarydistribution.com\/machine-learning\/wp-json\/wp\/v2\/tags?post=1243"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}