UFCFGS-15-1 Artificial Intelligence 1 2021-22
Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit
UFCFGS-15-1
Artificial Intelligence 1
2021-22
Section 1: Overview of Assessment
This assignment assesses the following module learning outcomes:
“Design and implement basic optimisation, expert system and machine learning systems”.
In total the coursework is worth 75% of the overall module. All three submitted parts are weighted equally, therefore this assignment is worth 25% of the overall mark for the module. The assignment is described in more detail in section 2.
Working on this assignment will help you to gain experience of the practical issues around creating machine learning systems
This is an individual assignment.
If you have questions about this assignment, please post them to the discussion board Machine Learning Coursework Discussion Forum on Blackboard.
Section 2: Task Specification
This task is to produce a visualisation from initial data analytics. This is a key stage in any machine learning or data science project which should inform your future investigations, and can be a vital tool when communicating findings with stakeholders.
You should submit a single file (not zipped) named myVisualiser.py containing a function with signature:
def cluster_and_visualise(datafilename, K, featurenames):
This function has three parameters (respectively a string, an int and a list) and must:
· Read in a dataset from a file called ‘datafilename’. The data will be comma-separated, so if you are using numpy.genfromtxt() you will need to set the parameter ‘delimiter’ appropriately
· Run the kmeans algorithm on the data to get a cluster labels for each data point.
· Make a 2d visualisation of the results with:
o Suitable titles and labels for axes to make the plot self-explanatory
o Different colour markers for each cluster
o A suitable title including your name, and preferably the number of clusters
o Suitable size plot – for example setting the “figsize” parameter to (12,12)
· Save the visualisation to a file called myVisualisation.jpg
· Return the fig, ax (the figure and axis variables) to the calling function
· To demonstrate your capability with fundamental python skills and libraries for data manipulation and visualisation your code file must start with these lines:
import numpy as np
import matplotlib.pyplot as plt
from sklearn.cluster import KMeans
· The marking system will reject files containing any other lines with the word ‘import’.
Section 3: Deliverables
You should submit your code for automated assessment via the link in the folder “assignments-> Coursework”. Code should be submitted in the form of a python files called myVisualiser.py.
This task, and the components you need to bring together were introduced in lab workbooks for week 6. You are highly advised to use the Jupyter notebooks provided to check your code prior to submission. Remember that you can develop your code within a single notebook cell and save it to file whenever the cell is run by putting the %%writefile “myfilename” on the first line of the cell.
· To self-assess your work, we suggest that you run the following commands in a notebook cell, after putting a copy of the file of apples-oranges-bananas data from week 1 into the current folder.
from myVisualiser import cluster_and_visualise
featurenames= ( 'mean_red', 'mean_green', 'mean_blue','width', 'height', 'weight')
datafile= 'data/fruit_values.csv'
cluster_and_visualise(datafile, 3,featurenames )
Section 4: Marking Criteria
You have one attempt at this coursework.
You will get zero marks if you do not meet these four conditions:
1. You must only submit one file called myVisualiser.py
2. The file must contain a function with the signature:
def cluster_and_visualise(datafilename, K, featurenames):
3. Your code must produce an image file called myVisualisation.jpg
4. Your code must return two variables:
a. The figure object representing the ‘canvas’ (usually called ‘fig’).
b. The axis object (if you create one plot in the figure) or the axes list, if you create a matrix of scatterplots on different axes within the figure. This will usually called ‘ax’ or ‘axs’.
Thus your function will usually end with one of these two lines:
return fig, ax
or
return fig, axs
To mark this coursework the automated system will run your code against a data set with up to six features in order to produce the image files.
These will then be inspected and marked by the module team according to the following scheme, combining the marks for content and presentation to give a mark out of 100:
Mark |
0 |
10 |
20 |
30 |
40 |
50 |
Content |
Code does not run OR no image file produced, OR image file is empty |
Basic scatter-plot of two features. Data not coloured by clusters. |
Basic scatter-plot only showing two features. Some different colours for data markers but no evidence of clustering. |
Matrix of scatterplots for different combinations of features. Some different colours for data markers but no evidence of clustering |
Matrix of scatter-plots for different combinations of features.
Marker colours show appropriate clusters.
|
Matrix of scatter-plots for different combinations of features.
Diagonals in matrix show histogram plots for variables Marker colours show appropriate clusters |
Presentation |
No figure title or labels on axes OR Plot is not appropriate size OR Data markers are not visible and suitable size. |
Appropriate figure title OR feature names used to label axes, but not both |
Appropriate figure title AND feature names used to label axes. |
Clearly differentiated markers display data with assignment to clusters. Appropriate figure title and axis labels. |
Well presented fully self-explanatory visualisation with good use of colour and marker styles and sizes. |
Section 5: Feedback mechanisms
Some informal feedback will be available via discussion with the module tutors in-class. Students should be able to accurately self-assess their work via the use of the Jupyter Notebook provided in week 6 of the Learning materials, in combination with the marking scheme.
The module team will provide a mark and written feedback on Blackboard.
2022-05-20