{"id":7601,"date":"2023-09-22T10:37:59","date_gmt":"2023-09-22T18:37:59","guid":{"rendered":"https:\/\/live-cometml.pantheonsite.io\/?p=7601"},"modified":"2025-04-24T17:13:57","modified_gmt":"2025-04-24T17:13:57","slug":"monitoring-your-time-series-model-in-comet","status":"publish","type":"post","link":"https:\/\/www.comet.com\/site\/blog\/monitoring-your-time-series-model-in-comet\/","title":{"rendered":"Monitoring Your Time Series Model in Comet"},"content":{"rendered":"\n<link rel=\"canonical\" href=\"https:\/\/www.comet.com\/site\/blog\/monitoring-your-time-series-model-in-comet\">\n\n\n\n<div class=\"fh fi fj fk fl\">\n<div class=\"ab ca\">\n<div class=\"ch bg et eu ev ew\">\n<p id=\"e8f4\" class=\"pw-post-body-paragraph lt lu fo be b lv lw lx ly lz ma mb mc md me mf mg mh mi mj mk ml mm mn mo mp fh bj\" data-selectable-paragraph=\"\">In this tutorial, we will go through steps on how to use Comet to monitor our time-series forecasting model. We will carry out some EDA on our dataset, and then we will log the visualizations onto the Comet experimentation website or platform. Without further ado, let\u2019s begin.<\/p>\n<h1 id=\"0b83\" class=\"mq mr fo be ms mt mu mv mw mx my mz na nb nc nd ne nf ng nh ni nj nk nl nm nn bj\" data-selectable-paragraph=\"\">Time Series Models<\/h1>\n<p id=\"20b0\" class=\"pw-post-body-paragraph lt lu fo be b lv no lx ly lz np mb mc md nq mf mg mh nr mj mk ml ns mn mo mp fh bj\" data-selectable-paragraph=\"\">Time series models are a type of statistical model that are used to analyze and make predictions about data that is collected over time. These models are commonly used in fields such as finance, economics, and weather forecasting.<\/p>\n<p id=\"b44e\" class=\"pw-post-body-paragraph lt lu fo be b lv lw lx ly lz ma mb mc md me mf mg mh mi mj mk ml mm mn mo mp fh bj\" data-selectable-paragraph=\"\">Some examples of real-life applications of time series models include:<\/p>\n<ul class=\"\">\n<li id=\"b09f\" class=\"lt lu fo be b lv lw lx ly lz ma mb mc md nt mf mg mh nu mj mk ml nv mn mo mp nw nx ny bj\" data-selectable-paragraph=\"\">Forecasting stock prices: Time series models can be used to analyze historical stock prices and make predictions about future prices. This can be useful for investors looking to make informed decisions about purchasing or selling stocks.<\/li>\n<li id=\"e62d\" class=\"lt lu fo be b lv nz lx ly lz oa mb mc md ob mf mg mh oc mj mk ml od mn mo mp nw nx ny bj\" data-selectable-paragraph=\"\">Predicting energy consumption: Time series models can be used to analyze historical energy consumption data and make predictions about future energy demand. This can be useful for utility companies looking to plan for future energy needs.<\/li>\n<li id=\"d144\" class=\"lt lu fo be b lv nz lx ly lz oa mb mc md ob mf mg mh oc mj mk ml od mn mo mp nw nx ny bj\" data-selectable-paragraph=\"\">Analyzing and forecasting weather patterns: Time series models can be used to analyze historical weather data and make predictions about future weather patterns. This can be useful for weather forecasters and farmers looking to plan for future weather conditions.<\/li>\n<li id=\"67b4\" class=\"lt lu fo be b lv nz lx ly lz oa mb mc md ob mf mg mh oc mj mk ml od mn mo mp nw nx ny bj\" data-selectable-paragraph=\"\">Predictive maintenance: Time series models can be used to predict when equipment is likely to malfunction and schedule maintenance accordingly. This can help reduce downtime and increase efficiency in industries such as manufacturing, transportation, and logistics.<\/li>\n<li id=\"dca2\" class=\"lt lu fo be b lv nz lx ly lz oa mb mc md ob mf mg mh oc mj mk ml od mn mo mp nw nx ny bj\" data-selectable-paragraph=\"\">Time series models can be used in the field of econometrics to analyze and make predictions about economic indicators such as GDP, inflation, and unemployment.<\/li>\n<\/ul>\n<p id=\"a328\" class=\"pw-post-body-paragraph lt lu fo be b lv lw lx ly lz ma mb mc md me mf mg mh mi mj mk ml mm mn mo mp fh bj\" data-selectable-paragraph=\"\">Overall, Time series models are a useful tool that can be used in various industries to evaluate and forecast data gathered over time, assisting businesses in making better decisions and optimizing performance.<\/p>\n<h1 id=\"c050\" class=\"mq mr fo be ms mt mu mv mw mx my mz na nb nc nd ne nf ng nh ni nj nk nl nm nn bj\" data-selectable-paragraph=\"\">Understanding Model Monitoring<\/h1>\n<p id=\"653c\" class=\"pw-post-body-paragraph lt lu fo be b lv no lx ly lz np mb mc md nq mf mg mh nr mj mk ml ns mn mo mp fh bj\" data-selectable-paragraph=\"\">Model monitoring is the process of continuously monitoring the performance of a machine-learning model over time. In the context of time series, model monitoring is particularly important as time series data can be highly dynamic because change is definite over time in ways that can impact the accuracy of the model.<\/p>\n<p id=\"3d4a\" class=\"pw-post-body-paragraph lt lu fo be b lv lw lx ly lz ma mb mc md me mf mg mh mi mj mk ml mm mn mo mp fh bj\" data-selectable-paragraph=\"\">For time series data, model monitoring typically involves tracking a set of performance metrics over time to detect any changes or anomalies in the data that may impact the model\u2019s accuracy. These performance metrics may include accuracy, precision, recall, F1 score, and root mean squared error (RMSE), among others.<\/p>\n<p id=\"27c5\" class=\"pw-post-body-paragraph lt lu fo be b lv lw lx ly lz ma mb mc md me mf mg mh mi mj mk ml mm mn mo mp fh bj\" data-selectable-paragraph=\"\">There are several techniques used for model monitoring with time series data, including:<\/p>\n<ol class=\"\">\n<li id=\"fd75\" class=\"lt lu fo be b lv lw lx ly lz ma mb mc md nt mf mg mh nu mj mk ml nv mn mo mp oe nx ny bj\" data-selectable-paragraph=\"\">Data Drift Detection: This involves monitoring the distribution of the input data over time to detect any changes that may impact the model\u2019s performance.<\/li>\n<li id=\"0a76\" class=\"lt lu fo be b lv nz lx ly lz oa mb mc md ob mf mg mh oc mj mk ml od mn mo mp oe nx ny bj\" data-selectable-paragraph=\"\">Model Performance Monitoring: This involves tracking the performance metrics of the model over time and comparing them to a set of predefined thresholds to detect any degradation in performance.<\/li>\n<li id=\"036f\" class=\"lt lu fo be b lv nz lx ly lz oa mb mc md ob mf mg mh oc mj mk ml od mn mo mp oe nx ny bj\" data-selectable-paragraph=\"\">Model Retraining: Regular retraining of the model on updated data can help to ensure that the model remains up-to-date and accurate.<\/li>\n<li id=\"88f3\" class=\"lt lu fo be b lv nz lx ly lz oa mb mc md ob mf mg mh oc mj mk ml od mn mo mp oe nx ny bj\" data-selectable-paragraph=\"\">Model Ensemble: Using an ensemble of models can help to detect changes in the data as the outputs of multiple models can be combined to produce a more robust prediction.<\/li>\n<\/ol>\n<p id=\"82e1\" class=\"pw-post-body-paragraph lt lu fo be b lv lw lx ly lz ma mb mc md me mf mg mh mi mj mk ml mm mn mo mp fh bj\" data-selectable-paragraph=\"\">It is not necessary to stack all of the techniques mentioned above, and the choice of which technique(s) to use would be determined by the specific requirements of the problem. Model performance monitoring, for example, may suffice if the data is relatively stable and changes occur gradually. However, if the data is highly dynamic and prone to abrupt shifts, data drift detection or model ensemble may be preferable.<\/p>\n<p id=\"ff9e\" class=\"pw-post-body-paragraph lt lu fo be b lv lw lx ly lz ma mb mc md me mf mg mh mi mj mk ml mm mn mo mp fh bj\" data-selectable-paragraph=\"\">Overall, model monitoring is an important aspect of deploying and maintaining machine learning models, especially for time series data where the dynamics of the data can change over time. By continuously monitoring the performance of the model, it is possible to detect and address any issues that may arise and ensure the model remains accurate and reliable.<\/p>\n<h1 id=\"a17b\" class=\"mq mr fo be ms mt mu mv mw mx my mz na nb nc nd ne nf ng nh ni nj nk nl nm nn bj\" data-selectable-paragraph=\"\">Comet<\/h1>\n<p id=\"19af\" class=\"pw-post-body-paragraph lt lu fo be b lv no lx ly lz np mb mc md nq mf mg mh nr mj mk ml ns mn mo mp fh bj\" data-selectable-paragraph=\"\"><a class=\"af of\" href=\"\/signup?utm_source=heartbeat&amp;utm_medium=referral&amp;utm_campaign=AMS_US_EN_SNUP_heartbeat_CTA\" target=\"_blank\" rel=\"noopener ugc nofollow\">Comet<\/a> is a platform for experimentation that enables you to monitor your machine-learning experiments. Comet has another noteworthy feature: it allows us to conduct exploratory data analysis. We can accomplish our EDA objectives thanks to Comet\u2019s integration with well-known Python visualization frameworks. You can learn more about Comet <a class=\"af of\" href=\"\/signup?utm_source=Heartbeat&amp;utm_medium=referral&amp;utm_campaign=AMS_US_EN_SNUP_Heartbeat_Comet_Content\" target=\"_blank\" rel=\"noopener ugc nofollow\">here<\/a>.<\/p>\n<h1 id=\"3cee\" class=\"mq mr fo be ms mt mu mv mw mx my mz na nb nc nd ne nf ng nh ni nj nk nl nm nn bj\" data-selectable-paragraph=\"\">Prerequisites<\/h1>\n<p id=\"c8de\" class=\"pw-post-body-paragraph lt lu fo be b lv no lx ly lz np mb mc md nq mf mg mh nr mj mk ml ns mn mo mp fh bj\" data-selectable-paragraph=\"\">You should install the Comet library on your computer if you don\u2019t already have it there by using either of the following lines at the command prompt. Note that if you are installing packages directly into a Colab notebook, or any environment that uses virtual machines, you\u2019ll likely want to use <code class=\"cw og oh oi oj b\">pip<\/code>.<\/p>\n<pre class=\"ok ol om on oo op oj oq bo or ba bj\"><span id=\"e43b\" class=\"os mr fo oj b bf ot ou l ov ow\" data-selectable-paragraph=\"\">pip install comet_ml<\/span><\/pre>\n<p id=\"0a5f\" class=\"pw-post-body-paragraph lt lu fo be b lv lw lx ly lz ma mb mc md me mf mg mh mi mj mk ml mm mn mo mp fh bj\" data-selectable-paragraph=\"\">\u2014 or \u2014<\/p>\n<pre class=\"ok ol om on oo op oj oq bo or ba bj\"><span id=\"0924\" class=\"os mr fo oj b bf ot ou l ov ow\" data-selectable-paragraph=\"\">conda install -c comet_ml<\/span><\/pre>\n<\/div>\n<\/div>\n<\/div>\n\n\n\n<div class=\"fh fi fj fk fl\">\n<div class=\"ab ca\">\n<div class=\"ch bg et eu ev ew\">\n<blockquote class=\"pf\"><p id=\"edb4\" class=\"pg ph fo be pi pj pk pl pm pn po mp dv\" data-selectable-paragraph=\"\">Have you tried Comet? <a class=\"af of\" href=\"\/signup?utm_source=heartbeat&amp;utm_medium=referral&amp;utm_campaign=AMS_US_EN_SNUP_heartbeat_CTA\" target=\"_blank\" rel=\"noopener ugc nofollow\">Sign up for free<\/a> and easily track experiments, manage models in production, and visualize your model performance.<\/p><\/blockquote>\n<\/div>\n<\/div>\n<\/div>\n\n\n\n<div class=\"fh fi fj fk fl\">\n<div class=\"ab ca\">\n<div class=\"ch bg et eu ev ew\">\n<h1 id=\"e047\" class=\"mq mr fo be ms mt pp mv mw mx pq mz na nb pr nd ne nf ps nh ni nj pt nl nm nn bj\" data-selectable-paragraph=\"\">About The Data<\/h1>\n<p id=\"b70b\" class=\"pw-post-body-paragraph lt lu fo be b lv no lx ly lz np mb mc md nq mf mg mh nr mj mk ml ns mn mo mp fh bj\" data-selectable-paragraph=\"\">The dataset consists of the sales of cars and the date, year, and month the sales were made. Here is the link to the <a class=\"af of\" href=\"https:\/\/www.kaggle.com\/datasets\/dpamgautam\/cars-sales-for-time-series-prediction\" target=\"_blank\" rel=\"noopener ugc nofollow\">dataset<\/a>.<\/p>\n<h2 id=\"8774\" class=\"pu mr fo be ms pv pw px mw py pz qa na md qb qc qd mh qe qf qg ml qh qi qj qk bj\" data-selectable-paragraph=\"\">Getting Started<\/h2>\n<p id=\"788a\" class=\"pw-post-body-paragraph lt lu fo be b lv no lx ly lz np mb mc md nq mf mg mh nr mj mk ml ns mn mo mp fh bj\" data-selectable-paragraph=\"\">The first step involves loading Comet into our code editor:<\/p>\n<pre class=\"ok ol om on oo op oj oq bo or ba bj\"><span id=\"7981\" class=\"os mr fo oj b bf ot ou l ov ow\" data-selectable-paragraph=\"\"><span class=\"hljs-keyword\">from<\/span> comet_ml <span class=\"hljs-keyword\">import<\/span> experiment<\/span><\/pre>\n<p id=\"3951\" class=\"pw-post-body-paragraph lt lu fo be b lv lw lx ly lz ma mb mc md me mf mg mh mi mj mk ml mm mn mo mp fh bj\" data-selectable-paragraph=\"\">We then load all the necessary libraries:<\/p>\n<pre class=\"ok ol om on oo op oj oq bo or ba bj\"><span id=\"cb60\" class=\"os mr fo oj b bf ot ou l ov ow\" data-selectable-paragraph=\"\"><span class=\"hljs-keyword\">import<\/span> numpy <span class=\"hljs-keyword\">as<\/span> np\n<span class=\"hljs-keyword\">import<\/span> pandas <span class=\"hljs-keyword\">as<\/span> pd\n<span class=\"hljs-keyword\">import<\/span> seaborn <span class=\"hljs-keyword\">as<\/span> sns\n<span class=\"hljs-keyword\">import<\/span> matplotlib.<span class=\"hljs-property\">pyplot<\/span> <span class=\"hljs-keyword\">as<\/span> plt;\n<span class=\"hljs-keyword\">from<\/span> statsmodels.<span class=\"hljs-property\">tsa<\/span>.<span class=\"hljs-property\">seasonal<\/span> <span class=\"hljs-keyword\">import<\/span> seasonal_decompose\n<span class=\"hljs-keyword\">from<\/span> tensorflow.<span class=\"hljs-property\">keras<\/span>.<span class=\"hljs-property\">models<\/span> <span class=\"hljs-keyword\">import<\/span> <span class=\"hljs-title.class\">Sequential<\/span>\n<span class=\"hljs-keyword\">from<\/span> tensorflow.<span class=\"hljs-property\">keras<\/span>.<span class=\"hljs-property\">layers<\/span> <span class=\"hljs-keyword\">import<\/span> <span class=\"hljs-title.class\">Dense<\/span>, <span class=\"hljs-title.class\">InputLayer<\/span>\n<span class=\"hljs-keyword\">import<\/span> warnings\nwarnings.<span class=\"hljs-title.function\">filterwarnings<\/span>(<span class=\"hljs-string\">'ignore'<\/span>)<\/span><\/pre>\n<p id=\"207f\" class=\"pw-post-body-paragraph lt lu fo be b lv lw lx ly lz ma mb mc md me mf mg mh mi mj mk ml mm mn mo mp fh bj\" data-selectable-paragraph=\"\">We then load our dataset so we can perform some EDA:<\/p>\n<pre class=\"ok ol om on oo op oj oq bo or ba bj\"><span id=\"3a1d\" class=\"os mr fo oj b bf ot ou l ov ow\" data-selectable-paragraph=\"\"><span class=\"hljs-attr\">Car_sales<\/span> = pd.read_csv(<span class=\"hljs-string\">'\/content\/sales-cars.csv'<\/span>)<\/span><\/pre>\n<p id=\"b608\" class=\"pw-post-body-paragraph lt lu fo be b lv lw lx ly lz ma mb mc md me mf mg mh mi mj mk ml mm mn mo mp fh bj\" data-selectable-paragraph=\"\">After loading the dataset we then begin some EDA on our dataset.<\/p>\n<p id=\"4e7e\" class=\"pw-post-body-paragraph lt lu fo be b lv lw lx ly lz ma mb mc md me mf mg mh mi mj mk ml mm mn mo mp fh bj\" data-selectable-paragraph=\"\">The below method .head() is used to fetch the initial rows of a DataFrame, where the number within the parentheses determines the number of rows to retrieve from the main dataset.<\/p>\n<p id=\"417b\" class=\"pw-post-body-paragraph lt lu fo be b lv lw lx ly lz ma mb mc md me mf mg mh mi mj mk ml mm mn mo mp fh bj\" data-selectable-paragraph=\"\">For instance, as we execute Car_sales.head(10) below, it would then extract the first ten rows of the Car_sales DataFrame. This process gives a fast evaluation of a small set of data, providing insight into its arrangement and details.<\/p>\n<pre class=\"ok ol om on oo op oj oq bo or ba bj\"><span id=\"5435\" class=\"os mr fo oj b bf ot ou l ov ow\" data-selectable-paragraph=\"\">Car_sales.<span class=\"hljs-built_in\">head<\/span>(10)<\/span><\/pre>\n<figure class=\"ok ol om on oo qo ql qm paragraph-image\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg qp qq c\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:357\/1*Q9acqIY7t7HK_ksFp1uFDQ.png\" alt=\"\" width=\"357\" height=\"541\"><\/figure><div class=\"ql qm qn\"><picture><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/format:webp\/1*Q9acqIY7t7HK_ksFp1uFDQ.png 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/format:webp\/1*Q9acqIY7t7HK_ksFp1uFDQ.png 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/format:webp\/1*Q9acqIY7t7HK_ksFp1uFDQ.png 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/format:webp\/1*Q9acqIY7t7HK_ksFp1uFDQ.png 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/format:webp\/1*Q9acqIY7t7HK_ksFp1uFDQ.png 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/format:webp\/1*Q9acqIY7t7HK_ksFp1uFDQ.png 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:714\/format:webp\/1*Q9acqIY7t7HK_ksFp1uFDQ.png 714w\" type=\"image\/webp\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 357px\"><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/1*Q9acqIY7t7HK_ksFp1uFDQ.png 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/1*Q9acqIY7t7HK_ksFp1uFDQ.png 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/1*Q9acqIY7t7HK_ksFp1uFDQ.png 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/1*Q9acqIY7t7HK_ksFp1uFDQ.png 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/1*Q9acqIY7t7HK_ksFp1uFDQ.png 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/1*Q9acqIY7t7HK_ksFp1uFDQ.png 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:714\/1*Q9acqIY7t7HK_ksFp1uFDQ.png 714w\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 357px\" data-testid=\"og\"><\/picture><\/div>\n<\/figure>\n<pre class=\"ok ol om on oo op oj oq bo or ba bj\"><span id=\"bae5\" class=\"os mr fo oj b bf ot ou l ov ow\" data-selectable-paragraph=\"\">Car_sales.<span class=\"hljs-built_in\">tail<\/span>()<\/span><\/pre>\n<p id=\"ea6d\" class=\"pw-post-body-paragraph lt lu fo be b lv lw lx ly lz ma mb mc md me mf mg mh mi mj mk ml mm mn mo mp fh bj\" data-selectable-paragraph=\"\">We then plot a figure to show the sales of cars per month.<\/p>\n<pre class=\"ok ol om on oo op oj oq bo or ba bj\"><span id=\"c92e\" class=\"os mr fo oj b bf ot ou l ov ow\" data-selectable-paragraph=\"\">fig1 =Car_sales.plot(figsize=(12,6));\nexperiment.log_figure(figure_name=<span class=\"hljs-string\">\"Sales vs Month\"<\/span>, figure=fig1)\nplt.show()<\/span><\/pre>\n<figure class=\"ok ol om on oo qo ql qm paragraph-image\">\n<div class=\"qs qt eb qu bg qv\" tabindex=\"0\" role=\"button\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg qp qq c\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:700\/1*ass8KEfa1AF_0cW0mjhvlw.png\" alt=\"\" width=\"700\" height=\"322\"><\/figure><div class=\"ql qm qr\"><picture><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/format:webp\/1*ass8KEfa1AF_0cW0mjhvlw.png 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/format:webp\/1*ass8KEfa1AF_0cW0mjhvlw.png 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/format:webp\/1*ass8KEfa1AF_0cW0mjhvlw.png 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/format:webp\/1*ass8KEfa1AF_0cW0mjhvlw.png 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/format:webp\/1*ass8KEfa1AF_0cW0mjhvlw.png 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/format:webp\/1*ass8KEfa1AF_0cW0mjhvlw.png 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/format:webp\/1*ass8KEfa1AF_0cW0mjhvlw.png 1400w\" type=\"image\/webp\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\"><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/1*ass8KEfa1AF_0cW0mjhvlw.png 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/1*ass8KEfa1AF_0cW0mjhvlw.png 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/1*ass8KEfa1AF_0cW0mjhvlw.png 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/1*ass8KEfa1AF_0cW0mjhvlw.png 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/1*ass8KEfa1AF_0cW0mjhvlw.png 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/1*ass8KEfa1AF_0cW0mjhvlw.png 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/1*ass8KEfa1AF_0cW0mjhvlw.png 1400w\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\" data-testid=\"og\"><\/picture><\/div>\n<\/div>\n<\/figure>\n<p id=\"8379\" class=\"pw-post-body-paragraph lt lu fo be b lv lw lx ly lz ma mb mc md me mf mg mh mi mj mk ml mm mn mo mp fh bj\" data-selectable-paragraph=\"\">From the graph above we can see that the sales of cars increased drastically over the months. Most particularly in July of each Year.<\/p>\n<p id=\"a57a\" class=\"pw-post-body-paragraph lt lu fo be b lv lw lx ly lz ma mb mc md me mf mg mh mi mj mk ml mm mn mo mp fh bj\" data-selectable-paragraph=\"\">Moving on we then check the seasonal sales of cars using the seasonal forecast code.<\/p>\n<pre class=\"ok ol om on oo op oj oq bo or ba bj\"><span id=\"2e15\" class=\"os mr fo oj b bf ot ou l ov ow\" data-selectable-paragraph=\"\">fig2 = plt.figure(figsize=(15,2))\nresults = seasonal_decompose(Car_sales['Sales'])\nexperiment.log_figure(figure_name= <span class=\"hljs-string\">\"Seasonal Forcast\"<\/span>, figure=fig2)\nresults.plot();<\/span><\/pre>\n<figure class=\"ok ol om on oo qo ql qm paragraph-image\">\n<div class=\"qs qt eb qu bg qv\" tabindex=\"0\" role=\"button\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg qp qq c\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:700\/1*vOxdt7O66BUitcDfA5ViZQ.png\" alt=\"\" width=\"700\" height=\"436\"><\/figure><div class=\"ql qm qw\"><picture><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/format:webp\/1*vOxdt7O66BUitcDfA5ViZQ.png 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/format:webp\/1*vOxdt7O66BUitcDfA5ViZQ.png 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/format:webp\/1*vOxdt7O66BUitcDfA5ViZQ.png 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/format:webp\/1*vOxdt7O66BUitcDfA5ViZQ.png 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/format:webp\/1*vOxdt7O66BUitcDfA5ViZQ.png 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/format:webp\/1*vOxdt7O66BUitcDfA5ViZQ.png 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/format:webp\/1*vOxdt7O66BUitcDfA5ViZQ.png 1400w\" type=\"image\/webp\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\"><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/1*vOxdt7O66BUitcDfA5ViZQ.png 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/1*vOxdt7O66BUitcDfA5ViZQ.png 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/1*vOxdt7O66BUitcDfA5ViZQ.png 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/1*vOxdt7O66BUitcDfA5ViZQ.png 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/1*vOxdt7O66BUitcDfA5ViZQ.png 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/1*vOxdt7O66BUitcDfA5ViZQ.png 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/1*vOxdt7O66BUitcDfA5ViZQ.png 1400w\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\" data-testid=\"og\"><\/picture><\/div>\n<\/div>\n<\/figure>\n<p id=\"93fb\" class=\"pw-post-body-paragraph lt lu fo be b lv lw lx ly lz ma mb mc md me mf mg mh mi mj mk ml mm mn mo mp fh bj\" data-selectable-paragraph=\"\">We then divide the dataset into TEST and TRAIN<\/p>\n<pre class=\"ok ol om on oo op oj oq bo or ba bj\"><span id=\"f574\" class=\"os mr fo oj b bf ot ou l ov ow\" data-selectable-paragraph=\"\"><span class=\"hljs-attr\">train<\/span> = Car_sales[:-<span class=\"hljs-number\">6<\/span>]\n<span class=\"hljs-attr\">test<\/span> = Car_sales[-<span class=\"hljs-number\">6<\/span>:]<\/span><\/pre>\n<p id=\"bf24\" class=\"pw-post-body-paragraph lt lu fo be b lv lw lx ly lz ma mb mc md me mf mg mh mi mj mk ml mm mn mo mp fh bj\" data-selectable-paragraph=\"\">After dividing the dataset we then perform some <a class=\"af of\" href=\"https:\/\/heartbeat.comet.ml\/exploratory-data-analysis-eda-for-categorical-data-870b37a79b65\" target=\"_blank\" rel=\"noopener ugc nofollow\">EDA<\/a> on the Train dataset.<\/p>\n<p id=\"f5ff\" class=\"pw-post-body-paragraph lt lu fo be b lv lw lx ly lz ma mb mc md me mf mg mh mi mj mk ml mm mn mo mp fh bj\" data-selectable-paragraph=\"\">To acquire a deeper knowledge of the dataset and undertake exploratory data analysis, the train.head() function is frequently used in conjunction with other methods such as train.info() and train.describe(). By looking at the first few rows of the dataset, you may get a feel of how the data is distributed, detect any missing or inconsistent values, and start to generate hypotheses about the relationship between variables in the dataset.<\/p>\n<pre class=\"ok ol om on oo op oj oq bo or ba bj\"><span id=\"dfb5\" class=\"os mr fo oj b bf ot ou l ov ow\" data-selectable-paragraph=\"\">train<span class=\"hljs-selector-class\">.head<\/span>()<\/span><\/pre>\n<figure class=\"ok ol om on oo qo ql qm paragraph-image\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg qp qq c\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:358\/1*Mj7dtBH4nIoAgmWPUG82pg.png\" alt=\"\" width=\"358\" height=\"352\"><\/figure><div class=\"ql qm qx\"><picture><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/format:webp\/1*Mj7dtBH4nIoAgmWPUG82pg.png 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/format:webp\/1*Mj7dtBH4nIoAgmWPUG82pg.png 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/format:webp\/1*Mj7dtBH4nIoAgmWPUG82pg.png 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/format:webp\/1*Mj7dtBH4nIoAgmWPUG82pg.png 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/format:webp\/1*Mj7dtBH4nIoAgmWPUG82pg.png 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/format:webp\/1*Mj7dtBH4nIoAgmWPUG82pg.png 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:716\/format:webp\/1*Mj7dtBH4nIoAgmWPUG82pg.png 716w\" type=\"image\/webp\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 358px\"><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/1*Mj7dtBH4nIoAgmWPUG82pg.png 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/1*Mj7dtBH4nIoAgmWPUG82pg.png 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/1*Mj7dtBH4nIoAgmWPUG82pg.png 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/1*Mj7dtBH4nIoAgmWPUG82pg.png 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/1*Mj7dtBH4nIoAgmWPUG82pg.png 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/1*Mj7dtBH4nIoAgmWPUG82pg.png 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:716\/1*Mj7dtBH4nIoAgmWPUG82pg.png 716w\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 358px\" data-testid=\"og\"><\/picture><\/div>\n<\/figure>\n<p id=\"13d6\" class=\"pw-post-body-paragraph lt lu fo be b lv lw lx ly lz ma mb mc md me mf mg mh mi mj mk ml mm mn mo mp fh bj\" data-selectable-paragraph=\"\">We also perform EDA on the test dataset.<\/p>\n<pre class=\"ok ol om on oo op oj oq bo or ba bj\"><span id=\"d6b8\" class=\"os mr fo oj b bf ot ou l ov ow\" data-selectable-paragraph=\"\">test<span class=\"hljs-selector-class\">.head<\/span>()<\/span><\/pre>\n<figure class=\"ok ol om on oo qo ql qm paragraph-image\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg qp qq c\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:572\/1*Rq4m4cj7CYC1SN-IfB4oTg.png\" alt=\"\" width=\"572\" height=\"337\"><\/figure><div class=\"ql qm qy\"><picture><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/format:webp\/1*Rq4m4cj7CYC1SN-IfB4oTg.png 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/format:webp\/1*Rq4m4cj7CYC1SN-IfB4oTg.png 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/format:webp\/1*Rq4m4cj7CYC1SN-IfB4oTg.png 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/format:webp\/1*Rq4m4cj7CYC1SN-IfB4oTg.png 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/format:webp\/1*Rq4m4cj7CYC1SN-IfB4oTg.png 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/format:webp\/1*Rq4m4cj7CYC1SN-IfB4oTg.png 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1144\/format:webp\/1*Rq4m4cj7CYC1SN-IfB4oTg.png 1144w\" type=\"image\/webp\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 572px\"><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/1*Rq4m4cj7CYC1SN-IfB4oTg.png 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/1*Rq4m4cj7CYC1SN-IfB4oTg.png 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/1*Rq4m4cj7CYC1SN-IfB4oTg.png 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/1*Rq4m4cj7CYC1SN-IfB4oTg.png 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/1*Rq4m4cj7CYC1SN-IfB4oTg.png 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/1*Rq4m4cj7CYC1SN-IfB4oTg.png 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1144\/1*Rq4m4cj7CYC1SN-IfB4oTg.png 1144w\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 572px\" data-testid=\"og\"><\/picture><\/div>\n<\/figure>\n<pre class=\"ok ol om on oo op oj oq bo or ba bj\"><span id=\"7ef0\" class=\"os mr fo oj b bf ot ou l ov ow\" data-selectable-paragraph=\"\">def <span class=\"hljs-built_in\">generate_lag<\/span>(Car_sales, n):\n    X, y = [], []\n    for i in <span class=\"hljs-built_in\">range<\/span>(<span class=\"hljs-built_in\">len<\/span>(Car_sales) - n):\n        X.<span class=\"hljs-built_in\">append<\/span>(Car_sales[i:i+n])\n        y.<span class=\"hljs-built_in\">append<\/span>(Car_sales[n+i])\n\n    return np.<span class=\"hljs-built_in\">array<\/span>(X), np.<span class=\"hljs-built_in\">array<\/span>(y), np.<span class=\"hljs-built_in\">array<\/span>(y[-n:]).<span class=\"hljs-built_in\">reshape<\/span>(<span class=\"hljs-number\">1<\/span>,n)<\/span><\/pre>\n<p id=\"f447\" class=\"pw-post-body-paragraph lt lu fo be b lv lw lx ly lz ma mb mc md me mf mg mh mi mj mk ml mm mn mo mp fh bj\" data-selectable-paragraph=\"\">The preceding code defines the function \u201cgenerate lag,\u201d which accepts two arguments: \u201cCar sales\u201d (a list or array of numerical data) and \u201cn.\u201d (an integer). The function provides lag data for time series analysis by producing input-output pairs. As the output, it generates \u201cn\u201d-length sequences of \u201cCar sales\u201d and their associated next values.<\/p>\n<p id=\"dddb\" class=\"pw-post-body-paragraph lt lu fo be b lv lw lx ly lz ma mb mc md me mf mg mh mi mj mk ml mm mn mo mp fh bj\" data-selectable-paragraph=\"\">Three NumPy arrays are returned by the function:<br>\n\u201cX\u201d is a two-dimensional array in which each row contains a \u201cn\u201d-length series of \u201cCar sales\u201d data.<br>\n\u201cy\u201d: a 1D array with each member reflecting the next value in the time series following the corresponding sequence in \u201cX.\u201d<\/p>\n<p id=\"65f3\" class=\"pw-post-body-paragraph lt lu fo be b lv lw lx ly lz ma mb mc md me mf mg mh mi mj mk ml mm mn mo mp fh bj\" data-selectable-paragraph=\"\">The previous \u201cn\u201d values of \u201cy\u201d were rearranged into a 1-row, \u201cn\u201d-column array. This is the most current data in the time series that the function can forecast.<\/p>\n<pre class=\"ok ol om on oo op oj oq bo or ba bj\"><span id=\"66a8\" class=\"os mr fo oj b bf ot ou l ov ow\" data-selectable-paragraph=\"\">def <span class=\"hljs-built_in\">forecast_function<\/span>(model, last_batch, n):\n    in_value = last_batch.<span class=\"hljs-built_in\">copy<\/span>()\n    preds = []\n    for i in <span class=\"hljs-built_in\">range<\/span>(n):\n        p = model.predi <span class=\"hljs-built_in\">ct<\/span>(in_value)\n        preds.<span class=\"hljs-built_in\">append<\/span>(p.<span class=\"hljs-built_in\">ravel<\/span>())\n        in_value = np.<span class=\"hljs-built_in\">append<\/span>(in_value, p)[<span class=\"hljs-number\">1<\/span>:].<span class=\"hljs-built_in\">reshape<\/span>(last_batch.shape)\n    return np.<span class=\"hljs-built_in\">array<\/span>(preds).<span class=\"hljs-built_in\">ravel<\/span>()<\/span><\/pre>\n<p id=\"ea0d\" class=\"pw-post-body-paragraph lt lu fo be b lv lw lx ly lz ma mb mc md me mf mg mh mi mj mk ml mm mn mo mp fh bj\" data-selectable-paragraph=\"\">The code specifies the \u201cforecast function\u201d function, which accepts three arguments: \u201cmodel\u201d (a trained predictive model), \u201clast batch\u201d (a NumPy array containing the latest \u201cn\u201d values of a time series), and \u201cn\u201d (an integer representing the number of time steps to predict into the future).<br>\nUsing the \u201cmodel\u201d supplied as input, the function creates \u201cn\u201d predictions for a time series. It begins by copying the array \u201clast batch\u201d into a variable named \u201cin value.\u201d It then begins an iterative loop that repeats \u201cn\u201d times. It utilizes the \u201cmodel\u201d to make a forecast for the next value in the time series in each iteration, using the most recent \u201cn\u201d values (originally \u201clast batch\u201d) as input. The predicted value is saved in the \u201cpreds\u201d list.<\/p>\n<p id=\"cd1c\" class=\"pw-post-body-paragraph lt lu fo be b lv lw lx ly lz ma mb mc md me mf mg mh mi mj mk ml mm mn mo mp fh bj\" data-selectable-paragraph=\"\">The code then modifies the \u201cin value\u201d variable by attaching the predicted value to the end and removing the initial value, essentially shifting the array to the right by one-time step. The new \u201cin value\u201d is reshaped to match the original \u201clast batch\u201d form.<\/p>\n<p id=\"0d41\" class=\"pw-post-body-paragraph lt lu fo be b lv lw lx ly lz ma mb mc md me mf mg mh mi mj mk ml mm mn mo mp fh bj\" data-selectable-paragraph=\"\">The function returns the predicted values in a 1D NumPy array named \u201cpreds\u201d when the loop is done.<\/p>\n<pre class=\"ok ol om on oo op oj oq bo or ba bj\"><span id=\"5e2b\" class=\"os mr fo oj b bf ot ou l ov ow\" data-selectable-paragraph=\"\"><span class=\"hljs-built_in\">test<\/span>[<span class=\"hljs-string\">'Predicted_Sales'<\/span>]=pred<\/span><\/pre>\n<p id=\"2d4e\" class=\"pw-post-body-paragraph lt lu fo be b lv lw lx ly lz ma mb mc md me mf mg mh mi mj mk ml mm mn mo mp fh bj\" data-selectable-paragraph=\"\">The above line of code adds a new column to the test dataframe and then assigns it to \u2018pred.\u2019<\/p>\n<p id=\"4c4a\" class=\"pw-post-body-paragraph lt lu fo be b lv lw lx ly lz ma mb mc md me mf mg mh mi mj mk ml mm mn mo mp fh bj\" data-selectable-paragraph=\"\">Let\u2019s view the new predicted column:<\/p>\n<pre class=\"ok ol om on oo op oj oq bo or ba bj\"><span id=\"f17c\" class=\"os mr fo oj b bf ot ou l ov ow\" data-selectable-paragraph=\"\">test<span class=\"hljs-selector-class\">.head<\/span>()<\/span><\/pre>\n<figure class=\"ok ol om on oo qo ql qm paragraph-image\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg qp qq c\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:572\/1*kcnoJM7L7bK-PE37HWrORg.png\" alt=\"\" width=\"572\" height=\"390\"><\/figure><div class=\"ql qm qy\"><picture><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/format:webp\/1*kcnoJM7L7bK-PE37HWrORg.png 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/format:webp\/1*kcnoJM7L7bK-PE37HWrORg.png 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/format:webp\/1*kcnoJM7L7bK-PE37HWrORg.png 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/format:webp\/1*kcnoJM7L7bK-PE37HWrORg.png 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/format:webp\/1*kcnoJM7L7bK-PE37HWrORg.png 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/format:webp\/1*kcnoJM7L7bK-PE37HWrORg.png 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1144\/format:webp\/1*kcnoJM7L7bK-PE37HWrORg.png 1144w\" type=\"image\/webp\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 572px\"><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/1*kcnoJM7L7bK-PE37HWrORg.png 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/1*kcnoJM7L7bK-PE37HWrORg.png 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/1*kcnoJM7L7bK-PE37HWrORg.png 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/1*kcnoJM7L7bK-PE37HWrORg.png 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/1*kcnoJM7L7bK-PE37HWrORg.png 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/1*kcnoJM7L7bK-PE37HWrORg.png 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1144\/1*kcnoJM7L7bK-PE37HWrORg.png 1144w\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 572px\" data-testid=\"og\"><\/picture><\/div>\n<\/figure>\n<p id=\"cd41\" class=\"pw-post-body-paragraph lt lu fo be b lv lw lx ly lz ma mb mc md me mf mg mh mi mj mk ml mm mn mo mp fh bj\" data-selectable-paragraph=\"\">We can see that the predicted sales are higher than the original sales. Let\u2019s visualize the predicted sales vs. normal sales.<\/p>\n<pre class=\"ok ol om on oo op oj oq bo or ba bj\"><span id=\"8d5a\" class=\"os mr fo oj b bf ot ou l ov ow\" data-selectable-paragraph=\"\">fig3 = plt.figure(figsize=(15,2))\nexperiment.log_figure(figure_name= <span class=\"hljs-string\">\"Sales vs preditced sales\"<\/span>, figure=fig3)\ntest.plot()<\/span><\/pre>\n<figure class=\"ok ol om on oo qo ql qm paragraph-image\">\n<div class=\"qs qt eb qu bg qv\" tabindex=\"0\" role=\"button\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg qp qq c\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:700\/1*UNNRuEsR9DZTlAmEaJDycw.png\" alt=\"\" width=\"700\" height=\"358\"><\/figure><div class=\"ql qm qz\"><picture><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/format:webp\/1*UNNRuEsR9DZTlAmEaJDycw.png 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/format:webp\/1*UNNRuEsR9DZTlAmEaJDycw.png 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/format:webp\/1*UNNRuEsR9DZTlAmEaJDycw.png 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/format:webp\/1*UNNRuEsR9DZTlAmEaJDycw.png 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/format:webp\/1*UNNRuEsR9DZTlAmEaJDycw.png 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/format:webp\/1*UNNRuEsR9DZTlAmEaJDycw.png 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/format:webp\/1*UNNRuEsR9DZTlAmEaJDycw.png 1400w\" type=\"image\/webp\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\"><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/1*UNNRuEsR9DZTlAmEaJDycw.png 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/1*UNNRuEsR9DZTlAmEaJDycw.png 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/1*UNNRuEsR9DZTlAmEaJDycw.png 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/1*UNNRuEsR9DZTlAmEaJDycw.png 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/1*UNNRuEsR9DZTlAmEaJDycw.png 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/1*UNNRuEsR9DZTlAmEaJDycw.png 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/1*UNNRuEsR9DZTlAmEaJDycw.png 1400w\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\" data-testid=\"og\"><\/picture><\/div>\n<\/div>\n<\/figure>\n<p id=\"8117\" class=\"pw-post-body-paragraph lt lu fo be b lv lw lx ly lz ma mb mc md me mf mg mh mi mj mk ml mm mn mo mp fh bj\" data-selectable-paragraph=\"\">The visuals confirm that the predicted sales are higher in most cases compared to the actual sales.<\/p>\n<p id=\"b352\" class=\"pw-post-body-paragraph lt lu fo be b lv lw lx ly lz ma mb mc md me mf mg mh mi mj mk ml mm mn mo mp fh bj\" data-selectable-paragraph=\"\">We need to determine the percentage error of the predicted sales so the code below checks for the percentage error.<\/p>\n<pre class=\"ok ol om on oo op oj oq bo or ba bj\"><span id=\"4031\" class=\"os mr fo oj b bf ot ou l ov ow\" data-selectable-paragraph=\"\">def error_function(Car_sales,column_1,column_2):\n    data = Car_sales.<span class=\"hljs-built_in\">copy<\/span>()\n    my_list = []\n    <span class=\"hljs-keyword\">for<\/span> i in <span class=\"hljs-keyword\">range<\/span>(<span class=\"hljs-built_in\">len<\/span>(data)):\n        x = (data[column_2][i]*<span class=\"hljs-number\">100<\/span>)\/data[column_1][i]\n        <span class=\"hljs-keyword\">if<\/span> x &gt;= <span class=\"hljs-number\">100<\/span>:\n            <span class=\"hljs-type\">error<\/span> = x<span class=\"hljs-number\">-100<\/span>\n            #data[<span class=\"hljs-string\">'error_percentage'<\/span>][i] = <span class=\"hljs-type\">error<\/span>\n            my_list.<span class=\"hljs-built_in\">append<\/span>(<span class=\"hljs-type\">error<\/span>)\n        <span class=\"hljs-keyword\">else<\/span>:\n            <span class=\"hljs-type\">error<\/span> = <span class=\"hljs-number\">100<\/span>-x\n            my_list.<span class=\"hljs-built_in\">append<\/span>(<span class=\"hljs-type\">error<\/span>)\n            #data[<span class=\"hljs-string\">'error_percentage'<\/span>][i] = <span class=\"hljs-type\">error<\/span>\n    data[<span class=\"hljs-string\">'error_percentage'<\/span>] = my_list\n    <span class=\"hljs-keyword\">return<\/span> data<\/span><\/pre>\n<p id=\"2c6a\" class=\"pw-post-body-paragraph lt lu fo be b lv lw lx ly lz ma mb mc md me mf mg mh mi mj mk ml mm mn mo mp fh bj\" data-selectable-paragraph=\"\">The code specifies the \u201cerror function\u201d function, which accepts three arguments: \u201cCar sales\u201d (a pandas DataFrame), \u201ccolumn 1\u201d (a string representing the label of one column in \u201cCar sales\u201d), and \u201ccolumn 2\u201d (a string representing the label of another column in \u201cCar sales\u201d).<\/p>\n<p id=\"d1aa\" class=\"pw-post-body-paragraph lt lu fo be b lv lw lx ly lz ma mb mc md me mf mg mh mi mj mk ml mm mn mo mp fh bj\" data-selectable-paragraph=\"\">For each entry in the \u201cCar sales\u201d DataFrame, the function computes the percentage error between the two columns defined by \u201ccolumn 1\u201d and \u201ccolumn 2.\u201d It begins by creating a \u201cdata\u201d DataFrame replica of the \u201cCar sales\u201d DataFrame.<\/p>\n<p id=\"e4db\" class=\"pw-post-body-paragraph lt lu fo be b lv lw lx ly lz ma mb mc md me mf mg mh mi mj mk ml mm mn mo mp fh bj\" data-selectable-paragraph=\"\">It then begins a loop that iterates through each entry in the \u201cdata\u201d array. It computes the % difference between the values in \u201ccolumn 1\u201d and \u201ccolumn 2\u201d for each row. If the % difference exceeds 100, the error is calculated as the difference between the percentage difference and 100. If the % difference is less than 100, the error is equal to 100 minus the percentage difference. Each error value is appended to a list named \u201cmy list\u201d by the function.<\/p>\n<p id=\"3657\" class=\"pw-post-body-paragraph lt lu fo be b lv lw lx ly lz ma mb mc md me mf mg mh mi mj mk ml mm mn mo mp fh bj\" data-selectable-paragraph=\"\">After the loop is ended, the method adds a new column to the \u201cdata\u201d DataFrame named \u201cerror percentage\u201d, which includes the percentage errors saved in \u201cmy list.\u201d<\/p>\n<p id=\"2de3\" class=\"pw-post-body-paragraph lt lu fo be b lv lw lx ly lz ma mb mc md me mf mg mh mi mj mk ml mm mn mo mp fh bj\" data-selectable-paragraph=\"\">The function returns the \u201cdata\u201d DataFrame with the new column \u201cerror percentage\u201d added.<\/p>\n<pre class=\"ok ol om on oo op oj oq bo or ba bj\"><span id=\"6b24\" class=\"os mr fo oj b bf ot ou l ov ow\" data-selectable-paragraph=\"\">column_1 = <span class=\"hljs-string\">'Sales'<\/span>\ncolumn_2 = <span class=\"hljs-string\">'Predicted_Sales'<\/span>\nCar_sales_new = error_function(<span class=\"hljs-built_in\">test<\/span>,column_1,column_2)\nCar_sales_new<\/span><\/pre>\n<figure class=\"ok ol om on oo qo ql qm paragraph-image\">\n<div class=\"qs qt eb qu bg qv\" tabindex=\"0\" role=\"button\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg qp qq c\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:700\/1*smy-0cjp0ylFF8CwO-ZSgg.png\" alt=\"\" width=\"700\" height=\"325\"><\/figure><div class=\"ql qm ra\"><picture><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/format:webp\/1*smy-0cjp0ylFF8CwO-ZSgg.png 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/format:webp\/1*smy-0cjp0ylFF8CwO-ZSgg.png 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/format:webp\/1*smy-0cjp0ylFF8CwO-ZSgg.png 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/format:webp\/1*smy-0cjp0ylFF8CwO-ZSgg.png 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/format:webp\/1*smy-0cjp0ylFF8CwO-ZSgg.png 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/format:webp\/1*smy-0cjp0ylFF8CwO-ZSgg.png 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/format:webp\/1*smy-0cjp0ylFF8CwO-ZSgg.png 1400w\" type=\"image\/webp\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\"><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/1*smy-0cjp0ylFF8CwO-ZSgg.png 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/1*smy-0cjp0ylFF8CwO-ZSgg.png 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/1*smy-0cjp0ylFF8CwO-ZSgg.png 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/1*smy-0cjp0ylFF8CwO-ZSgg.png 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/1*smy-0cjp0ylFF8CwO-ZSgg.png 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/1*smy-0cjp0ylFF8CwO-ZSgg.png 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/1*smy-0cjp0ylFF8CwO-ZSgg.png 1400w\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\" data-testid=\"og\"><\/picture><\/div>\n<\/div>\n<\/figure>\n<p id=\"d09b\" class=\"pw-post-body-paragraph lt lu fo be b lv lw lx ly lz ma mb mc md me mf mg mh mi mj mk ml mm mn mo mp fh bj\" data-selectable-paragraph=\"\">We then view our experiment on Comet:<\/p>\n<figure class=\"ok ol om on oo qo\">\n<div class=\"rb ig l eb\">\n<div class=\"rc rd l\"><iframe loading=\"lazy\" class=\"ek n fc dx bg\" title=\"Model Mointoring\" src=\"https:\/\/cdn.embedly.com\/widgets\/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F6HCrLrtcllA%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D6HCrLrtcllA&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F6HCrLrtcllA%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube\" width=\"854\" height=\"480\" frameborder=\"0\" scrolling=\"no\" allowfullscreen=\"allowfullscreen\" data-mce-fragment=\"1\"><\/iframe><\/div>\n<\/div>\n<\/figure>\n<p id=\"2e8f\" class=\"pw-post-body-paragraph lt lu fo be b lv lw lx ly lz ma mb mc md me mf mg mh mi mj mk ml mm mn mo mp fh bj\" data-selectable-paragraph=\"\">Comet\u2019s ability to automatically log and track experiment metadata, such as hyperparameters, metrics, and model artifacts, is one of the key ways it simplifies model monitoring. Data scientists can easily compare the performance of different models and hyperparameter configurations and monitor the training process in real time by tracking experiments with Comet. This enables them to quickly identify potential issues, such as over- or under-fitting, and adjust their models as needed.<\/p>\n<p id=\"5bbc\" class=\"pw-post-body-paragraph lt lu fo be b lv lw lx ly lz ma mb mc md me mf mg mh mi mj mk ml mm mn mo mp fh bj\" data-selectable-paragraph=\"\">Comet also includes a set of visualization tools to help you explore and interpret experimental results. Users can, for example, view learning curves to track model performance over time or scatter plots and heatmaps to compare the behavior of different models across a variety of metrics.<\/p>\n<p id=\"a812\" class=\"pw-post-body-paragraph lt lu fo be b lv lw lx ly lz ma mb mc md me mf mg mh mi mj mk ml mm mn mo mp fh bj\" data-selectable-paragraph=\"\">Comet also has the ability to connect with popular machine learning frameworks which include: TensorFlow and PyTorch. This implies that users may log experiments and metrics straight from their code, with no further setup or configuration required.<\/p>\n<h1 id=\"04d4\" class=\"mq mr fo be ms mt mu mv mw mx my mz na nb nc nd ne nf ng nh ni nj nk nl nm nn bj\" data-selectable-paragraph=\"\">Conclusion<\/h1>\n<p id=\"43ef\" class=\"pw-post-body-paragraph lt lu fo be b lv no lx ly lz np mb mc md nq mf mg mh nr mj mk ml ns mn mo mp fh bj\" data-selectable-paragraph=\"\">In conclusion, model monitoring is a critical step in the machine learning pipeline, and <a class=\"af of\" href=\"\/signup?utm_source=heartbeat&amp;utm_medium=referral&amp;utm_campaign=AMS_US_EN_SNUP_heartbeat_CTA\" target=\"_blank\" rel=\"noopener ugc nofollow\">Comet ML<\/a> is an excellent tool for tracking and visualizing model performance.<\/p>\n<p id=\"702a\" class=\"pw-post-body-paragraph lt lu fo be b lv lw lx ly lz ma mb mc md me mf mg mh mi mj mk ml mm mn mo mp fh bj\" data-selectable-paragraph=\"\">Through Comet, data scientists can monitor their models in real-time, identify problems early, and make quick decisions to improve model accuracy. The platform enables users to view and analyze model performance metrics, compare different models, and visualize model training and evaluation results.<\/p>\n<p id=\"f1bf\" class=\"pw-post-body-paragraph lt lu fo be b lv lw lx ly lz ma mb mc md me mf mg mh mi mj mk ml mm mn mo mp fh bj\" data-selectable-paragraph=\"\">Comet also allows users to collaborate and share experiments with team members, which is particularly beneficial for distributed teams. Furthermore, the platform integrates with many popular machine learning libraries and frameworks, making it easy to incorporate into existing workflows.<\/p>\n<p id=\"2995\" class=\"pw-post-body-paragraph lt lu fo be b lv lw lx ly lz ma mb mc md me mf mg mh mi mj mk ml mm mn mo mp fh bj\" data-selectable-paragraph=\"\">Overall, Comet provides a comprehensive and user-friendly platform for model monitoring that can help data scientists to optimize their models and make better-informed decisions. You can get the<a class=\"af of\" href=\"https:\/\/github.com\/Saintdavidking\/Davidking\/blob\/main\/Monitoring_Your_Time_Series_Analysis_In_Comet_.ipynb\" target=\"_blank\" rel=\"noopener ugc nofollow\"> full code here<\/a>.<\/p>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>In this tutorial, we will go through steps on how to use Comet to monitor our time-series forecasting model. We will carry out some EDA on our dataset, and then we will log the visualizations onto the Comet experimentation website or platform. Without further ado, let\u2019s begin. Time Series Models Time series models are a [&hellip;]<\/p>\n","protected":false},"author":97,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"customer_name":"","customer_description":"","customer_industry":"","customer_technologies":"","customer_logo":"","footnotes":""},"categories":[9],"tags":[],"coauthors":[194],"class_list":["post-7601","post","type-post","status-publish","format-standard","hentry","category-product"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v25.9 (Yoast SEO v25.9) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Monitoring Your Time Series Model in Comet - Comet<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.comet.com\/site\/blog\/monitoring-your-time-series-model-in-comet\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Monitoring Your Time Series Model in Comet\" \/>\n<meta property=\"og:description\" content=\"In this tutorial, we will go through steps on how to use Comet to monitor our time-series forecasting model. We will carry out some EDA on our dataset, and then we will log the visualizations onto the Comet experimentation website or platform. Without further ado, let\u2019s begin. Time Series Models Time series models are a [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.comet.com\/site\/blog\/monitoring-your-time-series-model-in-comet\/\" \/>\n<meta property=\"og:site_name\" content=\"Comet\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/cometdotml\" \/>\n<meta property=\"article:published_time\" content=\"2023-09-22T18:37:59+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-04-24T17:13:57+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/miro.medium.com\/v2\/resize:fit:357\/1*Q9acqIY7t7HK_ksFp1uFDQ.png\" \/>\n<meta name=\"author\" content=\"David Fagbuyiro\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@Cometml\" \/>\n<meta name=\"twitter:site\" content=\"@Cometml\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"David Fagbuyiro\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"12 minutes\" \/>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Monitoring Your Time Series Model in Comet - Comet","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.comet.com\/site\/blog\/monitoring-your-time-series-model-in-comet\/","og_locale":"en_US","og_type":"article","og_title":"Monitoring Your Time Series Model in Comet","og_description":"In this tutorial, we will go through steps on how to use Comet to monitor our time-series forecasting model. We will carry out some EDA on our dataset, and then we will log the visualizations onto the Comet experimentation website or platform. Without further ado, let\u2019s begin. Time Series Models Time series models are a [&hellip;]","og_url":"https:\/\/www.comet.com\/site\/blog\/monitoring-your-time-series-model-in-comet\/","og_site_name":"Comet","article_publisher":"https:\/\/www.facebook.com\/cometdotml","article_published_time":"2023-09-22T18:37:59+00:00","article_modified_time":"2025-04-24T17:13:57+00:00","og_image":[{"url":"https:\/\/miro.medium.com\/v2\/resize:fit:357\/1*Q9acqIY7t7HK_ksFp1uFDQ.png","type":"","width":"","height":""}],"author":"David Fagbuyiro","twitter_card":"summary_large_image","twitter_creator":"@Cometml","twitter_site":"@Cometml","twitter_misc":{"Written by":"David Fagbuyiro","Est. reading time":"12 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.comet.com\/site\/blog\/monitoring-your-time-series-model-in-comet\/#article","isPartOf":{"@id":"https:\/\/www.comet.com\/site\/blog\/monitoring-your-time-series-model-in-comet\/"},"author":{"name":"David Fagbuyiro","@id":"https:\/\/www.comet.com\/site\/#\/schema\/person\/6e9f041132c4c2e8093f2db317b7fcc5"},"headline":"Monitoring Your Time Series Model in Comet","datePublished":"2023-09-22T18:37:59+00:00","dateModified":"2025-04-24T17:13:57+00:00","mainEntityOfPage":{"@id":"https:\/\/www.comet.com\/site\/blog\/monitoring-your-time-series-model-in-comet\/"},"wordCount":1972,"publisher":{"@id":"https:\/\/www.comet.com\/site\/#organization"},"image":{"@id":"https:\/\/www.comet.com\/site\/blog\/monitoring-your-time-series-model-in-comet\/#primaryimage"},"thumbnailUrl":"https:\/\/miro.medium.com\/v2\/resize:fit:357\/1*Q9acqIY7t7HK_ksFp1uFDQ.png","articleSection":["Product"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.comet.com\/site\/blog\/monitoring-your-time-series-model-in-comet\/","url":"https:\/\/www.comet.com\/site\/blog\/monitoring-your-time-series-model-in-comet\/","name":"Monitoring Your Time Series Model in Comet - Comet","isPartOf":{"@id":"https:\/\/www.comet.com\/site\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.comet.com\/site\/blog\/monitoring-your-time-series-model-in-comet\/#primaryimage"},"image":{"@id":"https:\/\/www.comet.com\/site\/blog\/monitoring-your-time-series-model-in-comet\/#primaryimage"},"thumbnailUrl":"https:\/\/miro.medium.com\/v2\/resize:fit:357\/1*Q9acqIY7t7HK_ksFp1uFDQ.png","datePublished":"2023-09-22T18:37:59+00:00","dateModified":"2025-04-24T17:13:57+00:00","breadcrumb":{"@id":"https:\/\/www.comet.com\/site\/blog\/monitoring-your-time-series-model-in-comet\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.comet.com\/site\/blog\/monitoring-your-time-series-model-in-comet\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.comet.com\/site\/blog\/monitoring-your-time-series-model-in-comet\/#primaryimage","url":"https:\/\/miro.medium.com\/v2\/resize:fit:357\/1*Q9acqIY7t7HK_ksFp1uFDQ.png","contentUrl":"https:\/\/miro.medium.com\/v2\/resize:fit:357\/1*Q9acqIY7t7HK_ksFp1uFDQ.png"},{"@type":"BreadcrumbList","@id":"https:\/\/www.comet.com\/site\/blog\/monitoring-your-time-series-model-in-comet\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.comet.com\/site\/"},{"@type":"ListItem","position":2,"name":"Monitoring Your Time Series Model in Comet"}]},{"@type":"WebSite","@id":"https:\/\/www.comet.com\/site\/#website","url":"https:\/\/www.comet.com\/site\/","name":"Comet","description":"Build Better Models Faster","publisher":{"@id":"https:\/\/www.comet.com\/site\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.comet.com\/site\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.comet.com\/site\/#organization","name":"Comet ML, Inc.","alternateName":"Comet","url":"https:\/\/www.comet.com\/site\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.comet.com\/site\/#\/schema\/logo\/image\/","url":"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2025\/01\/logo_comet_square.png","contentUrl":"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2025\/01\/logo_comet_square.png","width":310,"height":310,"caption":"Comet ML, Inc."},"image":{"@id":"https:\/\/www.comet.com\/site\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/cometdotml","https:\/\/x.com\/Cometml","https:\/\/www.youtube.com\/channel\/UCmN63HKvfXSCS-UwVwmK8Hw"]},{"@type":"Person","@id":"https:\/\/www.comet.com\/site\/#\/schema\/person\/6e9f041132c4c2e8093f2db317b7fcc5","name":"David Fagbuyiro","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.comet.com\/site\/#\/schema\/person\/image\/2b02452c768c0028ed254680fb651269","url":"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/09\/cropped-1500x500-1-96x96.jpg","contentUrl":"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/09\/cropped-1500x500-1-96x96.jpg","caption":"David Fagbuyiro"},"url":"https:\/\/www.comet.com\/site\/blog\/author\/dayveedo219gmail-com\/"}]}},"_links":{"self":[{"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/posts\/7601","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/users\/97"}],"replies":[{"embeddable":true,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/comments?post=7601"}],"version-history":[{"count":1,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/posts\/7601\/revisions"}],"predecessor-version":[{"id":15534,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/posts\/7601\/revisions\/15534"}],"wp:attachment":[{"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/media?parent=7601"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/categories?post=7601"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/tags?post=7601"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/coauthors?post=7601"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}