Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Algorithms for Data Science: Please provide a code/syntax that WORKS on PYCHARM as well it prints because I have been getting the wrong code from
Algorithms for Data Science: Please provide a code/syntax that WORKS on PYCHARM as well it prints because I have been getting the wrong code from other tutors thanks.
Using your k-means/medians algorithm as a template, create a new python implementation for k- medoids. Your method should take as input: a dataset x, an initial set of medoids and a distance matrix. [[2, 3], [1, 2], [1, 3], [4, 5], [7, 3], [5, 2], [3, 1]] Q1: Compute the distance matrix of dataset x al Q2: Find the medoid of dataset x Q3: Find the resulting clusters using k-medoids on dataset x, using euclidean distance, k = 2, and initial random medoids of: c = [[2, 3], [1, 2]] Submit your python script and the script output for the above 3 questions. *You will need supporting methods to "compute distance matrix" and "calculate medoid" Your k-medoids method should take as input 3 parameters: dataset, initial medoids and a distance matrix.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
import numpy as np def computedistancematrixdataset distancematrix npzeroslendataset lendataset for ...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started