{"id":7408,"date":"2023-09-11T09:00:59","date_gmt":"2023-09-11T17:00:59","guid":{"rendered":"https:\/\/live-cometml.pantheonsite.io\/?p=7408"},"modified":"2025-04-24T17:14:19","modified_gmt":"2025-04-24T17:14:19","slug":"an-end-to-end-guide-on-using-comet-mls-model-versioning-feature-part-1","status":"publish","type":"post","link":"https:\/\/www.comet.com\/site\/blog\/an-end-to-end-guide-on-using-comet-mls-model-versioning-feature-part-1\/","title":{"rendered":"An End-to-End Guide on Using Comet ML\u2019s Model Versioning Feature: Part 1"},"content":{"rendered":"\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=\"mi mj mk ml mm mn mf mg paragraph-image\">\n<div class=\"mo mp eb mq bg mr\" tabindex=\"0\" role=\"button\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg ms mt c\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:700\/0*5pt2phAH3GkZIlmU\" alt=\"A piece of graph paper with a hand-drawn line chart sitting on a wooden table with two pens, a ruler, and a book lying next to it.\" width=\"700\" height=\"467\"><\/figure><div class=\"mf mg mh\"><picture><\/picture><\/div>\n<\/div><figcaption class=\"mu mv mw mf mg mx my be b bf z dv\" data-selectable-paragraph=\"\">Photo by <a class=\"af mz\" href=\"https:\/\/unsplash.com\/@isaacmsmith?utm_source=medium&amp;utm_medium=referral\" target=\"_blank\" rel=\"noopener ugc nofollow\">Isaac Smith<\/a> on <a class=\"af mz\" href=\"https:\/\/unsplash.com\/?utm_source=medium&amp;utm_medium=referral\" target=\"_blank\" rel=\"noopener ugc nofollow\">Unsplash<\/a><\/figcaption><\/figure>\n<p id=\"2642\" class=\"pw-post-body-paragraph na nb fo be b gm nc nd ne gp nf ng nh ni nj nk nl nm nn no np nq nr ns nt nu fh bj\" data-selectable-paragraph=\"\">The world of machine learning and data science is awash with technicalities. With each passing day, it becomes ever more evident that a practitioner in this field needs to keep track of a lot of things lest they fall into the deluge of complexity.<\/p>\n<p id=\"b326\" class=\"pw-post-body-paragraph na nb fo be b gm nc nd ne gp nf ng nh ni nj nk nl nm nn no np nq nr ns nt nu fh bj\" data-selectable-paragraph=\"\">Fortunately, there are many workarounds to deal with many of the problems that normally arise. One problem that is particularly prevalent is model tracking. Machine learning problems could grow to such an extent that you constantly lose track of what you are doing. The direct effect of this is that it is possible to start getting deteriorating performance in models.<\/p>\n<p id=\"f43c\" class=\"pw-post-body-paragraph na nb fo be b gm nc nd ne gp nf ng nh ni nj nk nl nm nn no np nq nr ns nt nu fh bj\" data-selectable-paragraph=\"\">The fix around this is model tracking. This is keeping track and recording the changes and the performance of a given model. A model that is constantly evolving could see sharp rises in performance or declines depending on the work that is going into it. For this reason, you need to know what works best for you.<\/p>\n<p id=\"b31d\" class=\"pw-post-body-paragraph na nb fo be b gm nc nd ne gp nf ng nh ni nj nk nl nm nn no np nq nr ns nt nu fh bj\" data-selectable-paragraph=\"\">Comet ML has an intricate web of tools that combine simplicity and safety and allows one to not only track changes in their model but also deploy them as desired or shared in teams.<\/p>\n<h1 id=\"18fd\" class=\"nv nw fo be nx ny nz go oa ob oc gr od oe of og oh oi oj ok ol om on oo op oq bj\" data-selectable-paragraph=\"\">Workflow Overview<\/h1>\n<p id=\"fe4b\" class=\"pw-post-body-paragraph na nb fo be b gm or nd ne gp os ng nh ni ot nk nl nm ou no np nq ov ns nt nu fh bj\" data-selectable-paragraph=\"\">The typical iterative ML workflow involves preprocessing a dataset and then developing the model further. This could involve tuning hyperparameters and combining different algorithms in order to leverage their strengths and come up with a better-performing model.<\/p>\n<p id=\"b8dc\" class=\"pw-post-body-paragraph na nb fo be b gm nc nd ne gp nf ng nh ni nj nk nl nm nn no np nq nr ns nt nu fh bj\" data-selectable-paragraph=\"\">On top of this, it will be critical to export and track a model after each improvement or change in order to not get lost in the complexity of this activity. There will be a few requirements for this entire workflow. They are:<\/p>\n<ol class=\"\">\n<li id=\"b991\" class=\"na nb fo be b gm nc nd ne gp nf ng nh ni ow nk nl nm ox no np nq oy ns nt nu oz pa pb bj\" data-selectable-paragraph=\"\">A Comet ML <a class=\"af mz\" href=\"\/signup?utm_source=heartbeat&amp;utm_medium=referral&amp;utm_campaign=AMS_US_EN_SNUP_heartbeat_CTA\" target=\"_blank\" rel=\"noopener ugc nofollow\">account<\/a><\/li>\n<li id=\"2e34\" class=\"na nb fo be b gm pc nd ne gp pd ng nh ni pe nk nl nm pf no np nq pg ns nt nu oz pa pb bj\" data-selectable-paragraph=\"\">A suitable IDE, e.g., VSCode or Jupyter Notebook which can also run in VSCode<\/li>\n<li id=\"11a6\" class=\"na nb fo be b gm pc nd ne gp pd ng nh ni pe nk nl nm pf no np nq pg ns nt nu oz pa pb bj\" data-selectable-paragraph=\"\">The latest versions of Scikit-learn, CometML, Pandas, NumPy, joblib, and XGboost libraries<\/li>\n<li id=\"694a\" class=\"na nb fo be b gm pc nd ne gp pd ng nh ni pe nk nl nm pf no np nq pg ns nt nu oz pa pb bj\" data-selectable-paragraph=\"\">A python 3.9+ install<\/li>\n<li id=\"476a\" class=\"na nb fo be b gm pc nd ne gp pd ng nh ni pe nk nl nm pf no np nq pg ns nt nu oz pa pb bj\" data-selectable-paragraph=\"\">A curious spirit<\/li>\n<\/ol>\n<p id=\"b659\" class=\"pw-post-body-paragraph na nb fo be b gm nc nd ne gp nf ng nh ni nj nk nl nm nn no np nq nr ns nt nu fh bj\" data-selectable-paragraph=\"\">To install the above libraries, you can run the following in your terminal:<\/p>\n<pre class=\"mi mj mk ml mm ph pi pj bo pk ba bj\"><span id=\"d5b0\" class=\"pl nw fo pi b bf pm pn l po pp\" data-selectable-paragraph=\"\">pip3 install comet-ml xgboost scikit-learn numpy pandas joblib<\/span><\/pre>\n<p id=\"8f0f\" class=\"pw-post-body-paragraph na nb fo be b gm nc nd ne gp nf ng nh ni nj nk nl nm nn no np nq nr ns nt nu fh bj\" data-selectable-paragraph=\"\">Once the above libraries are installed, then we can begin our model versioning on Comet ML\u2019s platform.<\/p>\n<h1 id=\"5e0b\" class=\"nv nw fo be nx ny nz go oa ob oc gr od oe of og oh oi oj ok ol om on oo op oq bj\" data-selectable-paragraph=\"\">Understanding Comet\u2019s Model Registry<\/h1>\n<p id=\"3d0d\" class=\"pw-post-body-paragraph na nb fo be b gm or nd ne gp os ng nh ni ot nk nl nm ou no np nq ov ns nt nu fh bj\" data-selectable-paragraph=\"\">Using Comet for the first time to perform an activity like this may seem daunting at first, but in all honesty, all it requires is a slight understanding of the platform and adding a few lines of code to your workflow in order to succeed.<\/p>\n<p id=\"30e6\" class=\"pw-post-body-paragraph na nb fo be b gm nc nd ne gp nf ng nh ni nj nk nl nm nn no np nq nr ns nt nu fh bj\" data-selectable-paragraph=\"\">There are a few things you have to keep in mind when you\u2019re trying to keep track of your models. There are three tabs on the Comet homepage; you should be keen on two. These two tabs are \u201cProjects\u201d and \u201cModel Registry.\u201d<\/p>\n<figure class=\"mi mj mk ml mm mn mf mg paragraph-image\">\n<div class=\"mo mp eb mq bg mr\" tabindex=\"0\" role=\"button\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg ms mt c\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:700\/1*dfwuOe2Vlm5I_oomFbLrrg.png\" alt=\"Screenshot of the Comet UI, with the using selecting the \u201cProjects\u201d tab\" width=\"700\" height=\"135\"><\/figure><div class=\"mf mg pq\"><picture><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/format:webp\/1*dfwuOe2Vlm5I_oomFbLrrg.png 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/format:webp\/1*dfwuOe2Vlm5I_oomFbLrrg.png 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/format:webp\/1*dfwuOe2Vlm5I_oomFbLrrg.png 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/format:webp\/1*dfwuOe2Vlm5I_oomFbLrrg.png 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/format:webp\/1*dfwuOe2Vlm5I_oomFbLrrg.png 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/format:webp\/1*dfwuOe2Vlm5I_oomFbLrrg.png 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/format:webp\/1*dfwuOe2Vlm5I_oomFbLrrg.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*dfwuOe2Vlm5I_oomFbLrrg.png 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/1*dfwuOe2Vlm5I_oomFbLrrg.png 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/1*dfwuOe2Vlm5I_oomFbLrrg.png 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/1*dfwuOe2Vlm5I_oomFbLrrg.png 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/1*dfwuOe2Vlm5I_oomFbLrrg.png 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/1*dfwuOe2Vlm5I_oomFbLrrg.png 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/1*dfwuOe2Vlm5I_oomFbLrrg.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=\"mu mv mw mf mg mx my be b bf z dv\" data-selectable-paragraph=\"\">Screenshot by author<\/figcaption>\n<\/figure>\n<p id=\"5989\" class=\"pw-post-body-paragraph na nb fo be b gm nc nd ne gp nf ng nh ni nj nk nl nm nn no np nq nr ns nt nu fh bj\" data-selectable-paragraph=\"\">The reason you should be keen on this is that you will first log your experiments under the \u201cProjects\u201d tab in a single project. After doing so, you will need the directory of that experiment within the project in order to register and upload a model to the \u201cModel Registry\u201d tab.<\/p>\n<p id=\"b836\" class=\"pw-post-body-paragraph na nb fo be b gm nc nd ne gp nf ng nh ni nj nk nl nm nn no np nq nr ns nt nu fh bj\" data-selectable-paragraph=\"\">All the above may seem convoluted but it will become much clearer once we see the full end-to-end project.<\/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=\"pz\"><p id=\"3aef\" class=\"qa qb fo be qc qd qe qf qg qh qi nu dv\" data-selectable-paragraph=\"\">Big teams rely on big ideas. <a class=\"af mz\" href=\"https:\/\/www.comet.com\/site\/blog\/announcing-comet-artifacts\/\" target=\"_blank\" rel=\"noopener ugc nofollow\">Learn how experts at Uber, WorkFusion, and The RealReal use Comet to scale out their ML models and ensure visibility and collaboration company-wide<\/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=\"94c5\" class=\"nv nw fo be nx ny qj go oa ob qk gr od oe ql og oh oi qm ok ol om qn oo op oq bj\" data-selectable-paragraph=\"\">Project<\/h1>\n<p id=\"5444\" class=\"pw-post-body-paragraph na nb fo be b gm or nd ne gp os ng nh ni ot nk nl nm ou no np nq ov ns nt nu fh bj\" data-selectable-paragraph=\"\">For this example, I had a simple project in mind that would demonstrate everything important. I decided it would be best to use the iris dataset because it is fairly simple and would easily allow us to see different iterations of code and track whether models are getting any better on some baseline data.<\/p>\n<p id=\"1298\" class=\"pw-post-body-paragraph na nb fo be b gm nc nd ne gp nf ng nh ni nj nk nl nm nn no np nq nr ns nt nu fh bj\" data-selectable-paragraph=\"\">The first step is to load the dataset from the Scikit-learn library. It comes in the form of a NumPy array, so I convert it to a Pandas DataFrame to make it more comfortable to use. The first cell will look like this:<\/p>\n<pre class=\"mi mj mk ml mm ph pi pj bo pk ba bj\"><span id=\"16b9\" class=\"pl nw fo pi b bf pm pn l po pp\" data-selectable-paragraph=\"\"><span class=\"hljs-keyword\">import<\/span> pandas <span class=\"hljs-keyword\">as<\/span> pd\n<span class=\"hljs-keyword\">from<\/span> sklearn <span class=\"hljs-keyword\">import<\/span> datasets\n<span class=\"hljs-keyword\">import<\/span> numpy <span class=\"hljs-keyword\">as<\/span> np\n\n<span class=\"hljs-comment\">#Taking it in as an np array<\/span>\ndf = datasets.load_iris()\n\n<span class=\"hljs-comment\">#converting it to a pandas dataframe<\/span>\ndf = pd.DataFrame(data=np.c_[df[<span class=\"hljs-string\">'data'<\/span>], df[<span class=\"hljs-string\">'target'<\/span>]],\n                  columns= df[<span class=\"hljs-string\">'feature_names'<\/span>] + [<span class=\"hljs-string\">'target'<\/span>])\n\ndf<\/span><\/pre>\n<p id=\"4a21\" class=\"pw-post-body-paragraph na nb fo be b gm nc nd ne gp nf ng nh ni nj nk nl nm nn no np nq nr ns nt nu fh bj\" data-selectable-paragraph=\"\">The result is a Pandas DataFrame that looks like this:<\/p>\n<figure class=\"mi mj mk ml mm mn mf mg paragraph-image\">\n<div class=\"mo mp eb mq bg mr\" tabindex=\"0\" role=\"button\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg ms mt c\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:700\/1*w7kCutyX3wI58N7XrVyWrQ.png\" alt=\"A sample set of rows from a pandas DataFrame of the iris dataset in dark mode.\" width=\"700\" height=\"301\"><\/figure><div class=\"mf mg qo\"><picture><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/format:webp\/1*w7kCutyX3wI58N7XrVyWrQ.png 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/format:webp\/1*w7kCutyX3wI58N7XrVyWrQ.png 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/format:webp\/1*w7kCutyX3wI58N7XrVyWrQ.png 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/format:webp\/1*w7kCutyX3wI58N7XrVyWrQ.png 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/format:webp\/1*w7kCutyX3wI58N7XrVyWrQ.png 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/format:webp\/1*w7kCutyX3wI58N7XrVyWrQ.png 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/format:webp\/1*w7kCutyX3wI58N7XrVyWrQ.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*w7kCutyX3wI58N7XrVyWrQ.png 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/1*w7kCutyX3wI58N7XrVyWrQ.png 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/1*w7kCutyX3wI58N7XrVyWrQ.png 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/1*w7kCutyX3wI58N7XrVyWrQ.png 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/1*w7kCutyX3wI58N7XrVyWrQ.png 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/1*w7kCutyX3wI58N7XrVyWrQ.png 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/1*w7kCutyX3wI58N7XrVyWrQ.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=\"mu mv mw mf mg mx my be b bf z dv\" data-selectable-paragraph=\"\">Screenshot by author<\/figcaption>\n<\/figure>\n<p id=\"9e6e\" class=\"pw-post-body-paragraph na nb fo be b gm nc nd ne gp nf ng nh ni nj nk nl nm nn no np nq nr ns nt nu fh bj\" data-selectable-paragraph=\"\">I will skip the preprocessing steps to purely focus on the model tracking and get straight to testing the performance of different algorithms.<\/p>\n<p id=\"aeef\" class=\"pw-post-body-paragraph na nb fo be b gm nc nd ne gp nf ng nh ni nj nk nl nm nn no np nq nr ns nt nu fh bj\" data-selectable-paragraph=\"\">The next step is to define the features and labels, i.e., <code class=\"cw qp qq qr pi b\">X<\/code> and <code class=\"cw qp qq qr pi b\">y<\/code>, for fitting and prediction purposes.<\/p>\n<pre class=\"mi mj mk ml mm ph pi pj bo pk ba bj\"><span id=\"33b7\" class=\"pl nw fo pi b bf pm pn l po pp\" data-selectable-paragraph=\"\"><span class=\"hljs-comment\">#defining X and y<\/span>\nX = df.drop([<span class=\"hljs-string\">'target'<\/span>], axis=<span class=\"hljs-number\">1<\/span>)\ny = df[<span class=\"hljs-string\">'target'<\/span>]<\/span><\/pre>\n<p id=\"3a37\" class=\"pw-post-body-paragraph na nb fo be b gm nc nd ne gp nf ng nh ni nj nk nl nm nn no np nq nr ns nt nu fh bj\" data-selectable-paragraph=\"\">Now, we can move to testing and fitting an algorithm, then exporting the model and registering it to the Model Registry.<\/p>\n<h1 id=\"e73f\" class=\"nv nw fo be nx ny nz go oa ob oc gr od oe of og oh oi oj ok ol om on oo op oq bj\" data-selectable-paragraph=\"\">Model Extraction and Registration<\/h1>\n<p id=\"215d\" class=\"pw-post-body-paragraph na nb fo be b gm or nd ne gp os ng nh ni ot nk nl nm ou no np nq ov ns nt nu fh bj\" data-selectable-paragraph=\"\">For the first version, I want to fit a <code class=\"cw qp qq qr pi b\">KNeighborsClassifier<\/code> to fit the data. Additionally, I will use <code class=\"cw qp qq qr pi b\">StratifiedKFold<\/code> cross-validation to perform multiple train-test splits.<\/p>\n<p id=\"1ecf\" class=\"pw-post-body-paragraph na nb fo be b gm nc nd ne gp nf ng nh ni nj nk nl nm nn no np nq nr ns nt nu fh bj\" data-selectable-paragraph=\"\">After fitting our model, we will extract it with the <code class=\"cw qp qq qr pi b\">Joblib<\/code> library and finally get it registered in the Model Registry.<\/p>\n<pre class=\"mi mj mk ml mm ph pi pj bo pk ba bj\"><span id=\"14f3\" class=\"pl nw fo pi b bf pm pn l po pp\" data-selectable-paragraph=\"\"><span class=\"hljs-keyword\">from<\/span> sklearn.model_selection <span class=\"hljs-keyword\">import<\/span> cross_val_score\n<span class=\"hljs-keyword\">from<\/span> sklearn.neighbors <span class=\"hljs-keyword\">import<\/span> KNeighborsClassifier\n<span class=\"hljs-keyword\">from<\/span> sklearn.model_selection <span class=\"hljs-keyword\">import<\/span> StratifiedKFold\n<span class=\"hljs-keyword\">from<\/span> numpy <span class=\"hljs-keyword\">import<\/span> mean\n<span class=\"hljs-keyword\">from<\/span> joblib <span class=\"hljs-keyword\">import<\/span> dump\n<span class=\"hljs-keyword\">from<\/span> comet_ml <span class=\"hljs-keyword\">import<\/span> Experiment\n<span class=\"hljs-keyword\">import<\/span> comet_ml\n\n<span class=\"hljs-comment\">#initializes a project named \"model_tracking\"<\/span>\ncomet_ml.login(project_name=<span class=\"hljs-string\">\"model_tracking\"<\/span>)\n\n<span class=\"hljs-comment\">#Algorithm of choice<\/span>\nmodel  = KNeighborsClassifier(n_neighbors=<span class=\"hljs-number\">3<\/span>)\n\n<span class=\"hljs-comment\">#Training using Stratified K-fold cross validation<\/span>\n<span class=\"hljs-keyword\">def<\/span> <span class=\"hljs-title.function\">cross_val_eval<\/span>(<span class=\"hljs-params\">model, X, y<\/span>):\n    cv = StratifiedKFold(n_splits=<span class=\"hljs-number\">5<\/span>, shuffle=<span class=\"hljs-literal\">True<\/span>, random_state=<span class=\"hljs-number\">5<\/span>)\n    cv_scores = cross_val_score(model, X, y, cv = cv, scoring=<span class=\"hljs-string\">'accuracy'<\/span>, n_jobs=-<span class=\"hljs-number\">1<\/span>, error_score=<span class=\"hljs-string\">'raise'<\/span>)\n    <span class=\"hljs-keyword\">return<\/span> cv_scores\n\ncv_scores = cross_val_eval(model, X, y)\n<span class=\"hljs-built_in\">print<\/span>(mean(cv_scores))\n\n<span class=\"hljs-comment\">#fitting and then extracting model<\/span>\nmodel.fit(X, y)\ndump(model, <span class=\"hljs-string\">'model.joblib'<\/span>)\n\n<span class=\"hljs-comment\">#Logs model experiment to the project<\/span>\nexperiment = Experiment()\nexperiment.log_model(<span class=\"hljs-string\">\"model1\"<\/span>, <span class=\"hljs-string\">\"model directory within the computer\"<\/span>)\n\nexperiment.end()<\/span><\/pre>\n<p id=\"06ef\" class=\"pw-post-body-paragraph na nb fo be b gm nc nd ne gp nf ng nh ni nj nk nl nm nn no np nq nr ns nt nu fh bj\" data-selectable-paragraph=\"\">The above model gives us an accuracy of 95.3%.<\/p>\n<p id=\"99c4\" class=\"pw-post-body-paragraph na nb fo be b gm nc nd ne gp nf ng nh ni nj nk nl nm nn no np nq nr ns nt nu fh bj\" data-selectable-paragraph=\"\">Note that the first line of code (<code class=\"cw qp qq qr pi b\">comet_ml.login(project_name = \u201cmodel_tracking\u201d)<\/code>) in our Jupyter Notebook will cause the following to appear on your Project page on our browser:<\/p>\n<figure class=\"mi mj mk ml mm mn mf mg paragraph-image\">\n<div class=\"mo mp eb mq bg mr\" tabindex=\"0\" role=\"button\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg ms mt c\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:700\/1*YR9H5g-fgeOIK3twxugv1w.png\" alt=\"A screenshot of a user\u2019s selection of projects in the Comet UI.\" width=\"700\" height=\"328\"><\/figure><div class=\"mf mg qs\"><picture><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/format:webp\/1*YR9H5g-fgeOIK3twxugv1w.png 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/format:webp\/1*YR9H5g-fgeOIK3twxugv1w.png 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/format:webp\/1*YR9H5g-fgeOIK3twxugv1w.png 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/format:webp\/1*YR9H5g-fgeOIK3twxugv1w.png 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/format:webp\/1*YR9H5g-fgeOIK3twxugv1w.png 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/format:webp\/1*YR9H5g-fgeOIK3twxugv1w.png 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/format:webp\/1*YR9H5g-fgeOIK3twxugv1w.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*YR9H5g-fgeOIK3twxugv1w.png 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/1*YR9H5g-fgeOIK3twxugv1w.png 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/1*YR9H5g-fgeOIK3twxugv1w.png 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/1*YR9H5g-fgeOIK3twxugv1w.png 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/1*YR9H5g-fgeOIK3twxugv1w.png 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/1*YR9H5g-fgeOIK3twxugv1w.png 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/1*YR9H5g-fgeOIK3twxugv1w.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=\"mu mv mw mf mg mx my be b bf z dv\" data-selectable-paragraph=\"\">Screenshot by author<\/figcaption>\n<\/figure>\n<p id=\"403e\" class=\"pw-post-body-paragraph na nb fo be b gm nc nd ne gp nf ng nh ni nj nk nl nm nn no np nq nr ns nt nu fh bj\" data-selectable-paragraph=\"\">Our project is on the right side in the image above. We can also see that it states there is one experiment in there. The next step is to take said experiment\u2019s directory after opening the project by clicking \u201cView Project\u201d.<\/p>\n<figure class=\"mi mj mk ml mm mn mf mg paragraph-image\">\n<div class=\"mo mp eb mq bg mr\" tabindex=\"0\" role=\"button\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg ms mt c\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:700\/1*gAAjDOhM6LvRDiuXpXXfQg.png\" alt=\"A screenshot of the \u201cExperiment\u201d tab, with a single experiment named, \u201cintact_silo_3082\u201d\" width=\"700\" height=\"328\"><\/figure><div class=\"mf mg qs\"><picture><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/format:webp\/1*gAAjDOhM6LvRDiuXpXXfQg.png 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/format:webp\/1*gAAjDOhM6LvRDiuXpXXfQg.png 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/format:webp\/1*gAAjDOhM6LvRDiuXpXXfQg.png 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/format:webp\/1*gAAjDOhM6LvRDiuXpXXfQg.png 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/format:webp\/1*gAAjDOhM6LvRDiuXpXXfQg.png 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/format:webp\/1*gAAjDOhM6LvRDiuXpXXfQg.png 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/format:webp\/1*gAAjDOhM6LvRDiuXpXXfQg.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*gAAjDOhM6LvRDiuXpXXfQg.png 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/1*gAAjDOhM6LvRDiuXpXXfQg.png 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/1*gAAjDOhM6LvRDiuXpXXfQg.png 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/1*gAAjDOhM6LvRDiuXpXXfQg.png 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/1*gAAjDOhM6LvRDiuXpXXfQg.png 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/1*gAAjDOhM6LvRDiuXpXXfQg.png 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/1*gAAjDOhM6LvRDiuXpXXfQg.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=\"mu mv mw mf mg mx my be b bf z dv\" data-selectable-paragraph=\"\">Screenshot by author<\/figcaption>\n<\/figure>\n<p id=\"c897\" class=\"pw-post-body-paragraph na nb fo be b gm nc nd ne gp nf ng nh ni nj nk nl nm nn no np nq nr ns nt nu fh bj\" data-selectable-paragraph=\"\">After clicking the project and cycling to the \u201cExperiments\u201d tab, we can then see the name that it has been assigned and we can click on it.<\/p>\n<figure class=\"mi mj mk ml mm mn mf mg paragraph-image\">\n<div class=\"mo mp eb mq bg mr\" tabindex=\"0\" role=\"button\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg ms mt c\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:700\/1*6mzBMD5haWZ4z1qM0lPXTg.png\" alt=\"\" width=\"700\" height=\"328\"><\/figure><div class=\"mf mg qs\"><picture><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/format:webp\/1*6mzBMD5haWZ4z1qM0lPXTg.png 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/format:webp\/1*6mzBMD5haWZ4z1qM0lPXTg.png 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/format:webp\/1*6mzBMD5haWZ4z1qM0lPXTg.png 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/format:webp\/1*6mzBMD5haWZ4z1qM0lPXTg.png 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/format:webp\/1*6mzBMD5haWZ4z1qM0lPXTg.png 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/format:webp\/1*6mzBMD5haWZ4z1qM0lPXTg.png 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/format:webp\/1*6mzBMD5haWZ4z1qM0lPXTg.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*6mzBMD5haWZ4z1qM0lPXTg.png 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/1*6mzBMD5haWZ4z1qM0lPXTg.png 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/1*6mzBMD5haWZ4z1qM0lPXTg.png 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/1*6mzBMD5haWZ4z1qM0lPXTg.png 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/1*6mzBMD5haWZ4z1qM0lPXTg.png 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/1*6mzBMD5haWZ4z1qM0lPXTg.png 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/1*6mzBMD5haWZ4z1qM0lPXTg.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=\"mu mv mw mf mg mx my be b bf z dv\" data-selectable-paragraph=\"\">Screenshot by author<\/figcaption>\n<\/figure>\n<p id=\"d4d1\" class=\"pw-post-body-paragraph na nb fo be b gm nc nd ne gp nf ng nh ni nj nk nl nm nn no np nq nr ns nt nu fh bj\" data-selectable-paragraph=\"\">After selecting our experiment, <code class=\"cw qp qq qr pi b\">intact_silo_3082<\/code>, we can now copy the path to this experiment (see the top section that is immediately below Comet\u2019s logo in the image above).<\/p>\n<p id=\"1675\" class=\"pw-post-body-paragraph na nb fo be b gm nc nd ne gp nf ng nh ni nj nk nl nm nn no np nq nr ns nt nu fh bj\" data-selectable-paragraph=\"\">It reads <code class=\"cw qp qq qr pi b\">mwanikinjagi\/model_tracking\/intact_silo_3082<\/code> on my page and this is what I will use to register a model into the model registry. To do this, I will use the code below:<\/p>\n<pre class=\"mi mj mk ml mm ph pi pj bo pk ba bj\"><span id=\"d2c9\" class=\"pl nw fo pi b bf pm pn l po pp\" data-selectable-paragraph=\"\"><span class=\"hljs-keyword\">from<\/span> comet_ml <span class=\"hljs-keyword\">import<\/span> API\n\napi= API()\n<span class=\"hljs-comment\">#We feed the experiment in the get() method of the api <\/span>\nexperiment = api.get(<span class=\"hljs-string\">\"mwanikinjagi\/model-tracking\/intact_silo_3082\"<\/span>)\n<span class=\"hljs-comment\">#finally registers with given name you have chosen<\/span>\nexperiment.register_model(<span class=\"hljs-string\">\"model1\"<\/span>)<\/span><\/pre>\n<figure class=\"mi mj mk ml mm mn mf mg paragraph-image\">\n<div class=\"mo mp eb mq bg mr\" tabindex=\"0\" role=\"button\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg ms mt c\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:700\/1*YJyUPz1PZ3fgiFnzXRVYLA.png\" alt=\"\" width=\"700\" height=\"22\"><\/figure><div class=\"mf mg qt\"><picture><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/format:webp\/1*YJyUPz1PZ3fgiFnzXRVYLA.png 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/format:webp\/1*YJyUPz1PZ3fgiFnzXRVYLA.png 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/format:webp\/1*YJyUPz1PZ3fgiFnzXRVYLA.png 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/format:webp\/1*YJyUPz1PZ3fgiFnzXRVYLA.png 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/format:webp\/1*YJyUPz1PZ3fgiFnzXRVYLA.png 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/format:webp\/1*YJyUPz1PZ3fgiFnzXRVYLA.png 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/format:webp\/1*YJyUPz1PZ3fgiFnzXRVYLA.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*YJyUPz1PZ3fgiFnzXRVYLA.png 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/1*YJyUPz1PZ3fgiFnzXRVYLA.png 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/1*YJyUPz1PZ3fgiFnzXRVYLA.png 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/1*YJyUPz1PZ3fgiFnzXRVYLA.png 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/1*YJyUPz1PZ3fgiFnzXRVYLA.png 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/1*YJyUPz1PZ3fgiFnzXRVYLA.png 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/1*YJyUPz1PZ3fgiFnzXRVYLA.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=\"mu mv mw mf mg mx my be b bf z dv\" data-selectable-paragraph=\"\">Screenshot by author<\/figcaption>\n<\/figure>\n<p id=\"98f6\" class=\"pw-post-body-paragraph na nb fo be b gm nc nd ne gp nf ng nh ni nj nk nl nm nn no np nq nr ns nt nu fh bj\" data-selectable-paragraph=\"\">Now, we have our <code class=\"cw qp qq qr pi b\">model1<\/code> (it could use a more intuitive name) and we have been provided with a default version number 1.0.0. You have now successfully registered the first version of your model and can find it in the Model Registry.<\/p>\n<figure class=\"mi mj mk ml mm mn mf mg paragraph-image\">\n<div class=\"mo mp eb mq bg mr\" tabindex=\"0\" role=\"button\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg ms mt c\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:700\/1*NT48GIy7yq-nBYu2szEBMg.png\" alt=\"\" width=\"700\" height=\"350\"><\/figure><div class=\"mf mg qu\"><picture><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/format:webp\/1*NT48GIy7yq-nBYu2szEBMg.png 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/format:webp\/1*NT48GIy7yq-nBYu2szEBMg.png 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/format:webp\/1*NT48GIy7yq-nBYu2szEBMg.png 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/format:webp\/1*NT48GIy7yq-nBYu2szEBMg.png 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/format:webp\/1*NT48GIy7yq-nBYu2szEBMg.png 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/format:webp\/1*NT48GIy7yq-nBYu2szEBMg.png 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/format:webp\/1*NT48GIy7yq-nBYu2szEBMg.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*NT48GIy7yq-nBYu2szEBMg.png 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/1*NT48GIy7yq-nBYu2szEBMg.png 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/1*NT48GIy7yq-nBYu2szEBMg.png 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/1*NT48GIy7yq-nBYu2szEBMg.png 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/1*NT48GIy7yq-nBYu2szEBMg.png 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/1*NT48GIy7yq-nBYu2szEBMg.png 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/1*NT48GIy7yq-nBYu2szEBMg.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=\"mu mv mw mf mg mx my be b bf z dv\" data-selectable-paragraph=\"\">Screenshot by author<\/figcaption>\n<\/figure>\n<p id=\"4da0\" class=\"pw-post-body-paragraph na nb fo be b gm nc nd ne gp nf ng nh ni nj nk nl nm nn no np nq nr ns nt nu fh bj\" data-selectable-paragraph=\"\">When we select \u201cView model,\u201d it takes us to a page that allows us to do more with the model. For instance, if working with teams then one could download the different versions of the model from that central point.<\/p>\n<figure class=\"mi mj mk ml mm mn mf mg paragraph-image\">\n<div class=\"mo mp eb mq bg mr\" tabindex=\"0\" role=\"button\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg ms mt c\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:700\/1*tdlqve2MkLeSOzUyxnaRZQ.png\" alt=\"\" width=\"700\" height=\"350\"><\/figure><div class=\"mf mg qu\"><picture><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/format:webp\/1*tdlqve2MkLeSOzUyxnaRZQ.png 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/format:webp\/1*tdlqve2MkLeSOzUyxnaRZQ.png 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/format:webp\/1*tdlqve2MkLeSOzUyxnaRZQ.png 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/format:webp\/1*tdlqve2MkLeSOzUyxnaRZQ.png 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/format:webp\/1*tdlqve2MkLeSOzUyxnaRZQ.png 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/format:webp\/1*tdlqve2MkLeSOzUyxnaRZQ.png 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/format:webp\/1*tdlqve2MkLeSOzUyxnaRZQ.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*tdlqve2MkLeSOzUyxnaRZQ.png 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/1*tdlqve2MkLeSOzUyxnaRZQ.png 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/1*tdlqve2MkLeSOzUyxnaRZQ.png 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/1*tdlqve2MkLeSOzUyxnaRZQ.png 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/1*tdlqve2MkLeSOzUyxnaRZQ.png 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/1*tdlqve2MkLeSOzUyxnaRZQ.png 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/1*tdlqve2MkLeSOzUyxnaRZQ.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=\"mu mv mw mf mg mx my be b bf z dv\" data-selectable-paragraph=\"\">Screenshot by author<\/figcaption>\n<\/figure>\n<h1 id=\"5253\" class=\"nv nw fo be nx ny nz go oa ob oc gr od oe of og oh oi oj ok ol om on oo op oq bj\" data-selectable-paragraph=\"\">Wrap up<\/h1>\n<p id=\"0e73\" class=\"pw-post-body-paragraph na nb fo be b gm or nd ne gp os ng nh ni ot nk nl nm ou no np nq ov ns nt nu fh bj\" data-selectable-paragraph=\"\">In this first part, we have been able to set up our model in the Model Registry. It may have seemed difficult initially but it\u2019s actually very straightforward.<\/p>\n<p id=\"c830\" class=\"pw-post-body-paragraph na nb fo be b gm nc nd ne gp nf ng nh ni nj nk nl nm nn no np nq nr ns nt nu fh bj\" data-selectable-paragraph=\"\">In the next part, I will take you through dealing with different versions of models with a simple example project like the one we have taken up there.<\/p>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Photo by Isaac Smith on Unsplash The world of machine learning and data science is awash with technicalities. With each passing day, it becomes ever more evident that a practitioner in this field needs to keep track of a lot of things lest they fall into the deluge of complexity. Fortunately, there are many workarounds [&hellip;]<\/p>\n","protected":false},"author":79,"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,7],"tags":[],"coauthors":[176],"class_list":["post-7408","post","type-post","status-publish","format-standard","hentry","category-machine-learning","category-tutorials"],"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>An End-to-End Guide on Using Comet ML\u2019s Model Versioning Feature: Part 1 - 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\/an-end-to-end-guide-on-using-comet-mls-model-versioning-feature-part-1\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"An End-to-End Guide on Using Comet ML\u2019s Model Versioning Feature: Part 1\" \/>\n<meta property=\"og:description\" content=\"Photo by Isaac Smith on Unsplash The world of machine learning and data science is awash with technicalities. With each passing day, it becomes ever more evident that a practitioner in this field needs to keep track of a lot of things lest they fall into the deluge of complexity. Fortunately, there are many workarounds [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.comet.com\/site\/blog\/an-end-to-end-guide-on-using-comet-mls-model-versioning-feature-part-1\/\" \/>\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-11T17:00:59+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-04-24T17:14:19+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/miro.medium.com\/v2\/resize:fit:700\/0*5pt2phAH3GkZIlmU\" \/>\n<meta name=\"author\" content=\"Mwanikii Njagi\" \/>\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=\"Mwanikii Njagi\" \/>\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":"An End-to-End Guide on Using Comet ML\u2019s Model Versioning Feature: Part 1 - 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\/an-end-to-end-guide-on-using-comet-mls-model-versioning-feature-part-1\/","og_locale":"en_US","og_type":"article","og_title":"An End-to-End Guide on Using Comet ML\u2019s Model Versioning Feature: Part 1","og_description":"Photo by Isaac Smith on Unsplash The world of machine learning and data science is awash with technicalities. With each passing day, it becomes ever more evident that a practitioner in this field needs to keep track of a lot of things lest they fall into the deluge of complexity. Fortunately, there are many workarounds [&hellip;]","og_url":"https:\/\/www.comet.com\/site\/blog\/an-end-to-end-guide-on-using-comet-mls-model-versioning-feature-part-1\/","og_site_name":"Comet","article_publisher":"https:\/\/www.facebook.com\/cometdotml","article_published_time":"2023-09-11T17:00:59+00:00","article_modified_time":"2025-04-24T17:14:19+00:00","og_image":[{"url":"https:\/\/miro.medium.com\/v2\/resize:fit:700\/0*5pt2phAH3GkZIlmU","type":"","width":"","height":""}],"author":"Mwanikii Njagi","twitter_card":"summary_large_image","twitter_creator":"@Cometml","twitter_site":"@Cometml","twitter_misc":{"Written by":"Mwanikii Njagi","Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.comet.com\/site\/blog\/an-end-to-end-guide-on-using-comet-mls-model-versioning-feature-part-1\/#article","isPartOf":{"@id":"https:\/\/www.comet.com\/site\/blog\/an-end-to-end-guide-on-using-comet-mls-model-versioning-feature-part-1\/"},"author":{"name":"Mwanikii Njagi","@id":"https:\/\/www.comet.com\/site\/#\/schema\/person\/c7043b3e6b992af7b3220aa1f27d2162"},"headline":"An End-to-End Guide on Using Comet ML\u2019s Model Versioning Feature: Part 1","datePublished":"2023-09-11T17:00:59+00:00","dateModified":"2025-04-24T17:14:19+00:00","mainEntityOfPage":{"@id":"https:\/\/www.comet.com\/site\/blog\/an-end-to-end-guide-on-using-comet-mls-model-versioning-feature-part-1\/"},"wordCount":1093,"publisher":{"@id":"https:\/\/www.comet.com\/site\/#organization"},"image":{"@id":"https:\/\/www.comet.com\/site\/blog\/an-end-to-end-guide-on-using-comet-mls-model-versioning-feature-part-1\/#primaryimage"},"thumbnailUrl":"https:\/\/miro.medium.com\/v2\/resize:fit:700\/0*5pt2phAH3GkZIlmU","articleSection":["Machine Learning","Tutorials"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.comet.com\/site\/blog\/an-end-to-end-guide-on-using-comet-mls-model-versioning-feature-part-1\/","url":"https:\/\/www.comet.com\/site\/blog\/an-end-to-end-guide-on-using-comet-mls-model-versioning-feature-part-1\/","name":"An End-to-End Guide on Using Comet ML\u2019s Model Versioning Feature: Part 1 - Comet","isPartOf":{"@id":"https:\/\/www.comet.com\/site\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.comet.com\/site\/blog\/an-end-to-end-guide-on-using-comet-mls-model-versioning-feature-part-1\/#primaryimage"},"image":{"@id":"https:\/\/www.comet.com\/site\/blog\/an-end-to-end-guide-on-using-comet-mls-model-versioning-feature-part-1\/#primaryimage"},"thumbnailUrl":"https:\/\/miro.medium.com\/v2\/resize:fit:700\/0*5pt2phAH3GkZIlmU","datePublished":"2023-09-11T17:00:59+00:00","dateModified":"2025-04-24T17:14:19+00:00","breadcrumb":{"@id":"https:\/\/www.comet.com\/site\/blog\/an-end-to-end-guide-on-using-comet-mls-model-versioning-feature-part-1\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.comet.com\/site\/blog\/an-end-to-end-guide-on-using-comet-mls-model-versioning-feature-part-1\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.comet.com\/site\/blog\/an-end-to-end-guide-on-using-comet-mls-model-versioning-feature-part-1\/#primaryimage","url":"https:\/\/miro.medium.com\/v2\/resize:fit:700\/0*5pt2phAH3GkZIlmU","contentUrl":"https:\/\/miro.medium.com\/v2\/resize:fit:700\/0*5pt2phAH3GkZIlmU"},{"@type":"BreadcrumbList","@id":"https:\/\/www.comet.com\/site\/blog\/an-end-to-end-guide-on-using-comet-mls-model-versioning-feature-part-1\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.comet.com\/site\/"},{"@type":"ListItem","position":2,"name":"An End-to-End Guide on Using Comet ML\u2019s Model Versioning Feature: Part 1"}]},{"@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\/c7043b3e6b992af7b3220aa1f27d2162","name":"Mwanikii Njagi","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.comet.com\/site\/#\/schema\/person\/image\/1a3c516cf04aca9418dfb2213081f4df","url":"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/08\/cropped-1_2jy9gyk0G_yaniWm8gJFVA-1-96x96.webp","contentUrl":"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/08\/cropped-1_2jy9gyk0G_yaniWm8gJFVA-1-96x96.webp","caption":"Mwanikii Njagi"},"url":"https:\/\/www.comet.com\/site\/blog\/author\/freddynjagigmail-com\/"}]}},"_links":{"self":[{"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/posts\/7408","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\/79"}],"replies":[{"embeddable":true,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/comments?post=7408"}],"version-history":[{"count":1,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/posts\/7408\/revisions"}],"predecessor-version":[{"id":15555,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/posts\/7408\/revisions\/15555"}],"wp:attachment":[{"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/media?parent=7408"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/categories?post=7408"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/tags?post=7408"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/coauthors?post=7408"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}