# Setup MLflow in Neevcloud Instance

## Setup MLflow in NeevCloud

### What is MLflow?

MLflow is an open-source platform designed to manage the machine learning lifecycle. It includes features to:

* Track experiments and runs
* Package and share models
* Deploy models to various environments
* Monitor model performance

Now set the MLflow in Neevcloud

## **Setup Environment**

1. Ubuntu 22.04
2. Python3
3. Mlflow

Create a ubuntu-22 [instance](https://docs.neevcloud.com/neevcloud-products/computes/getting-started-launch-vms).

### **Update && Upgrade all the packages**

```
sudo apt-get update -y
sudo apt-get upgrade -y
```

### **Install python and set the environment**

```
sudo apt-get install -y python3-pip 
```

The pip is the package installer for Python, which allows you to easily install and manage libraries and packages for your Python projects

```
sudo apt-get install -y python3-venv
```

The venv module in Python creates isolated environments for projects, preventing dependency conflicts, ensuring reproducibility, and allowing safe experimentation without affecting the system-wide Python installation.

### **Set up a packagesVirtual environment**

```
sudo python3 -m venv myenv
```

```
source myenv/bin/activate
```

<figure><img src="https://1876135298-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEC5NwtFshv6EATOemuUn%2Fuploads%2FoXYAhKn15e0cp0AlKsQw%2Fimage.png?alt=media&#x26;token=983246cf-2a12-4bd9-9bee-a0719f9609b8" alt=""><figcaption></figcaption></figure>

### **Install necessary packages**

**Upgrade and install packages within the environment.**

```
pip install --upgrade pip
```

<figure><img src="https://1876135298-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEC5NwtFshv6EATOemuUn%2Fuploads%2FYbmRHRZ9nkvHUr1MxOcq%2Fimage.png?alt=media&#x26;token=7080ea66-f794-46bd-8042-1717574ab103" alt=""><figcaption></figcaption></figure>

```
pip install --upgrade setuptools
pip install mlflow scikit-learn
```

MLFLOW\_TRACKING\_URI=<http://0.0.0.0:5000> sets the MLflow Tracking Server URL, enabling centralized logging and tracking of machine learning experiments for collaboration and consistency.

```
export MLFLOW_TRACKING_URI=http://0.0.0.0:5000
```

The command runs the MLflow server in the background, ensuring it continues running after logout, logs output to mlflow\.log, and sets up the tracking server with SQLite backend

```
nohup mlflow server --backend-store-uri sqlite:///mlflow.db --default-artifact-root ./mlruns --host 0.0.0.0 --port 5000 &> mlflow.log &

```

After running the command open your browser and log in with the IP (Your server IP) and **Port(5000)**

<http://your\\_server\\_ip:5000&#x20>;

<figure><img src="https://1876135298-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEC5NwtFshv6EATOemuUn%2Fuploads%2FXrw2TVubXFCd10HIL8Bo%2Fimage.png?alt=media&#x26;token=a51fe3fc-f971-49f5-a35d-6d8cab02bba7" alt=""><figcaption></figcaption></figure>
