October 2018
Intermediate to advanced
172 pages
4h 6m
English
In this section, you will learn how to evaluate the performance of an unsupervised machine learning algorithm, such as the k-means algorithm. The first step is to build a simple k-means model. We can do so by using the following code:
#Reading in the datasetdf = pd.read_csv('fraud_prediction.csv')#Dropping the target feature & the indexdf = df.drop(['Unnamed: 0', 'isFraud'], axis = 1)#Initializing K-means with 2 clustersk_means = KMeans(n_clusters = 2)
Now that we have a simple k-means model with two clusters, we can proceed to evaluate the model's performance. The different visual performance charts that can be deployed are as follows:
In this section, ...
Read now
Unlock full access