ANSWERs_Lab2_ParallelKmeans.pdf - Lab 2 – Parallel K-means Name ID 1 2 Python scikit-learn package is one of the most popular package in data mining

ANSWERs_Lab2_ParallelKmeans.pdf - Lab 2 – Parallel...

This preview shows page 1 - 2 out of 2 pages.

1. Python scikit-learn package is one of the most popular package in data mining and machine learning. 2. In particular, its k-means function has been widely adopted for data clustering: 3. The following is the example code snippet from GitHub in running k-means: import numpy as np from sklearn.cluster import KMeans from sklearn.datasets import make_blobs # Creating a sample dataset with 4 clusters X, y = make_blobs(n_samples=100, n_features=3, centers=4) # Initializing KMeans with 4 clusters kmeans = _____ KMeans(n_clusters=4)____________ # Fitting with inputs kmeans = kmeans.___fit_______(X) # Labelling the clusters labels = kmeans.___predict___(X) print(labels) # Getting the cluster centers C = kmeans.cluster_centers_ print(C) 4. Fill in the underlined space. Please feel free to try the code in your own machine for experiments. 5. If you read below carefully, you can see that there is an argument called “ n_jobs . What is it?
Image of page 1
Image of page 2

You've reached the end of your free preview.

Want to read both pages?

  • Fall '16
  • cheng

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern

Stuck? We have tutors online 24/7 who can help you get unstuck.
A+ icon
Ask Expert Tutors You can ask You can ask You can ask (will expire )
Answers in as fast as 15 minutes
A+ icon
Ask Expert Tutors