{"id":7270,"date":"2023-08-21T09:45:49","date_gmt":"2023-08-21T17:45:49","guid":{"rendered":"https:\/\/live-cometml.pantheonsite.io\/?p=7270"},"modified":"2025-04-24T17:14:34","modified_gmt":"2025-04-24T17:14:34","slug":"outlier-detection-in-time-series-with-kats-and-comet","status":"publish","type":"post","link":"https:\/\/www.comet.com\/site\/blog\/outlier-detection-in-time-series-with-kats-and-comet\/","title":{"rendered":"Outlier Detection in Time Series with Kats and Comet"},"content":{"rendered":"\n<link rel=\"canonical\" href=\"https:\/\/www.comet.com\/site\/blog\/outlier-detection-in-time-series-with-kats-and-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<figure class=\"lw lx ly lz ma mb lt lu paragraph-image\">\n<div class=\"mc md eb me bg mf\" tabindex=\"0\" role=\"button\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg mg mh c\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:700\/0*ZXRoM8gPPcCXwiue\" alt=\"\" width=\"700\" height=\"467\"><\/figure><div class=\"lt lu lv\"><picture><\/picture><\/div>\n<\/div><figcaption class=\"mi mj mk lt lu ml mm be b bf z dv\" data-selectable-paragraph=\"\">Photo by <a class=\"af mn\" href=\"https:\/\/unsplash.com\/@jakehills?utm_source=medium&amp;utm_medium=referral\" target=\"_blank\" rel=\"noopener ugc nofollow\">Jake Hills<\/a> on <a class=\"af mn\" href=\"https:\/\/unsplash.com\/?utm_source=medium&amp;utm_medium=referral\" target=\"_blank\" rel=\"noopener ugc nofollow\">Unsplash<\/a><\/figcaption><\/figure>\n<h1 id=\"9af1\" class=\"mo mp fo be mq mr ms mt mu mv mw mx my mz na nb nc nd ne nf ng nh ni nj nk nl bj\" data-selectable-paragraph=\"\">Introduction<\/h1>\n<p id=\"661f\" class=\"pw-post-body-paragraph nm nn fo be b no np nq nr ns nt nu nv nw nx ny nz oa ob oc od oe of og oh oi fh bj\" data-selectable-paragraph=\"\">Time series applications are ubiquitous and find applications in various industries such as supply chain, e-commerce, finance, retail, biotechnology, weather prediction, oil and energy, manufacturing, astronomy, etc. These applications generate data that can be noisy in the real world as some unaccounted factors can influence the measurements. For example, readings of the sensors used to measure the temperature or pressure in an automobile manufacturing plant might get impacted by weather conditions, several entries, exits of personnel, or a faulty apparatus.<\/p>\n<p id=\"9429\" class=\"pw-post-body-paragraph nm nn fo be b no oj nq nr ns ok nu nv nw ol ny nz oa om oc od oe on og oh oi fh bj\" data-selectable-paragraph=\"\">This post will focus on outlier detection and interpolation in time series data using the Facebook Kats library. You will learn to log the visualizations in the Comet.ml project.<\/p>\n<h2 id=\"392e\" class=\"oo mp fo be mq op oq or mu os ot ou my nw ov ow ox oa oy oz pa oe pb pc pd pe bj\" data-selectable-paragraph=\"\">Facebook Kats<\/h2>\n<p id=\"0a20\" class=\"pw-post-body-paragraph nm nn fo be b no np nq nr ns nt nu nv nw nx ny nz oa ob oc od oe of og oh oi fh bj\" data-selectable-paragraph=\"\">There are many open-source libraries for analyzing time series data, such as Sktime, Darts, Prophet, Pyflux, Tsfresh, Flint, Arrow, Kats, Pastas, Orbit, etc. In this post, you will learn to use the Kats library due to its lightweight, generalizable, and easy-to-use framework.<\/p>\n<figure class=\"pg ph pi pj pk mb lt lu paragraph-image\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg mg mh c\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:466\/1*chEz8_Q4TNCVyUNWH23p2g.png\" alt=\"\" width=\"466\" height=\"490\"><\/figure><div class=\"lt lu pf\"><picture><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/format:webp\/1*chEz8_Q4TNCVyUNWH23p2g.png 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/format:webp\/1*chEz8_Q4TNCVyUNWH23p2g.png 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/format:webp\/1*chEz8_Q4TNCVyUNWH23p2g.png 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/format:webp\/1*chEz8_Q4TNCVyUNWH23p2g.png 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/format:webp\/1*chEz8_Q4TNCVyUNWH23p2g.png 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/format:webp\/1*chEz8_Q4TNCVyUNWH23p2g.png 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:932\/format:webp\/1*chEz8_Q4TNCVyUNWH23p2g.png 932w\" 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, 466px\"><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/1*chEz8_Q4TNCVyUNWH23p2g.png 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/1*chEz8_Q4TNCVyUNWH23p2g.png 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/1*chEz8_Q4TNCVyUNWH23p2g.png 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/1*chEz8_Q4TNCVyUNWH23p2g.png 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/1*chEz8_Q4TNCVyUNWH23p2g.png 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/1*chEz8_Q4TNCVyUNWH23p2g.png 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:932\/1*chEz8_Q4TNCVyUNWH23p2g.png 932w\" 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, 466px\" data-testid=\"og\"><\/picture><\/div>\n<figcaption class=\"mi mj mk lt lu ml mm be b bf z dv\" data-selectable-paragraph=\"\">Source: <a class=\"af mn\" href=\"https:\/\/facebookresearch.github.io\/Kats\/\" target=\"_blank\" rel=\"noopener ugc nofollow\">https:\/\/facebookresearch.github.io\/Kats\/<\/a><\/figcaption>\n<\/figure>\n<p id=\"9065\" class=\"pw-post-body-paragraph nm nn fo be b no oj nq nr ns ok nu nv nw ol ny nz oa om oc od oe on og oh oi fh bj\" data-selectable-paragraph=\"\">In addition to univariate and multivariate analysis, it offers various analysis and preprocessing functionalities such as:<\/p>\n<ul class=\"\">\n<li id=\"1666\" class=\"nm nn fo be b no oj nq nr ns ok nu nv pl ol ny nz pm om oc od pn on og oh oi po pp pq bj\" data-selectable-paragraph=\"\"><strong class=\"be pr\">Forecasting<\/strong>: It has a ton of tools for prediction, such as classical ones like ARIMA, ARMA, SARIMA, etc, and modern forecasting models like Prophet. It also offers ensembles, meta-learning algorithms, hyperparameter tuning using grid search, backtesting, and empirical prediction intervals.<\/li>\n<li id=\"52e1\" class=\"nm nn fo be b no ps nq nr ns pt nu nv pl pu ny nz pm pv oc od pn pw og oh oi po pp pq bj\" data-selectable-paragraph=\"\"><strong class=\"be pr\">Outlier and Change Point Detection:<\/strong> It identifies patterns such as trend, seasonality, outlier, and change point.<\/li>\n<li id=\"dede\" class=\"nm nn fo be b no ps nq nr ns pt nu nv pl pu ny nz pm pv oc od pn pw og oh oi po pp pq bj\" data-selectable-paragraph=\"\"><strong class=\"be pr\">Feature Engineering:<\/strong> The TSFeature module can generate many statistical features used in classification and regression models.<\/li>\n<li id=\"6fdb\" class=\"nm nn fo be b no ps nq nr ns pt nu nv pl pu ny nz pm pv oc od pn pw og oh oi po pp pq bj\" data-selectable-paragraph=\"\"><strong class=\"be pr\">Utilities<\/strong>: Kats provides time series simulators for experimentation.<\/li>\n<\/ul>\n<p id=\"a5b8\" class=\"pw-post-body-paragraph nm nn fo be b no oj nq nr ns ok nu nv nw ol ny nz oa om oc od oe on og oh oi fh bj\" data-selectable-paragraph=\"\">Installation is as easy as:<\/p>\n<pre class=\"pg ph pi pj pk px py pz qa ax qb bj\"><span id=\"5f44\" class=\"oo mp fo py b ho qc qd l ie qe\" data-selectable-paragraph=\"\">pip install kats<\/span><\/pre>\n<h2 id=\"e3ad\" class=\"oo mp fo be mq op oq or mu os ot ou my nw ov ow ox oa oy oz pa oe pb pc pd pe bj\" data-selectable-paragraph=\"\">Comet<\/h2>\n<p id=\"03eb\" class=\"pw-post-body-paragraph nm nn fo be b no np nq nr ns nt nu nv nw nx ny nz oa ob oc od oe of og oh oi fh bj\" data-selectable-paragraph=\"\">Comet\u2019s machine learning platform is an interactive tool that integrates with your existing infrastructure and tools to make managing, visualizing, and optimizing models easier and faster. It allows seamless collaboration in multi-geographical teams by enabling experiment logging, git commits, experiment comparison, and reproducibility.<\/p>\n<figure class=\"pg ph pi pj pk mb lt lu paragraph-image\">\n<div class=\"mc md eb me bg mf\" tabindex=\"0\" role=\"button\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg mg mh c\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:700\/1*qc6hzFuExdIMZr1a68pxlA.jpeg\" alt=\"\" width=\"700\" height=\"265\"><\/figure><div class=\"lt lu qf\"><picture><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/format:webp\/1*qc6hzFuExdIMZr1a68pxlA.jpeg 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/format:webp\/1*qc6hzFuExdIMZr1a68pxlA.jpeg 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/format:webp\/1*qc6hzFuExdIMZr1a68pxlA.jpeg 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/format:webp\/1*qc6hzFuExdIMZr1a68pxlA.jpeg 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/format:webp\/1*qc6hzFuExdIMZr1a68pxlA.jpeg 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/format:webp\/1*qc6hzFuExdIMZr1a68pxlA.jpeg 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/format:webp\/1*qc6hzFuExdIMZr1a68pxlA.jpeg 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*qc6hzFuExdIMZr1a68pxlA.jpeg 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/1*qc6hzFuExdIMZr1a68pxlA.jpeg 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/1*qc6hzFuExdIMZr1a68pxlA.jpeg 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/1*qc6hzFuExdIMZr1a68pxlA.jpeg 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/1*qc6hzFuExdIMZr1a68pxlA.jpeg 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/1*qc6hzFuExdIMZr1a68pxlA.jpeg 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/1*qc6hzFuExdIMZr1a68pxlA.jpeg 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<figcaption class=\"mi mj mk lt lu ml mm be b bf z dv\" data-selectable-paragraph=\"\">Source: <a class=\"af mn\" href=\"https:\/\/www.comet.com\/site\/\" target=\"_blank\" rel=\"noopener ugc nofollow\">https:\/\/www.comet.com\/site\/<\/a><\/figcaption>\n<\/figure>\n<p id=\"6086\" class=\"pw-post-body-paragraph nm nn fo be b no oj nq nr ns ok nu nv nw ol ny nz oa om oc od oe on og oh oi fh bj\" data-selectable-paragraph=\"\">Not only easy to use, but it is also customizable to your team\u2019s preferences and provides support for all well-known machine learning libraries out of the box. For others, there are always a few lines of code and you are good to go.<\/p>\n<p id=\"e56a\" class=\"pw-post-body-paragraph nm nn fo be b no oj nq nr ns ok nu nv nw ol ny nz oa om oc od oe on og oh oi fh bj\" data-selectable-paragraph=\"\">For installation run the below command in your terminal:<\/p>\n<pre class=\"pg ph pi pj pk px py pz qa ax qb bj\"><span id=\"b581\" class=\"oo mp fo py b ho qc qd l ie qe\" data-selectable-paragraph=\"\">pip install comet_ml<\/span><\/pre>\n<p id=\"3dc0\" class=\"pw-post-body-paragraph nm nn fo be b no oj nq nr ns ok nu nv nw ol ny nz oa om oc od oe on og oh oi fh bj\" data-selectable-paragraph=\"\">Now that you have the comet_ml library installed, let\u2019s create a Comet account to get logging!<\/p>\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=\"4491\" class=\"mo mp fo be mq mr qo mt mu mv qp mx my mz qq nb nc nd qr nf ng nh qs nj nk nl bj\" data-selectable-paragraph=\"\">Creating your Comet Project<\/h1>\n<p id=\"1eaf\" class=\"pw-post-body-paragraph nm nn fo be b no np nq nr ns nt nu nv nw nx ny nz oa ob oc od oe of og oh oi fh bj\" data-selectable-paragraph=\"\">If you are new to Comet, open comet.com and click on \u201cCreate Free account.\u201d<\/p>\n<figure class=\"pg ph pi pj pk mb lt lu paragraph-image\">\n<div class=\"mc md eb me bg mf\" tabindex=\"0\" role=\"button\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg mg mh c\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:700\/1*be_fSFxjzNeyB10qpl2bnA.png\" alt=\"\" width=\"700\" height=\"338\"><\/figure><div class=\"lt lu qt\"><picture><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/format:webp\/1*be_fSFxjzNeyB10qpl2bnA.png 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/format:webp\/1*be_fSFxjzNeyB10qpl2bnA.png 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/format:webp\/1*be_fSFxjzNeyB10qpl2bnA.png 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/format:webp\/1*be_fSFxjzNeyB10qpl2bnA.png 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/format:webp\/1*be_fSFxjzNeyB10qpl2bnA.png 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/format:webp\/1*be_fSFxjzNeyB10qpl2bnA.png 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/format:webp\/1*be_fSFxjzNeyB10qpl2bnA.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*be_fSFxjzNeyB10qpl2bnA.png 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/1*be_fSFxjzNeyB10qpl2bnA.png 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/1*be_fSFxjzNeyB10qpl2bnA.png 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/1*be_fSFxjzNeyB10qpl2bnA.png 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/1*be_fSFxjzNeyB10qpl2bnA.png 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/1*be_fSFxjzNeyB10qpl2bnA.png 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/1*be_fSFxjzNeyB10qpl2bnA.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<figcaption class=\"mi mj mk lt lu ml mm be b bf z dv\" data-selectable-paragraph=\"\">Source: <a class=\"af mn\" href=\"https:\/\/www.comet.com\/site\/?cache=82782804\" target=\"_blank\" rel=\"noopener ugc nofollow\">comet.com<\/a><\/figcaption>\n<\/figure>\n<p id=\"7258\" class=\"pw-post-body-paragraph nm nn fo be b no oj nq nr ns ok nu nv nw ol ny nz oa om oc od oe on og oh oi fh bj\" data-selectable-paragraph=\"\">You can either sign up with your GitHub account or just use your email address.<\/p>\n<figure class=\"pg ph pi pj pk mb lt lu paragraph-image\">\n<div class=\"mc md eb me bg mf\" tabindex=\"0\" role=\"button\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg mg mh c\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:700\/1*Hn3tccNVhZE9ySYlQNl_yw.png\" alt=\"\" width=\"700\" height=\"978\"><\/figure><div class=\"lt lu qu\"><picture><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/format:webp\/1*Hn3tccNVhZE9ySYlQNl_yw.png 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/format:webp\/1*Hn3tccNVhZE9ySYlQNl_yw.png 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/format:webp\/1*Hn3tccNVhZE9ySYlQNl_yw.png 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/format:webp\/1*Hn3tccNVhZE9ySYlQNl_yw.png 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/format:webp\/1*Hn3tccNVhZE9ySYlQNl_yw.png 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/format:webp\/1*Hn3tccNVhZE9ySYlQNl_yw.png 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/format:webp\/1*Hn3tccNVhZE9ySYlQNl_yw.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*Hn3tccNVhZE9ySYlQNl_yw.png 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/1*Hn3tccNVhZE9ySYlQNl_yw.png 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/1*Hn3tccNVhZE9ySYlQNl_yw.png 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/1*Hn3tccNVhZE9ySYlQNl_yw.png 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/1*Hn3tccNVhZE9ySYlQNl_yw.png 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/1*Hn3tccNVhZE9ySYlQNl_yw.png 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/1*Hn3tccNVhZE9ySYlQNl_yw.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<figcaption class=\"mi mj mk lt lu ml mm be b bf z dv\" data-selectable-paragraph=\"\">Source: <a class=\"af mn\" href=\"\/signup\" target=\"_blank\" rel=\"noopener ugc nofollow\">\/signup<\/a><\/figcaption>\n<\/figure>\n<p id=\"8e07\" class=\"pw-post-body-paragraph nm nn fo be b no oj nq nr ns ok nu nv nw ol ny nz oa om oc od oe on og oh oi fh bj\" data-selectable-paragraph=\"\">Next, you can create a new project by clicking on \u201c+ New Project\u201d and adding in the project name, description, and whether to keep it private or share it publicly.<\/p>\n<figure class=\"pg ph pi pj pk mb lt lu paragraph-image\">\n<div class=\"mc md eb me bg mf\" tabindex=\"0\" role=\"button\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg mg mh c\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:700\/1*OrpUOFKHgbSc-ZUEmPIiYA.png\" alt=\"\" width=\"700\" height=\"140\"><\/figure><div class=\"lt lu qv\"><picture><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/format:webp\/1*OrpUOFKHgbSc-ZUEmPIiYA.png 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/format:webp\/1*OrpUOFKHgbSc-ZUEmPIiYA.png 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/format:webp\/1*OrpUOFKHgbSc-ZUEmPIiYA.png 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/format:webp\/1*OrpUOFKHgbSc-ZUEmPIiYA.png 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/format:webp\/1*OrpUOFKHgbSc-ZUEmPIiYA.png 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/format:webp\/1*OrpUOFKHgbSc-ZUEmPIiYA.png 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/format:webp\/1*OrpUOFKHgbSc-ZUEmPIiYA.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*OrpUOFKHgbSc-ZUEmPIiYA.png 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/1*OrpUOFKHgbSc-ZUEmPIiYA.png 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/1*OrpUOFKHgbSc-ZUEmPIiYA.png 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/1*OrpUOFKHgbSc-ZUEmPIiYA.png 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/1*OrpUOFKHgbSc-ZUEmPIiYA.png 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/1*OrpUOFKHgbSc-ZUEmPIiYA.png 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/1*OrpUOFKHgbSc-ZUEmPIiYA.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<figcaption class=\"mi mj mk lt lu ml mm be b bf z dv\" data-selectable-paragraph=\"\">Source: comet.com<\/figcaption>\n<\/figure>\n<figure class=\"pg ph pi pj pk mb lt lu paragraph-image\">\n<div class=\"mc md eb me bg mf\" tabindex=\"0\" role=\"button\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg mg mh c\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:700\/1*MEf-BB-8Zw1RBtkIH-5LAQ.png\" alt=\"\" width=\"700\" height=\"713\"><\/figure><div class=\"lt lu qw\"><picture><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/format:webp\/1*MEf-BB-8Zw1RBtkIH-5LAQ.png 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/format:webp\/1*MEf-BB-8Zw1RBtkIH-5LAQ.png 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/format:webp\/1*MEf-BB-8Zw1RBtkIH-5LAQ.png 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/format:webp\/1*MEf-BB-8Zw1RBtkIH-5LAQ.png 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/format:webp\/1*MEf-BB-8Zw1RBtkIH-5LAQ.png 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/format:webp\/1*MEf-BB-8Zw1RBtkIH-5LAQ.png 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/format:webp\/1*MEf-BB-8Zw1RBtkIH-5LAQ.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*MEf-BB-8Zw1RBtkIH-5LAQ.png 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/1*MEf-BB-8Zw1RBtkIH-5LAQ.png 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/1*MEf-BB-8Zw1RBtkIH-5LAQ.png 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/1*MEf-BB-8Zw1RBtkIH-5LAQ.png 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/1*MEf-BB-8Zw1RBtkIH-5LAQ.png 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/1*MEf-BB-8Zw1RBtkIH-5LAQ.png 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/1*MEf-BB-8Zw1RBtkIH-5LAQ.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<figcaption class=\"mi mj mk lt lu ml mm be b bf z dv\" data-selectable-paragraph=\"\">Source: comet.com<\/figcaption>\n<\/figure>\n<p id=\"34e5\" class=\"pw-post-body-paragraph nm nn fo be b no oj nq nr ns ok nu nv nw ol ny nz oa om oc od oe on og oh oi fh bj\" data-selectable-paragraph=\"\">Click on \u201cQuick Start Guide\u201d to reach the setup instructions page where you will find your API key.<\/p>\n<figure class=\"pg ph pi pj pk mb lt lu paragraph-image\">\n<div class=\"mc md eb me bg mf\" tabindex=\"0\" role=\"button\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg mg mh c\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:700\/1*pozkykz32CiGlpeSK_S78Q.png\" alt=\"\" width=\"700\" height=\"376\"><\/figure><div class=\"lt lu qx\"><picture><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/format:webp\/1*pozkykz32CiGlpeSK_S78Q.png 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/format:webp\/1*pozkykz32CiGlpeSK_S78Q.png 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/format:webp\/1*pozkykz32CiGlpeSK_S78Q.png 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/format:webp\/1*pozkykz32CiGlpeSK_S78Q.png 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/format:webp\/1*pozkykz32CiGlpeSK_S78Q.png 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/format:webp\/1*pozkykz32CiGlpeSK_S78Q.png 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/format:webp\/1*pozkykz32CiGlpeSK_S78Q.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*pozkykz32CiGlpeSK_S78Q.png 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/1*pozkykz32CiGlpeSK_S78Q.png 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/1*pozkykz32CiGlpeSK_S78Q.png 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/1*pozkykz32CiGlpeSK_S78Q.png 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/1*pozkykz32CiGlpeSK_S78Q.png 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/1*pozkykz32CiGlpeSK_S78Q.png 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/1*pozkykz32CiGlpeSK_S78Q.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<figcaption class=\"mi mj mk lt lu ml mm be b bf z dv\" data-selectable-paragraph=\"\">Source: comet.com<\/figcaption>\n<\/figure>\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=\"6d0e\" class=\"mo mp fo be mq mr qo mt mu mv qp mx my mz qq nb nc nd qr nf ng nh qs nj nk nl bj\" data-selectable-paragraph=\"\">Logging Visualizations<\/h1>\n<p id=\"350a\" class=\"pw-post-body-paragraph nm nn fo be b no np nq nr ns nt nu nv nw nx ny nz oa ob oc od oe of og oh oi fh bj\" data-selectable-paragraph=\"\">Before you start writing the code, you need to add the following lines of code at the top of your Python script or Jupyter notebook.<\/p>\n<pre class=\"pg ph pi pj pk px py pz qa ax qb bj\"><span id=\"bf3f\" class=\"oo mp fo py b ho qc qd l ie qe\" data-selectable-paragraph=\"\">from comet_ml import Experiment<\/span><span id=\"fc4a\" class=\"oo mp fo py b ho qy qd l ie qe\" data-selectable-paragraph=\"\">experiment = Experiment(\n    api_key=\"add your api key here\",\n    project_name=\"add your project name here\",\n    workspace=\"add your workspace name here\",\n)<\/span><\/pre>\n<p id=\"d7a8\" class=\"pw-post-body-paragraph nm nn fo be b no oj nq nr ns ok nu nv nw ol ny nz oa om oc od oe on og oh oi fh bj\" data-selectable-paragraph=\"\">Now that you have your tools sorted, let\u2019s get to the business. You will be experimenting with the popular<a class=\"af mn\" href=\"https:\/\/www.kaggle.com\/datasets\/rakannimer\/air-passengers\" target=\"_blank\" rel=\"noopener ugc nofollow\"> Air Passenger<\/a> data which has seasonality and trend, apart from the Autoregressive and Moving Average features.<\/p>\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=\"qz\"><p id=\"762e\" class=\"ra rb fo be rc rd re rf rg rh ri oi dv\" data-selectable-paragraph=\"\">Curious to try Comet on your own? <a class=\"af mn\" href=\"https:\/\/bit.ly\/3RWOkg4\" target=\"_blank\" rel=\"noopener ugc nofollow\">Sign up for your free account today!<\/a><\/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=\"709a\" class=\"mo mp fo be mq mr qo mt mu mv qp mx my mz qq nb nc nd qr nf ng nh qs nj nk nl bj\" data-selectable-paragraph=\"\">Data Preparation<\/h1>\n<p id=\"62ba\" class=\"pw-post-body-paragraph nm nn fo be b no np nq nr ns nt nu nv nw nx ny nz oa ob oc od oe of og oh oi fh bj\" data-selectable-paragraph=\"\">You need to convert a Pandas Data Frame to a Time Series Data format using the \u201cTimeSeriesData\u201d method. Also, it requires the time dimension and the value dimension, which would require you to rename the Data Frame columns.<\/p>\n<p id=\"1343\" class=\"pw-post-body-paragraph nm nn fo be b no oj nq nr ns ok nu nv nw ol ny nz oa om oc od oe on og oh oi fh bj\" data-selectable-paragraph=\"\">Let\u2019s do this step by step.<\/p>\n<p id=\"a2a9\" class=\"pw-post-body-paragraph nm nn fo be b no oj nq nr ns ok nu nv nw ol ny nz oa om oc od oe on og oh oi fh bj\" data-selectable-paragraph=\"\"><strong class=\"be pr\">Import Required Libraries<\/strong><\/p>\n<pre class=\"pg ph pi pj pk px py pz qa ax qb bj\"><span id=\"0668\" class=\"oo mp fo py b ho qc qd l ie qe\" data-selectable-paragraph=\"\">import pandas as pd\nimport matplotlib.pyplot as plt\nfrom kats.consts import TimeSeriesData<\/span><\/pre>\n<p id=\"2ca5\" class=\"pw-post-body-paragraph nm nn fo be b no oj nq nr ns ok nu nv nw ol ny nz oa om oc od oe on og oh oi fh bj\" data-selectable-paragraph=\"\"><strong class=\"be pr\">Read CSV data and view the top five rows.<\/strong><\/p>\n<pre class=\"pg ph pi pj pk px py pz qa ax qb bj\"><span id=\"80d6\" class=\"oo mp fo py b ho qc qd l ie qe\" data-selectable-paragraph=\"\">ap_df = pd.read_csv(\"AirPassengers.csv\")\nap_df.head()<\/span><\/pre>\n<figure class=\"pg ph pi pj pk mb lt lu paragraph-image\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg mg mh c\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:344\/1*88YffRddQs7241dhGz2Oeg.png\" alt=\"\" width=\"344\" height=\"342\"><\/figure><div class=\"lt lu rj\"><picture><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/format:webp\/1*88YffRddQs7241dhGz2Oeg.png 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/format:webp\/1*88YffRddQs7241dhGz2Oeg.png 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/format:webp\/1*88YffRddQs7241dhGz2Oeg.png 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/format:webp\/1*88YffRddQs7241dhGz2Oeg.png 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/format:webp\/1*88YffRddQs7241dhGz2Oeg.png 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/format:webp\/1*88YffRddQs7241dhGz2Oeg.png 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:688\/format:webp\/1*88YffRddQs7241dhGz2Oeg.png 688w\" 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, 344px\"><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/1*88YffRddQs7241dhGz2Oeg.png 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/1*88YffRddQs7241dhGz2Oeg.png 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/1*88YffRddQs7241dhGz2Oeg.png 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/1*88YffRddQs7241dhGz2Oeg.png 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/1*88YffRddQs7241dhGz2Oeg.png 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/1*88YffRddQs7241dhGz2Oeg.png 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:688\/1*88YffRddQs7241dhGz2Oeg.png 688w\" 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, 344px\" data-testid=\"og\"><\/picture><\/div>\n<figcaption class=\"mi mj mk lt lu ml mm be b bf z dv\" data-selectable-paragraph=\"\">Source: Author<\/figcaption>\n<\/figure>\n<p id=\"674e\" class=\"pw-post-body-paragraph nm nn fo be b no oj nq nr ns ok nu nv nw ol ny nz oa om oc od oe on og oh oi fh bj\" data-selectable-paragraph=\"\">This looks great: you have monthly air passenger numbers from January 1949 to December 1960. You can get this by:<\/p>\n<pre class=\"pg ph pi pj pk px py pz qa ax qb bj\"><span id=\"d569\" class=\"oo mp fo py b ho qc qd l ie qe\" data-selectable-paragraph=\"\"># Start month in the Data Frame\nap_df.min()<\/span><span id=\"6189\" class=\"oo mp fo py b ho qy qd l ie qe\" data-selectable-paragraph=\"\"># End month in the Date Frame\nap_df.max()<\/span><\/pre>\n<p id=\"a34d\" class=\"pw-post-body-paragraph nm nn fo be b no oj nq nr ns ok nu nv nw ol ny nz oa om oc od oe on og oh oi fh bj\" data-selectable-paragraph=\"\"><strong class=\"be pr\">Plot the Air Passenger data.<\/strong><\/p>\n<p id=\"2f41\" class=\"pw-post-body-paragraph nm nn fo be b no oj nq nr ns ok nu nv nw ol ny nz oa om oc od oe on og oh oi fh bj\" data-selectable-paragraph=\"\">Set the figure size as per your need, then plot a line chart, and finally log your chart to the experiment in the Comet project using log_figure(). This can be viewed under the \u201cGraphics\u201d tab in the project web interface.<\/p>\n<figure class=\"pg ph pi pj pk mb lt lu paragraph-image\">\n<div class=\"mc md eb me bg mf\" tabindex=\"0\" role=\"button\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg mg mh c\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:700\/1*EQdF_xx42rikGQu9SZmTFQ.png\" alt=\"\" width=\"700\" height=\"423\"><\/figure><div class=\"lt lu rk\"><picture><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/format:webp\/1*EQdF_xx42rikGQu9SZmTFQ.png 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/format:webp\/1*EQdF_xx42rikGQu9SZmTFQ.png 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/format:webp\/1*EQdF_xx42rikGQu9SZmTFQ.png 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/format:webp\/1*EQdF_xx42rikGQu9SZmTFQ.png 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/format:webp\/1*EQdF_xx42rikGQu9SZmTFQ.png 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/format:webp\/1*EQdF_xx42rikGQu9SZmTFQ.png 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/format:webp\/1*EQdF_xx42rikGQu9SZmTFQ.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*EQdF_xx42rikGQu9SZmTFQ.png 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/1*EQdF_xx42rikGQu9SZmTFQ.png 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/1*EQdF_xx42rikGQu9SZmTFQ.png 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/1*EQdF_xx42rikGQu9SZmTFQ.png 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/1*EQdF_xx42rikGQu9SZmTFQ.png 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/1*EQdF_xx42rikGQu9SZmTFQ.png 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/1*EQdF_xx42rikGQu9SZmTFQ.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<figcaption class=\"mi mj mk lt lu ml mm be b bf z dv\" data-selectable-paragraph=\"\">Source: Author<\/figcaption>\n<\/figure>\n<p id=\"4a00\" class=\"pw-post-body-paragraph nm nn fo be b no oj nq nr ns ok nu nv nw ol ny nz oa om oc od oe on og oh oi fh bj\" data-selectable-paragraph=\"\">Code for plotting and logging the figure is as under:<\/p>\n<pre class=\"pg ph pi pj pk px py pz qa ax qb bj\"><span id=\"824c\" class=\"oo mp fo py b ho qc qd l ie qe\" data-selectable-paragraph=\"\">plt.figure(figsize=(35,20))\nfig = plt.plot(ap_df['Month'], ap_df[\"#Passengers\"])\nplt.xticks(rotation=90)\nexperiment.log_figure(figure_name = \"Complete Data\", figure=fig, overwrite=False)<\/span><\/pre>\n<figure class=\"pg ph pi pj pk mb lt lu paragraph-image\">\n<div class=\"mc md eb me bg mf\" tabindex=\"0\" role=\"button\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg mg mh c\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:700\/1*7-Z2TkE6_VhMlygkctHWxw.png\" alt=\"\" width=\"700\" height=\"406\"><\/figure><div class=\"lt lu rl\"><picture><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/format:webp\/1*7-Z2TkE6_VhMlygkctHWxw.png 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/format:webp\/1*7-Z2TkE6_VhMlygkctHWxw.png 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/format:webp\/1*7-Z2TkE6_VhMlygkctHWxw.png 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/format:webp\/1*7-Z2TkE6_VhMlygkctHWxw.png 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/format:webp\/1*7-Z2TkE6_VhMlygkctHWxw.png 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/format:webp\/1*7-Z2TkE6_VhMlygkctHWxw.png 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/format:webp\/1*7-Z2TkE6_VhMlygkctHWxw.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*7-Z2TkE6_VhMlygkctHWxw.png 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/1*7-Z2TkE6_VhMlygkctHWxw.png 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/1*7-Z2TkE6_VhMlygkctHWxw.png 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/1*7-Z2TkE6_VhMlygkctHWxw.png 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/1*7-Z2TkE6_VhMlygkctHWxw.png 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/1*7-Z2TkE6_VhMlygkctHWxw.png 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/1*7-Z2TkE6_VhMlygkctHWxw.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<figcaption class=\"mi mj mk lt lu ml mm be b bf z dv\" data-selectable-paragraph=\"\">Source: Author<\/figcaption>\n<\/figure>\n<p id=\"f011\" class=\"pw-post-body-paragraph nm nn fo be b no oj nq nr ns ok nu nv nw ol ny nz oa om oc od oe on og oh oi fh bj\" data-selectable-paragraph=\"\">From the chart, you can observe that there is an increasing trend in the number of air passengers along with an overall increase in the amplitude of variation in yearly traffic. As expected, air travel has a 12-month seasonality.<\/p>\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=\"53d2\" class=\"mo mp fo be mq mr qo mt mu mv qp mx my mz qq nb nc nd qr nf ng nh qs nj nk nl bj\" data-selectable-paragraph=\"\">Outlier Detection<\/h1>\n<p id=\"3a96\" class=\"pw-post-body-paragraph nm nn fo be b no np nq nr ns nt nu nv nw nx ny nz oa ob oc od oe of og oh oi fh bj\" data-selectable-paragraph=\"\">Air Passenger data is a model dataset which doesn\u2019t contain any anomalies or outliers. For the purpose of this exercise, let\u2019s add an artificial outlier and observe if Kats is able to find the mouse. Uh oh! the outlier!<\/p>\n<p id=\"d443\" class=\"pw-post-body-paragraph nm nn fo be b no oj nq nr ns ok nu nv nw ol ny nz oa om oc od oe on og oh oi fh bj\" data-selectable-paragraph=\"\">Let\u2019s change one of the values in the Data Frame to a very large value i.e. 700 in this case.<\/p>\n<pre class=\"pg ph pi pj pk px py pz qa ax qb bj\"><span id=\"0c80\" class=\"oo mp fo py b ho qc qd l ie qe\" data-selectable-paragraph=\"\">ap_df['#Passengers'][50]=700<\/span><\/pre>\n<p id=\"758a\" class=\"pw-post-body-paragraph nm nn fo be b no oj nq nr ns ok nu nv nw ol ny nz oa om oc od oe on og oh oi fh bj\" data-selectable-paragraph=\"\">Let\u2019s visualize the data to represent the outlier.<\/p>\n<pre class=\"pg ph pi pj pk px py pz qa ax qb bj\"><span id=\"4d34\" class=\"oo mp fo py b ho qc qd l ie qe\" data-selectable-paragraph=\"\">plt.figure(figsize=(15,10))\nfig = plt.plot(ap_df['Month'], ap_df[\"#Passengers\"])\nexperiment.log_figure(figure_name = \"Complete Data with Anomaly\", figure=fig, overwrite=False)<\/span><\/pre>\n<figure class=\"pg ph pi pj pk mb lt lu paragraph-image\">\n<div class=\"mc md eb me bg mf\" tabindex=\"0\" role=\"button\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg mg mh c\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:700\/1*I4Cvu7qZ0FCc4dU9h3Ft7g.png\" alt=\"\" width=\"700\" height=\"408\"><\/figure><div class=\"lt lu rm\"><picture><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/format:webp\/1*I4Cvu7qZ0FCc4dU9h3Ft7g.png 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/format:webp\/1*I4Cvu7qZ0FCc4dU9h3Ft7g.png 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/format:webp\/1*I4Cvu7qZ0FCc4dU9h3Ft7g.png 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/format:webp\/1*I4Cvu7qZ0FCc4dU9h3Ft7g.png 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/format:webp\/1*I4Cvu7qZ0FCc4dU9h3Ft7g.png 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/format:webp\/1*I4Cvu7qZ0FCc4dU9h3Ft7g.png 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/format:webp\/1*I4Cvu7qZ0FCc4dU9h3Ft7g.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*I4Cvu7qZ0FCc4dU9h3Ft7g.png 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/1*I4Cvu7qZ0FCc4dU9h3Ft7g.png 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/1*I4Cvu7qZ0FCc4dU9h3Ft7g.png 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/1*I4Cvu7qZ0FCc4dU9h3Ft7g.png 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/1*I4Cvu7qZ0FCc4dU9h3Ft7g.png 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/1*I4Cvu7qZ0FCc4dU9h3Ft7g.png 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/1*I4Cvu7qZ0FCc4dU9h3Ft7g.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<figcaption class=\"mi mj mk lt lu ml mm be b bf z dv\" data-selectable-paragraph=\"\">Source: Author<\/figcaption>\n<\/figure>\n<p id=\"7e51\" class=\"pw-post-body-paragraph nm nn fo be b no oj nq nr ns ok nu nv nw ol ny nz oa om oc od oe on og oh oi fh bj\" data-selectable-paragraph=\"\">For using Kats, let\u2019s do the following:<\/p>\n<ul class=\"\">\n<li id=\"441d\" class=\"nm nn fo be b no oj nq nr ns ok nu nv pl ol ny nz pm om oc od pn on og oh oi po pp pq bj\" data-selectable-paragraph=\"\">Convert the \u2018Month\u2019 column to the DateTime format.<\/li>\n<li id=\"52e7\" class=\"nm nn fo be b no ps nq nr ns pt nu nv pl pu ny nz pm pv oc od pn pw og oh oi po pp pq bj\" data-selectable-paragraph=\"\">Rename the columns in the data frame to \u2018time\u2019 and \u2018value\u2019 respectively.<\/li>\n<li id=\"6109\" class=\"nm nn fo be b no ps nq nr ns pt nu nv pl pu ny nz pm pv oc od pn pw og oh oi po pp pq bj\" data-selectable-paragraph=\"\">Convert data frame object to Time Series data object.<\/li>\n<li id=\"a207\" class=\"nm nn fo be b no ps nq nr ns pt nu nv pl pu ny nz pm pv oc od pn pw og oh oi po pp pq bj\" data-selectable-paragraph=\"\">Then use the Outlier Detector method to identify outliers.<\/li>\n<li id=\"9078\" class=\"nm nn fo be b no ps nq nr ns pt nu nv pl pu ny nz pm pv oc od pn pw og oh oi po pp pq bj\" data-selectable-paragraph=\"\">Now output the top one outlier at zero indexes of the detector object.<\/li>\n<\/ul>\n<pre class=\"pg ph pi pj pk px py pz qa ax qb bj\"><span id=\"e93c\" class=\"oo mp fo py b ho qc qd l ie qe\" data-selectable-paragraph=\"\">ap_df['Month'] = pd.to_datetime(ap_df['Month'])\nap_df.columns = ['time', 'value']\noutlier_ts = TimeSeriesData(ap_df)\nts_outlierDetection = OutlierDetector(outlier_ts, 'multiplicative')\nts_outlierDetection.detector()<\/span><span id=\"cbf1\" class=\"oo mp fo py b ho qy qd l ie qe\" data-selectable-paragraph=\"\">ts_outlierDetection.outliers[0]<\/span><\/pre>\n<figure class=\"pg ph pi pj pk mb lt lu paragraph-image\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg mg mh c\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:584\/1*pmhf7itKqhPVNso_tz8kIQ.png\" alt=\"\" width=\"584\" height=\"56\"><\/figure><div class=\"lt lu rn\"><picture><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/format:webp\/1*pmhf7itKqhPVNso_tz8kIQ.png 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/format:webp\/1*pmhf7itKqhPVNso_tz8kIQ.png 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/format:webp\/1*pmhf7itKqhPVNso_tz8kIQ.png 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/format:webp\/1*pmhf7itKqhPVNso_tz8kIQ.png 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/format:webp\/1*pmhf7itKqhPVNso_tz8kIQ.png 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/format:webp\/1*pmhf7itKqhPVNso_tz8kIQ.png 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1168\/format:webp\/1*pmhf7itKqhPVNso_tz8kIQ.png 1168w\" 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, 584px\"><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/1*pmhf7itKqhPVNso_tz8kIQ.png 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/1*pmhf7itKqhPVNso_tz8kIQ.png 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/1*pmhf7itKqhPVNso_tz8kIQ.png 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/1*pmhf7itKqhPVNso_tz8kIQ.png 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/1*pmhf7itKqhPVNso_tz8kIQ.png 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/1*pmhf7itKqhPVNso_tz8kIQ.png 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1168\/1*pmhf7itKqhPVNso_tz8kIQ.png 1168w\" 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, 584px\" data-testid=\"og\"><\/picture><\/div>\n<figcaption class=\"mi mj mk lt lu ml mm be b bf z dv\" data-selectable-paragraph=\"\">Source: Author<\/figcaption>\n<\/figure>\n<p id=\"38bd\" class=\"pw-post-body-paragraph nm nn fo be b no oj nq nr ns ok nu nv nw ol ny nz oa om oc od oe on og oh oi fh bj\" data-selectable-paragraph=\"\">Once you identify an outlier you can either decide to remove it or replace it with another value. This is called interpolation. Use the code below to interpolate the outlier.<\/p>\n<pre class=\"pg ph pi pj pk px py pz qa ax qb bj\"><span id=\"8a2f\" class=\"oo mp fo py b ho qc qd l ie qe\" data-selectable-paragraph=\"\">outlier_ts_interpolated = ts_outlierDetection.remover(interpolate = True)<\/span><\/pre>\n<p id=\"f72b\" class=\"pw-post-body-paragraph nm nn fo be b no oj nq nr ns ok nu nv nw ol ny nz oa om oc od oe on og oh oi fh bj\" data-selectable-paragraph=\"\">Convert the Time Series Data object to the Data Frame object and rename the columns to the original names.<\/p>\n<pre class=\"pg ph pi pj pk px py pz qa ax qb bj\"><span id=\"ab56\" class=\"oo mp fo py b ho qc qd l ie qe\" data-selectable-paragraph=\"\">ap_df = outlier_ts_interpolated.to_dataframe()\nap_df.columns = ['Month', \"#Passengers\"]<\/span><\/pre>\n<p id=\"04a4\" class=\"pw-post-body-paragraph nm nn fo be b no oj nq nr ns ok nu nv nw ol ny nz oa om oc od oe on og oh oi fh bj\" data-selectable-paragraph=\"\">Now, let\u2019s visualize the data again to see if the outlier is interpolated well by the algorithm.<\/p>\n<pre class=\"pg ph pi pj pk px py pz qa ax qb bj\"><span id=\"24af\" class=\"oo mp fo py b ho qc qd l ie qe\" data-selectable-paragraph=\"\">plt.figure(figsize=(15,10))\nfig = plt.plot(ap_df['Month'], ap_df[\"#Passengers\"])\nexperiment.log_figure(figure_name = \"Anomaly Removed\", figure=fig, overwrite=False)<\/span><\/pre>\n<figure class=\"pg ph pi pj pk mb lt lu paragraph-image\">\n<div class=\"mc md eb me bg mf\" tabindex=\"0\" role=\"button\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg mg mh c\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:700\/1*Rq7rKJvTHavNdyrIRHUqbA.png\" alt=\"\" width=\"700\" height=\"457\"><\/figure><div class=\"lt lu ro\"><picture><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/format:webp\/1*Rq7rKJvTHavNdyrIRHUqbA.png 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/format:webp\/1*Rq7rKJvTHavNdyrIRHUqbA.png 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/format:webp\/1*Rq7rKJvTHavNdyrIRHUqbA.png 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/format:webp\/1*Rq7rKJvTHavNdyrIRHUqbA.png 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/format:webp\/1*Rq7rKJvTHavNdyrIRHUqbA.png 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/format:webp\/1*Rq7rKJvTHavNdyrIRHUqbA.png 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/format:webp\/1*Rq7rKJvTHavNdyrIRHUqbA.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*Rq7rKJvTHavNdyrIRHUqbA.png 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/1*Rq7rKJvTHavNdyrIRHUqbA.png 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/1*Rq7rKJvTHavNdyrIRHUqbA.png 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/1*Rq7rKJvTHavNdyrIRHUqbA.png 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/1*Rq7rKJvTHavNdyrIRHUqbA.png 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/1*Rq7rKJvTHavNdyrIRHUqbA.png 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/1*Rq7rKJvTHavNdyrIRHUqbA.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<figcaption class=\"mi mj mk lt lu ml mm be b bf z dv\" data-selectable-paragraph=\"\">Source: Author<\/figcaption>\n<\/figure>\n<p id=\"20c5\" class=\"pw-post-body-paragraph nm nn fo be b no oj nq nr ns ok nu nv nw ol ny nz oa om oc od oe on og oh oi fh bj\" data-selectable-paragraph=\"\">Voila! You got back the original clean data again.<\/p>\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=\"rp rq rr\"><p id=\"d400\" class=\"nm nn rs be b no oj nq nr ns ok nu nv pl ol ny nz pm om oc od pn on og oh oi fh bj\" data-selectable-paragraph=\"\">Note: If you are using a notebook for running your experiments, don\u2019t forget to call <strong class=\"be pr\"><em class=\"fo\">experiement.end()<\/em><\/strong> when you are done.<\/p><\/blockquote>\n<h1 id=\"edf2\" class=\"mo mp fo be mq mr ms mt mu mv mw mx my mz na nb nc nd ne nf ng nh ni nj nk nl bj\" data-selectable-paragraph=\"\">Summary<\/h1>\n<p id=\"098b\" class=\"pw-post-body-paragraph nm nn fo be b no np nq nr ns nt nu nv nw nx ny nz oa ob oc od oe of og oh oi fh bj\" data-selectable-paragraph=\"\">In this post, you learned how to handle outliers with the Facebook Kats library. You also learned how to create a free community account with comet.com and to log charts using Comet\u2019s Python API.<\/p>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Photo by Jake Hills on Unsplash Introduction Time series applications are ubiquitous and find applications in various industries such as supply chain, e-commerce, finance, retail, biotechnology, weather prediction, oil and energy, manufacturing, astronomy, etc. These applications generate data that can be noisy in the real world as some unaccounted factors can influence the measurements. For [&hellip;]<\/p>\n","protected":false},"author":80,"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":[6],"tags":[],"coauthors":[177],"class_list":["post-7270","post","type-post","status-publish","format-standard","hentry","category-machine-learning"],"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>Outlier Detection in Time Series with Kats and 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\/outlier-detection-in-time-series-with-kats-and-comet\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Outlier Detection in Time Series with Kats and Comet\" \/>\n<meta property=\"og:description\" content=\"Photo by Jake Hills on Unsplash Introduction Time series applications are ubiquitous and find applications in various industries such as supply chain, e-commerce, finance, retail, biotechnology, weather prediction, oil and energy, manufacturing, astronomy, etc. These applications generate data that can be noisy in the real world as some unaccounted factors can influence the measurements. For [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.comet.com\/site\/blog\/outlier-detection-in-time-series-with-kats-and-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-08-21T17:45:49+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-04-24T17:14:34+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/miro.medium.com\/v2\/resize:fit:700\/0*ZXRoM8gPPcCXwiue\" \/>\n<meta name=\"author\" content=\"Ankit Malik\" \/>\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=\"Ankit Malik\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 minutes\" \/>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Outlier Detection in Time Series with Kats and 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\/outlier-detection-in-time-series-with-kats-and-comet\/","og_locale":"en_US","og_type":"article","og_title":"Outlier Detection in Time Series with Kats and Comet","og_description":"Photo by Jake Hills on Unsplash Introduction Time series applications are ubiquitous and find applications in various industries such as supply chain, e-commerce, finance, retail, biotechnology, weather prediction, oil and energy, manufacturing, astronomy, etc. These applications generate data that can be noisy in the real world as some unaccounted factors can influence the measurements. For [&hellip;]","og_url":"https:\/\/www.comet.com\/site\/blog\/outlier-detection-in-time-series-with-kats-and-comet\/","og_site_name":"Comet","article_publisher":"https:\/\/www.facebook.com\/cometdotml","article_published_time":"2023-08-21T17:45:49+00:00","article_modified_time":"2025-04-24T17:14:34+00:00","og_image":[{"url":"https:\/\/miro.medium.com\/v2\/resize:fit:700\/0*ZXRoM8gPPcCXwiue","type":"","width":"","height":""}],"author":"Ankit Malik","twitter_card":"summary_large_image","twitter_creator":"@Cometml","twitter_site":"@Cometml","twitter_misc":{"Written by":"Ankit Malik","Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.comet.com\/site\/blog\/outlier-detection-in-time-series-with-kats-and-comet\/#article","isPartOf":{"@id":"https:\/\/www.comet.com\/site\/blog\/outlier-detection-in-time-series-with-kats-and-comet\/"},"author":{"name":"Ankit Malik","@id":"https:\/\/www.comet.com\/site\/#\/schema\/person\/3f1178f2089090fdd2ffe0a43bccad23"},"headline":"Outlier Detection in Time Series with Kats and Comet","datePublished":"2023-08-21T17:45:49+00:00","dateModified":"2025-04-24T17:14:34+00:00","mainEntityOfPage":{"@id":"https:\/\/www.comet.com\/site\/blog\/outlier-detection-in-time-series-with-kats-and-comet\/"},"wordCount":1021,"publisher":{"@id":"https:\/\/www.comet.com\/site\/#organization"},"image":{"@id":"https:\/\/www.comet.com\/site\/blog\/outlier-detection-in-time-series-with-kats-and-comet\/#primaryimage"},"thumbnailUrl":"https:\/\/miro.medium.com\/v2\/resize:fit:700\/0*ZXRoM8gPPcCXwiue","articleSection":["Machine Learning"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.comet.com\/site\/blog\/outlier-detection-in-time-series-with-kats-and-comet\/","url":"https:\/\/www.comet.com\/site\/blog\/outlier-detection-in-time-series-with-kats-and-comet\/","name":"Outlier Detection in Time Series with Kats and Comet - Comet","isPartOf":{"@id":"https:\/\/www.comet.com\/site\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.comet.com\/site\/blog\/outlier-detection-in-time-series-with-kats-and-comet\/#primaryimage"},"image":{"@id":"https:\/\/www.comet.com\/site\/blog\/outlier-detection-in-time-series-with-kats-and-comet\/#primaryimage"},"thumbnailUrl":"https:\/\/miro.medium.com\/v2\/resize:fit:700\/0*ZXRoM8gPPcCXwiue","datePublished":"2023-08-21T17:45:49+00:00","dateModified":"2025-04-24T17:14:34+00:00","breadcrumb":{"@id":"https:\/\/www.comet.com\/site\/blog\/outlier-detection-in-time-series-with-kats-and-comet\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.comet.com\/site\/blog\/outlier-detection-in-time-series-with-kats-and-comet\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.comet.com\/site\/blog\/outlier-detection-in-time-series-with-kats-and-comet\/#primaryimage","url":"https:\/\/miro.medium.com\/v2\/resize:fit:700\/0*ZXRoM8gPPcCXwiue","contentUrl":"https:\/\/miro.medium.com\/v2\/resize:fit:700\/0*ZXRoM8gPPcCXwiue"},{"@type":"BreadcrumbList","@id":"https:\/\/www.comet.com\/site\/blog\/outlier-detection-in-time-series-with-kats-and-comet\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.comet.com\/site\/"},{"@type":"ListItem","position":2,"name":"Outlier Detection in Time Series with Kats and 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\/3f1178f2089090fdd2ffe0a43bccad23","name":"Ankit Malik","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.comet.com\/site\/#\/schema\/person\/image\/970af032afc7d64150dc70c5b5047e00","url":"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/08\/1687779949530-96x96.jpg","contentUrl":"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/08\/1687779949530-96x96.jpg","caption":"Ankit Malik"},"url":"https:\/\/www.comet.com\/site\/blog\/author\/ank-dsmgmail-com\/"}]}},"_links":{"self":[{"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/posts\/7270","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\/80"}],"replies":[{"embeddable":true,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/comments?post=7270"}],"version-history":[{"count":1,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/posts\/7270\/revisions"}],"predecessor-version":[{"id":15570,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/posts\/7270\/revisions\/15570"}],"wp:attachment":[{"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/media?parent=7270"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/categories?post=7270"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/tags?post=7270"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/coauthors?post=7270"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}