This lab is developed parallel to the CO 544 Machine Learning and Data Mining course at the Department of Computer Engineering, University of Peradeniya, Sri Lanka. The purpose of this lab is to provide hands-on experience in building interactive dashboards using Python to provide a visual representation of complex data in an intuitive and interactive way.
The lab consists of the following key components:
- Dataset: The dataset used in this lab is the Wine Quality Red Dataset, which contains physicochemical and sensory properties of red wine samples, along with their quality rating. The dataset contains 1,599 instances with 11 input features and one output variable (quality), ranging from 0 to 10.
- Data Preprocessing: The dataset is preprocessed by removing duplicates, dealing with missing values, and converting the quality rating to a binary classification problem of "good" and "bad" wines based on a threshold value. The preprocessed dataset is then split into training and testing sets.
- Machine Learning Model: A logistic regression model is trained on the preprocessed dataset to predict the quality of wine based on the given feature values.
- Performance Evaluation: The model is evaluated on the testing set using various performance metrics such as accuracy, precision, recall, F1-score, ROC curve, and AUC.
- Dashboard: A dashboard is created using the Python Dash library to visualize the correlation matrix and predict the wine quality with the given feature values.
To run the dashboard locally, follow the steps below:
- Clone this repository to your local machine.
- Install the required dependencies using the
requirements.txt
file.
pip install -r requirements.txt
- Open the terminal and navigate to the project directory.
- Run the Jupyter notebook
main.ipynb
. - Follow the instructions in the notebook to start the server.
- Once the server is running, open your web browser and navigate to the address displayed in the notebook to access the dashboard.
Note: The experiment is done using Jupyter notebook. The main.ipynb
file is the file that needs to be run using Jupyter Notebook.
To deploy the dashboard on a cloud platform such as Render, follow the instructions provided in the Deploying a Dash Application on Render repository.
Figure 1. Screenshot of the dashboard developed using Python Dash, displaying the correlation of two selected features and providing predictions for wine quality based on user input.