<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Shayan Nejadshamsi on Medium]]></title>
        <description><![CDATA[Stories by Shayan Nejadshamsi on Medium]]></description>
        <link>https://medium.com/@shayan.nejadshamsi?source=rss-a0ba564f6759------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*jS3UagC910Kp6B11.jpg</url>
            <title>Stories by Shayan Nejadshamsi on Medium</title>
            <link>https://medium.com/@shayan.nejadshamsi?source=rss-a0ba564f6759------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 00:27:31 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@shayan.nejadshamsi/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How to install and set up MLflow (MLOps — Experiment tracking tool)]]></title>
            <link>https://medium.com/@shayan.nejadshamsi/how-to-install-and-set-up-mlflow-mlops-experiment-tracking-tool-d490f9427c58?source=rss-a0ba564f6759------2</link>
            <guid isPermaLink="false">https://medium.com/p/d490f9427c58</guid>
            <dc:creator><![CDATA[Shayan Nejadshamsi]]></dc:creator>
            <pubDate>Tue, 06 Jun 2023 05:52:35 GMT</pubDate>
            <atom:updated>2023-06-21T03:14:38.360Z</atom:updated>
            <content:encoded><![CDATA[<h3>(MLOps) — How to install and set up mlflow step by step (On-premise)</h3><p>“mlflow” is a tool for tracking of the machine learning runs and management of the developed models. If you want to know more information on this please refer to this <a href="https://medium.com/@sh.nejadshamsi/what-are-machine-learning-experiment-tracking-and-model-management-tools-807b5a0baccf">article</a>.</p><p>In this article we are going to install mlflow on Windows. We can install mlflow library through PyPI (pip install) on the local system. However, installing different packages on the system might mess up the configuration of our local system. In order to avoid this issue, we prefer to use “conda” environment.</p><p>At the first step we need to create a conda environment and install required libraries for running our ML code (like mlflow, jupyter, scikit-learn, pandas, seaborn, xgboost or any other required libraries). Suppose that we want to create a conda environment with a name “mlflow-env”. For this purpose, we open Gitbash terminal (Run as administration) and type the below command at the root address (for macOS, use the terminal). (answer yes (“y”) if asked:</p><pre>conda create -n mlflow-env python=3.9</pre><p>Now you should be able to see the windows below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vm8ABYnqQWJhkOe6uJS3kQ.png" /></figure><p>Now after that we created a conda environment, we need to activate it. now we type the command below in Gitbash:</p><pre>conda activate mlfow-env</pre><p>Now you should see the Gitbash windows as below, which shows we are in the “mlflow-env” environment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/937/1*hR8UpIwYhNOfdo-AsISk1g.png" /></figure><p>At this step, we need to install the required packages in the environment using “pip install” command. mlflow and jupyter libraries are necessary among the other required packaged for our machine learning code which we want to monitor (usually pandas, matplotlib, scikit-learn, etc.). Without closing the Gitbash (in the mlflow-env environment) we type:</p><pre>pip install mlflow</pre><p>After completed:</p><pre>pip install jupyter</pre><p>and the same would be for installation of rest of packages. For checking the list of installed libraries you can use the command below:</p><pre>pip list</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IaRPHeipRDVgZqG0xh_jIQ.png" /></figure><p>Now to get access to MLflow command line Interface (CLI), we run:</p><pre>python -m mlflow</pre><p>and we will see the below windows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tozTLPKn0vbvSneEQLWkqA.png" /></figure><p>Now that we successfully installed mlflow, we open our jupyter notebook code (The .ipynb file that we wrote our machine learning algorithm) in VSCode and set the python kernel as “mlflow-env” which we have created previously. At the beginning of the file we import mlflow and set two parameters as you can see below:</p><pre>import pandas as pd<br>import pickle<br>import seaborn as sns<br>import matplotlib.pyplot as plt<br>from sklearn.feature_extraction import DictVectorizer<br>from sklearn.linear_model import LinearRegression<br>from sklearn.linear_model import Lasso<br>from sklearn.linear_model import Ridge<br>from sklearn.metrics import mean_squared_error<br><br><br>import mlflow<br>mlflow.set_tracking_uri(&quot;sqlite:///mlflow.db&quot;)<br>mlflow.set_experiment(&quot;spyder-experiment&quot;)</pre><p>The first parameter that we set is “mlflow.set_tracking_uri” which set the database type and address where the mlflow database file to be stored. “sqlite:///mlflow.db” means that we use sqlite database as a backend and the mlflow.db file will be created at the same directory of our current &quot;.ipynb” file. Here we suppose that our .ipynb file is stored at the “D:/mlops_project” as an example. (or you can set any address)</p><p>The second parameter that we set is “mlflow.set_experiment” which set the name of our experiment. For example we set the name as “spyder-experiment”.</p><p>In this step we need to run the first cell showed above in our notebook. We see that the “mlflow.db” file is created at the same place where our .ipynb file located (in our example: D:/mlops_project). Now we return back to our Gitbash window and type the command below:</p><pre>python -m mlflow ui - backend-store-uri sqlite:///D:/mlops_project/mlflow.db</pre><p>Now you should see the windows below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sgqd9oSfF42-q8otmokxkQ.png" /></figure><p>copy and paste the address shown in the windows (<a href="http://127.0.0.1:5000/">http://127.0.0.1:5000</a>) in your internet browser. You will see the mlflow user interface dashboard like below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ijBl6EWdnhQ4LCKD91p-ag.png" /></figure><p>The created “spyder-experiment” can be seen among the list of experiments on the left part and we successfully configured the mlflow to our code.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d490f9427c58" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[(MLOps) — What are machine learning experiment tracking and model management tools?]]></title>
            <link>https://medium.com/@shayan.nejadshamsi/what-are-machine-learning-experiment-tracking-and-model-management-tools-807b5a0baccf?source=rss-a0ba564f6759------2</link>
            <guid isPermaLink="false">https://medium.com/p/807b5a0baccf</guid>
            <dc:creator><![CDATA[Shayan Nejadshamsi]]></dc:creator>
            <pubDate>Tue, 06 Jun 2023 05:52:13 GMT</pubDate>
            <atom:updated>2023-06-21T03:13:48.070Z</atom:updated>
            <content:encoded><![CDATA[<p>Have you ever experienced running your machine learning model with several values of hyper parameter to check which configuration gives the best performance? How do you record and keep track of this? Maybe manually and creating a sheet as below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/584/1*LcnBMlMALqU7JZUopiac9w.png" /></figure><p>or have you ever trained several models and stored them in separate files with weird names such as below :D</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/751/1*41pPo9yIaK_lr03KAP57QA.png" /></figure><p>The above manual methods might be useful when we work on very small projects, but when we go on the big scale project the number and types of the parameters (such as environment, data, model, hyper-parameters, metrics, etc) to track are increasing exponentially. Furthermore, they are error-prone and no standard format exists.</p><p>As a result, different tools have been developed to do this procedure automatically. The mlflow, Weights &amp; Biases, Comet and Neptune platforms are examples of these kinds of tools. These tools play an important role in “reproducibility”, “organization” and “optimization”. In <a href="https://medium.com/@sh.nejadshamsi/how-to-install-and-set-up-mlflow-mlops-experiment-tracking-tool-d490f9427c58">this</a> article, the step by step installation and configuration guide of mlflow is represented.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=807b5a0baccf" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to set up and use Ubuntu environment of Amazon Elastic Compute Cloud (EC2)]]></title>
            <link>https://medium.com/@shayan.nejadshamsi/how-to-set-up-and-use-ubuntu-environment-of-amazon-elastic-compute-cloud-ec2-8734e1d76115?source=rss-a0ba564f6759------2</link>
            <guid isPermaLink="false">https://medium.com/p/8734e1d76115</guid>
            <dc:creator><![CDATA[Shayan Nejadshamsi]]></dc:creator>
            <pubDate>Thu, 25 May 2023 21:24:11 GMT</pubDate>
            <atom:updated>2023-05-25T21:36:17.052Z</atom:updated>
            <content:encoded><![CDATA[<p>Sometimes, our local computer does not have enough configuration for performing our computational tasks, or sometimes it is challenging to set up a virtual machine on the local computer. For example, installing Linux on intel-based macOS systems is challenging. In these cases, we can use third-party cloud computers that service such as Amazon Web Service (AWS), Microsoft Azure, Google Cloud Platform (GCP), etc provide them.</p><p>This article aims to set up a Linux-based virtual computer on the AWS cloud. <strong>Amazon Elastic Compute Cloud (EC2)</strong> is the AWS service allowing users to rent virtual computers to run their applications.</p><p><strong>What should we install and set up on our local computer (Windows)?</strong></p><p><strong>Gitbash</strong>: Go to this <a href="https://git-scm.com/download/win">link</a>, choose the appropriate (32-bit or 64-bit) installation package, and start installing it. The Gitbash will be installed among the package</p><p><strong>What should be the configuration on the AWS side?</strong></p><ol><li>The first step is to create an AWS account, go to “Services,” and choose EC2.</li><li>Create instance (or external cloud-based computer): For this purpose, we need to click on “Launch Instances” and configure the specifications as below:</li></ol><p>2.1. Assign your desired name for your external cloud-based computer.</p><p>2.2. In the “Application and OS Images (Amazon Machine Image)” section:</p><ul><li>Choose the desired Operating System (OS) for this computer (here, we choose Ubuntu)</li><li>We must choose the desired configurations in the “Amazon Machine Image (AMI)” sub-section. There are some “Free tier eligible” computers available that are free of charge. Other powerful options are available for you to choose based on your requirement (for example, for deep learning tasks which require high GPU). These computers charge you based on your usage. In order to prevent unwanted charges, make sure to shut down the instance after you have finished. Here we chose the “Free tier eligible” option.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zT6PxPUFro8rQoQBrOKurw.png" /></figure><ul><li>In the architecture, you can choose “Arm” or “x86” based on your requirement. We chose the “x86” option.</li></ul><p>2.3. In the “Instance type” sub-section, you can find different configurations for CPU, RAM, etc., along with their hourly prices. There are some “Free tier eligible” options available there, which are not very powerful.</p><p>2.4. In the “Key pair (login)” sub-section, you should create a key pair by clicking on Create new key pair. Choose your desired name (for example, “spyder”) for the key pair name and then select “RSA” for the key pair type and then select “.pem” for the Private key file format and then press Create Key pair. A “spyder.pem” file will be downloaded immediately and we should move this file to the “.ssh” folder which is in the below address:</p><p>C:\Users\”your_computer_username”\.ssh</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*muGDzteIhi5w5hRD8OPJmQ.png" /></figure><p>2.5. Keep the “Network setting” subsection untouched.</p><p>2.6. In the “Configure Storage” subsection, we can increase the storage to the maximum value (30 GiB) for Free tier eligible customers.</p><p>2.7. Keep the “Advanced details” subsection untouched and finally click on “Launch instance”</p><p>3. After creating your instance, go to the instances and from the list, click on the instance ID.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ovjrHj4A94cV1x6zVaFsYA.png" /></figure><p>From the new page (Instance summary) we only need to copy the “Public IPv4 address” information.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MU0b3N48suTJDW7_kHaF9Q.png" /></figure><p><strong>How to connect our local computer to the (EC2) cloud computer</strong></p><p>We successfully configured the set up for our local computer and cloud computer and now we are going to connect these two.</p><p>After copying the “Public IPv4 address” (in our example it is: 18.118.217.46) from the created instance, we open Gitbash in our local computer and type below command:</p><pre>ssh -i ~/.ssh/test.pem ubuntu@&quot;Public IPv4 address of your EC2 instance&quot;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZwMiI0uKRTe868UrSOz9hA.png" /></figure><p>After execution of the above code, it asks if you are sure to continue connecting; answer “yes” to continue. Then you should see the below screen.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yb0zCVrenmF7EIjNkvUVzQ.png" /></figure><p>Now type:</p><pre>logout</pre><p>and then again run the same command:</p><pre>ssh -i ~/.ssh/test.pem ubuntu@&quot;Public IPv4 address of your EC2 instance&quot;</pre><p>Now you are successfully connected to the EC2 cloud computer instance.</p><p>Note: remember that each time you reboot your EC2 instance in your AWS dashboard, the “Public IPv4 address” will be changed.</p><p>Now you have another computer which is located on the cloud. You might need to install some software on it. How? Please check out our next article.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8734e1d76115" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>