Answered step by step
Verified Expert Solution
Link Copied!

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.


 


image

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 ... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

International Marketing And Export Management

Authors: Gerald Albaum , Alexander Josiassen , Edwin Duerr

8th Edition

1292016922, 978-1292016924

More Books

Students also viewed these Programming questions