
- 12th Jul 2024
- 17:36 pm
In this assignment, you will have three main tasks, including data preprocessing, model development, and model interpretation.
3.1 Data Preprocessing - Data preprocessing is vital for machine learning. You can consider using the following data preprocessing techniques:
- Feature Selection: some features may has little or no correlation with the target, and they can be probably removed. More in general, a “sparse” model can be trained with the most important features
- Feature Engineering: you do not have to restrict yourself in the set of features provided. You can create new features on your own! E.g., the ratio
3.2 Model Development - In this task, you will be doing model selection, i.e., finding a machine learning model that is best suited for the given regression problem, in terms of the prediction performance. You will examine at least three different machine learning models and compare their performance on the provided BLEVE data using at least two different regression metrics. You will adopt the model with the highest accuracy or lowest error.
3.3 Model Interpretation - We have trained a machine learning model and now we want to interpret our model to understand its behaviour. In particular, we are interested to know the following global interpretation:
- Feature effect plot: a summary plot showing the contribution of features to the prediction
- Partial dependency between target and features: if you’re using dependency plot, you do not have to show plot for all features but up to five “significant” plots those that has the largest effect or abnormal ones that contain much information)
Explainable Approaches to Machine Learning - COMP6013 - Get Assignment Solution
Please note that this is a sample assignment solved by our Python Programmers. These solutions are intended to be used for research and reference purposes only. If you can learn any concepts by going through the reports and code, then our Python Tutors would be very happy.
- Option 1 - To download the complete solution along with Code, Report and screenshots - Please visit our Python Assignment Sample Solution page
- Option 2 - Reach out to our Python Tutors to get online tutoring related to this assignment and get your doubts cleared
- Option 3 - You can check the partial solution for this assignment in this blog below
Free Assignment Solution - Explainable Approaches to Machine Learning - COMP6013
{
"cells": [
{
"cell_type": "markdown",
"source": [
"> Importing Python Libraries: "
],
"metadata": {
"id": "wG9_FH_B5975"
}
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"id": "PPXGuRyS5FtK"
},
"outputs": [],
"source": [
"import pandas as pd\n",
"import numpy as np\n",
"import seaborn as sns;sns.set(style=\"white\")\n",
"import matplotlib.pyplot as plt\n",
"%matplotlib inline\n",
"import plotly.express as px\n",
"import pickle\n",
"from IPython.display import display\n",
"from sklearn.model_selection import train_test_split\n",
"from sklearn.preprocessing import StandardScaler\n",
"from sklearn.model_selection import GridSearchCV\n",
"from sklearn.pipeline import Pipeline\n",
"\n",
"from sklearn.metrics import mean_squared_error, r2_score\n",
"\n",
"import warnings\n",
"warnings.simplefilter(\"ignore\")"
]
},
{
"cell_type": "markdown",
"source": [
"> Loading Dataset as Pandas Data:"
],
"metadata": {
"id": "DsrfulHh6IUj"
}
},
{
"cell_type": "code",
"source": [
"df = pd.read_csv(\"train.csv\")\n",
"print(\"Our orignal data-set have {} rows and {} columns. \\n\" .format(df.shape[0], df.shape[1]))\n",
"df.head()"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 388
},
"id": "yBCrovQ18jpk",
"outputId": "3ef5e2d6-338b-4ba4-c898-ef5254cf6426"
},
"execution_count": 2,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"Our orignal data-set have 10000 rows and 25 columns. \n",
"\n"
]
},
{
"output_type": "execute_result",
"data":
" Sensor Position x Sensor Position y Sensor Position z \\\n",
"0 12.15 7.90 10.7 \n",
"1 12.50 -2.95 -1.9 \n",
"2 12.50 -2.95 4.4 \n",
"3 12.50 -2.95 10.7 \n",
"4 12.50 -2.70 11.0 \n",
"\n",
" Target Pressure (bar) \n",
"0 0.199929 \n",
"1 0.435681 \n",
"2 0.264031 \n",
"3 0.270576 \n",
"4 0.204675 \n",
"\n",
"[5 rows x 25 columns]"
],
"text/html": [
"\n",
"
"cell_type": "markdown",
"source": [
"## Pre Processing:"
],
"metadata": {
"id": "B1rAz_AXwDDp"
}
},
{
"cell_type": "code",
"source": [
"df=df.drop([\"ID\",\"Sensor ID\"], axis=1)"
],
"metadata": {
"id": "aL6ske-Wre6s"
},
"execution_count": 3,
"outputs": []
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "a-tg58Ik5Ft3",
"outputId": "6f643bae-619b-4cb7-f0b2-55d8a8101fde"
},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text":
" 'Vapour Height (m)', 'Vapour Temperature (K)', 'Liquid Temperature (K)',\n",
" 'Obstacle Distance to BLEVE (m)', 'Obstacle Width (m)',\n",
" 'Obstacle Height (m)', 'Obstacle Thickness (m)', 'Obstacle Angle',\n",
" 'Status', 'Liquid Critical Pressure (bar)',\n",
" 'Liquid Boiling Temperature (K)', 'Liquid Critical Temperature (K)',\n",
" 'Sensor Position Side', 'Sensor Position x', 'Sensor Position y',\n",
" 'Sensor Position z', 'Target Pressure (bar)'],\n",
" dtype='object')\n"
]
}
],
"source": [
"print(\"We have following columns in our dataframe:\",df.columns)"
]
},
{
"cell_type": "markdown",
"source": [
"> Descriptive Statistics:"
],
"metadata": {
"id": "Kv-BQ7lD8wPc"
}
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {
"id": "lgXZi7cL5Ft-",
"outputId": "f4a0ad93-79ab-4f63-b646-91b6b096a5c5",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 445
}
},
"outputs": [
{
"output_type": "execute_result",
"data": {
],
"source": [
"df.describe()"
]
},
{
"cell_type": "markdown",
"source": [
"> Check for presence of Null values:"
],
"metadata": {
"id": "ZNCNQfRa_NPi"
}
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "-XKujpBs5Ft8",
"outputId": "284cfa51-98f7-49eb-c506-60b06cc8b07e"
},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"\n",
"RangeIndex: 10000 entries, 0 to 9999\n",
"\n",
" }) }; \n",
"\n",
"
Get the best Explainable Approaches to Machine Learning - COMP6013 assignment help and tutoring services from our experts now!
About The Author - Dr. Ananya Patel
Dr. Ananya Patel is an experienced data scientist with a strong background in machine learning and data analysis. She specializes in developing and interpreting predictive models to drive insights and inform strategic decisions. Dr. Patel is skilled in feature engineering, model selection, and global interpretation techniques, ensuring that the models not only perform well but are also comprehensible and actionable.