SEMTM0016 Artificial Intelligence for Robotics
SEMTM0016 Coursework - Part A
The questions below form. one part of the assessment for the unit SEMTM0016.
This part of the coursework is worth 30% of the overall unit assessment and is to assess your learning on the materials covering Supervised and Unsupervised Learning.
You must submit two items (on Blackboard) for this part:
1. a single PDF .pdf file (named ‘SEMTM0016 PartA.pdf’) that reports your answers to the questions below, and
2. a single .zip file (named ‘SEMTM0016 PartA.zip’) containing all Python .py files.
Your report PDF (1) for this part of the assessment must containing everything you wish to be marked for this part of the assessment (including, but not limited to, numerical and textual answers and figures). Material not contained in either (1) or (2) will receive no credit for this part of the assessment.
This is an individual coursework and so your submission must be your own individual effort; submis-sions will be checked for possible plagiarism. Collaboration is not permitted. You are not permitted to use AI tools (e.g., ChatGPT) to generate your answers to any question. The University of Bris-tol considers unauthorized use of AI to complete assessments as contract cheating. If cheating or collaboration are detected, as with any assessment, then this will be subject to the University’s rules on academic integrity, please refer to the link below for details:
https://www.bristol.ac.uk/students/support/academic-advice/academic-integrity/
Task Overview
You are the mighty HeroBot traversing the MazeDungeon where you will encounter many different entitities.
The following files will help you in your quest and can be downloaded from Blackboard:
• sprites greyscale10 . npz : This dataset is comprised of 13771 10x10 pixel greyscale images of entities within the dungeon. Each entity is labelled with a particular ‘race’ and there are four races in total.
• dungeon sensorstats . csv : This dataset gives sensor and stats information about 10,000 example entities within the dungeon.
You have three tasks to complete:
Q1: Predict the race of the entity given a 10x10 pixel greyscale image.
Q2: Predict the bribe amount that a human guard will accept to let you pass using only the four features ‘stench’, ‘sound’, ‘heat’ and ‘intelligence’ in the second dataset.
Q3: Group the entities based on physical threat level using their ‘height’, ‘weight’ and ‘strength’.
Question 1 - Supervised Classification (15 marks)
(1.1) Preparation of the data: Save the file sprites greyscale10. npz locally and use the following commands to import the data within this file:
import numpy as np
data = np . load (" sprites_greyscale10 .npz ")
train_X = data [" train_X "]
train_Y = data [" train_Y "]
test_X = data [" test_X "]
test_Y = data [" test_Y "]
(1.2) Extract a subset of (training and test) data that corresponds to only two classes. Make sure that you extract features and labels for the same datapoints.
(1.3) (6 marks) Use Decision Trees, KNN and Logistic Regression classifiers from the worksheets to separate the two classes in the image dataset. For each classifier, train (fit) your model on the training set then evaluate its performance on the test set.
(1.4) (9 marks) Justify your choice of model hyperparameters (those covered in the worksheets).
Note: you are not allowed to use Python’s built-in options for Hyperparameter optimisation, if needed, you should implement it (see worksheets for related examples).
Question 2 - Supervised Regression (4 marks)
(2.1) Preparation of the data: Save the files dungeon sensorstats train . csv and
dungeon sensorstats test . csv locally and use the following commands to import the data within this file:
import pandas as pd
train_data = pd . read_csv (’ dungeon_sensorstats_train .csv ’)
test_data = pd . read_csv (’ dungeon_sensorstats_test .csv ’)
(2.2) Extract the subset of the training and test data that (i) corresponds to only the ‘human’ class and (ii) with only four sensor features (intelligence, stench, sound, heat) and the target (bribe).
(2.3) (1 mark) Use the features (intelligence, stench, sound and heat) in this extracted subset to
build a Linear Regression model for predicting the bribe (target) and outputting the MSE.
(2.4) (3 marks) Now choose a single feature among the four features to build a Linear Regression model for predicting the bribe (target) and outputing the MSE. Visualise the data in 2- dimensions and plot your model on this 2D display. Compare the MSE with your findings in (2.3).
Question 3 - Unsupervised Clustering (8 marks)
(3.1) Preparation of the data: Save the file dungeon sensorstats. csv locally and use the following commands to import the data within this file:
import pandas as pd
train_data = pd . read_csv (’ dungeon_sensorstats .csv ’)
(3.2) Choose two features from height, weight and strength and extract the data corresponding to your chosen features.
(3.3) (4 marks) Use KMeans and Gaussian Clustering to separate the entities into k groups in- dicating their physical threat level. Visualise the data in 2-dimensions for each method and show the clusters for optimal k.
(3.4) (4 marks) Justify your choice of optimal k for each of the methods and your final optimal k.
Report
There are 3 marks for overall presentation of the report.
Your report should be no longer than six pages, shorter is fine. Use an 11 or 12pt font and do not try tricks like expanding the margin to fit in more text, shorter is better than longer.
Your report must be submitted as a pdf and should be prepared either in LaTeX (overleaf is a good approach), MS Word, or a similar text editor to prepare the report and submit it as a pdf document.
Your code will not be marked for elegance, but it should run correctly; it is expected you will use Python. Do not include screenshots of graphs, they should be imported directly; resize them to the correct size before importing them, if the labels are tiny the graphs will not be marked. Make sure figure captions are descriptive, it is better to have some overlap between figure captions and the main text than to have figure captions that are not reasonably self-contained.
Avoid code snippets in the report unless that feels like the best way to illustrate some subtle aspect of an algorithm; do always though consider a mathematical description if possible. You will be asked to submit your code and it may be tested to make sure it works and matches your report. It will not, however, be marked itself for quality.
The teaching assistants (TAs) are unable to answer questions about how to solve an exercise or what methods to use beyond what has been specified in the coursework document. However, if you need help to know more about a method in a certain lab/worksheet in order to solve an exercise, do ask TAs for help about that method.