Preview

Machine Learning Week 6

Powerful Essays
Open Document
Open Document
4020 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Machine Learning Week 6
Programming Exercise 7: K-means Clustering and Principal Component Analysis
Machine Learning

Introduction
In this exercise, you will implement the K-means clustering algorithm and apply it to compress an image. In the second part, you will use principal component analysis to find a low-dimensional representation of face images. Before starting on the programming exercise, we strongly recommend watching the video lectures and completing the review questions for the associated topics. To get started with the exercise, you will need to download the starter code and unzip its contents to the directory where you wish to complete the exercise. If needed, use the cd command in Octave to change to this directory before starting this exercise.

Files included in this exercise ex7.m - Octave/Matlab script for the first exercise on K-means ex7 pca.m - Octave/Matlab script for the second exercise on PCA ex7data1.mat - Example Dataset for PCA ex7data2.mat - Example Dataset for K-means ex7faces.mat - Faces Dataset bird small.png - Example Image displayData.m - Displays 2D data stored in a matrix drawLine.m - Draws a line over an exsiting figure plotDataPoints.m - Initialization for K-means centroids plotProgresskMeans.m - Plots each step of K-means as it proceeds runkMeans.m - Runs the K-means algorithm [ ] pca.m - Perform principal component analysis 1

[ [ [ [ [

] ] ] ] ]

projectData.m - Projects a data set into a lower dimensional space recoverData.m - Recovers the original data from the projection findClosestCentroids.m - Find closest centroids (used in K-means) computeCentroids.m - Compute centroid means (used in K-means) kMeansInitCentroids.m - Initialization for K-means centroids

indicates files you will need to complete Throughout the first part of the exercise, you will be using the script ex7.m, for the second part you will use ex7 pca.m. These scripts set up the dataset for the problems and make calls to functions that you will write. You are only

You May Also Find These Documents Helpful

  • Satisfactory Essays

    Acc561 Week 5

    • 250 Words
    • 1 Page

    List the products and show for each quarter and for the 6 months, units, selling price, and total sales by product and in total.…

    • 250 Words
    • 1 Page
    Satisfactory Essays
  • Powerful Essays

    Weygandt, J. J., Kieso, D. E., &Kell, W. G. (1996). Accounting Principles (4th ed.). Wiley & Sons, Inc.…

    • 1657 Words
    • 7 Pages
    Powerful Essays
  • Good Essays

    NT2670 Lab1 2

    • 1472 Words
    • 7 Pages

    Each lab in this manual requires that you answer questions, save images of your screen, or perform other activities that you document in a worksheet named for the lab, such as lab1_2_worksheet. Your instructor will provide you with the worksheet files that you must complete for each lab. As you perform the exercises in each lab, open the appropriate worksheet file using WordPad, fill in the required information, and save the file to your…

    • 1472 Words
    • 7 Pages
    Good Essays
  • Satisfactory Essays

    See the Assignment 1 post in the Main forum or Course Materials forum for detailed instructions.…

    • 571 Words
    • 4 Pages
    Satisfactory Essays
  • Good Essays

    Nt1310 Unit 3 Study Essay

    • 3921 Words
    • 16 Pages

    |Singular Value |Closely related to principal components analysis, it reduces the overall dimensionality of the input |…

    • 3921 Words
    • 16 Pages
    Good Essays
  • Good Essays

    Mat126 Week 3

    • 671 Words
    • 3 Pages

    This week’s assignment involves a method of solving a quadratic equation that purports to have originated from India. I shall use this methodology to complete (a) and (c), as assigned. I shall also complete an assignment involving a previously derived formula that may yield prime numbers . I shall conclude the assignment with a summary of what I have learned in completing the two assigned projects.…

    • 671 Words
    • 3 Pages
    Good Essays
  • Satisfactory Essays

    Sci/256 Week 2

    • 764 Words
    • 4 Pages

    “The human history of the Yellowstone region goes back more than 11,000 years. From then until to the very recent past, many groups of Native Americans used the park as their homes, hunting grounds, and transportation routes. These traditional uses of Yellowstone lands continued until a little over 200 years ago when the first people of European descent found their way into the park. In 1872 a country that had not yet seen its first centennial, established Yellowstone as the first national park in the world. A new concept was born and with it a new way for people to preserve and protect the best of what they had for the benefit and enjoyment of future generations.” ("Yellowstone National Park Service", 2013) In the following paragraphs, the author will discuss the major structural and functional dynamics (processes) of that ecosystem including change over time, also, how humans may have affected biogeochemical cycles in that ecosystem, including impacts to the nitrogen, phosphorus, or carbon cycle. The author will also discuss how knowledge about that ecosystem’s structure and function can help or has helped to develop plans for its management and restoration plus the implication of species interactions in ecosystem management and restoration.…

    • 764 Words
    • 4 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Sci/256 Week 1

    • 876 Words
    • 4 Pages

    Answer #1: The environmental movement started around the end of the 1700’s. However, most people did not join in to or even know about the environmental movement until many decades later. You could say that there was at first a sharp increase in the awareness of the environmental problems and the environmental movement to stop these problems around the mid 1950’s. This is the time in which people began to jump on the environmentally friendly and cautious band wagon because there were several catastrophic environmental disasters that occurred during this time period as well as a large increase in the popularity of televisions and radio as well as the media as a whole. Because of the increase in American’s access to media coverage on the news on television at the time, many people were able to see as well as hear what was going on at the time. Some events that were covered by the news media included oil spills, and the effects on ocean life due to those oil spills, as well as nuclear bombs, also known as atomic bombs, being tested in the state of New Mexico. These events were not only occurring and being witnessed by the citizens of the United States, but were happening across the world and that led to many people becoming involved in the environmental movement, which today is larger than it has ever been. However, that is in part because the world continues to have oil spills and other horrible disasters at an ever increasing rate every year.…

    • 876 Words
    • 4 Pages
    Satisfactory Essays
  • Powerful Essays

    Acc 403

    • 5361 Words
    • 22 Pages

    | Note: Instructions for using the software can be found in the Appendix of the textbook. |…

    • 5361 Words
    • 22 Pages
    Powerful Essays
  • Satisfactory Essays

    Sas Assignment

    • 300 Words
    • 2 Pages

    UNSW SCHOOL OF MATHEMATICS MATH2871 DATA MANAGEMENT FOR STATISTICAL ANALYSIS ASSIGNMENT 1 - ANSWERS TOTAL MARKS 20 (10% of final grade) Number of Questions: 2…

    • 300 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Week 5 Quiz

    • 353 Words
    • 2 Pages

    To avoid a costly and sometimes bitter campaign for unionization, most employers will voluntarily recognize a union once it demonstrates it has majority support by the employees through the authorization card campaign. (Points : 1)…

    • 353 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    The Learning Tree

    • 598 Words
    • 2 Pages

    In the novel, The Learning Tree, written by Gordon Parks, is a character by the name of Newt Winger. He is a kind black teenager who is a constant victim of racism by the opposing whites. In the play, Antigone, is a character by the name of Antigone who is a daughter of a former king. She has a strong moral character and the will to accomplish anything. As I compare these two characters, one will begin to see the close similarities between the two in will, moral character to do what is right, and other aspects of life.…

    • 598 Words
    • 2 Pages
    Good Essays
  • Powerful Essays

    Week 5 Quiz

    • 2286 Words
    • 16 Pages

    Which one of the following statements most accurately describes what developmental theorists mean when they talk about a language acquisition device?…

    • 2286 Words
    • 16 Pages
    Powerful Essays
  • Powerful Essays

    Sci 256 Week 3

    • 2257 Words
    • 10 Pages

    The first national park in the United States was the Yellowstone National Park, which was created in 1872. At this time, the concept of a national park was new for people. However, it was a great concept because it allowed people the ability to preserve and protect the best of what they had for the benefit and enjoyment of all future generations. Yellowstone National Park is located in a rugged region where the states of Idaho, Wyoming, and Montana come together. This rugged region is made up of alpine and sub-alpine forests, as well as, mountains of high elevation. Recognized for its ecological value, Yellowstone National Park was designated as a Biosphere Reserve in 1976; a biosphere reserve is an environmental area which is highly sensitive and has protected status, which is managed primarily to preserve natural ecological conditions. This paper on Yellowstone National Park will be discussing the impacts associated with agriculture, the effects that a growing human population can have on the resources of an ecosystem, a management practice to help with sustainability, the risks and benefits for extracting renewable and nonrenewable energy resource for the ecosystem, and management practices for sustainability and conservation of natural resources and energy.…

    • 2257 Words
    • 10 Pages
    Powerful Essays
  • Satisfactory Essays

    Week 6 quiz

    • 1495 Words
    • 9 Pages

    (TCO D) Last year, the House of Orange had sales of $826,650, net operating income of $81,000, and operating assets of $84,000 at the beginning of the year and $90,000 at the end of the year. What was the company's turnover, rounded to the nearest tenth?…

    • 1495 Words
    • 9 Pages
    Satisfactory Essays