October 2018
Intermediate to advanced
172 pages
4h 6m
English
The t-SNE is an abbreviation that stands for t-distributed stochastic neighbor embedding. The fundamental concept behind the t-SNE is to map a higher dimension to a two-dimensional space. In simple terms, if your dataset has more than two features, the t-SNE does a great job at showing you how your entire dataset can be visualized on your computer screen!
The first step is to implement the k-means algorithm and create a set of prediction labels that we can merge into the unlabeled dataset. We can do this 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 ...Read now
Unlock full access