Page 1 of 1

This task is to produce a visualisation from initial data analytics. This is a key stage in any machine learning or data

Posted: Mon May 09, 2022 7:02 am
by answerhappygod
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 commaseparated, 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