100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Other

CS 6601 fall 2020 assignment5 Georgia Institute Of Technology

Rating
-
Sold
2
Pages
12
Uploaded on
05-08-2021
Written in
2021/2022

CS 6601 fall 2020 assignment5 Georgia Institute Of Technology #!/usr/bin/env python # coding: utf-8 # This was input cell with execution count: 1 import os import numpy as np from helper_functions import * # Please don't modify this cell # This was input cell with execution count: def get_initial_means(array, k): """ Picks k random points from the 2D array (without replacement) to use as initial cluster means params: array = ay[ay[float]] - m x n | datapoints x features k = int returns: initial_means = ay[ay[float]] """ newArr = () le(newArr) # First shuffle up the array (so we don't need to worry about random selection) return newArr[:k] # Select k values to return # This was input cell with execution count: def dist(a, b, axis=1): """ Euclidean Distance metric """ return (a - b, axis=axis) def k_means_step(image_values, k, means): """ A single update/step of the K-means algorithm Based on a input image_values and current mean estimate calculate new means and predict clusters for each of the pixel params: image_values = ay[ay[ay[float]]] k = int initial_means = ay[ay[float]] returns: new_means = ay[ay[float]] clusters = ay[ay[int]] """ new_means = ay(shape=(k, len(image_values[0])), dtype=float) clusters = (shape=len(image_values), dtype=int) meanPts = [] for i in range(k): meanPd( []) # For meanPts, we group all points by their corresponding cluster so we can calculate the new means eucDist = (shape=(len(image_values), k), dtype=float) # This is for distance from each mean

Show more Read less









Whoops! We can’t load your doc right now. Try again or contact support.

Document information

Uploaded on
August 5, 2021
Number of pages
12
Written in
2021/2022
Type
Other
Person
Unknown

Subjects

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
smartzone Liberty University
View profile
Follow You need to be logged in order to follow users or courses
Sold
3197
Member since
5 year
Number of followers
2291
Documents
14397
Last sold
1 day ago
AMAIZING EDUCATION WORLD

GET ALL KIND OF EXAMS ON THIS PAGE ,COMPLETE TEST BANKS,SUMMARIES,STUDY GUIDES,PROJECT PAPERS,ASSIGNMENTS,CASE STUDIES, YOU CAN ALSO COMMUNICATE WITH THE SELLER FOR ANY PRE-ORDER,ORDER AND ETC.

3.7

584 reviews

5
260
4
93
3
103
2
29
1
99

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Frequently asked questions