Interactive Course

# Cluster Analysis in R

Develop a strong intuition for how hierarchical and k-means clustering work and learn how to apply them to extract insights from your data.

• 4 hours
• 16 Videos
• 52 Exercises
• 16,656 Participants
• 3,800 XP

### Course Description

Cluster analysis is a powerful toolkit in the data science workbench. It is used to find groups of observations (clusters) that share similar characteristics. These similarities can inform all kinds of business decisions; for example, in marketing, it is used to identify distinct groups of customers for which advertisements can be tailored. In this course, you will learn about two commonly used clustering methods - hierarchical clustering and k-means clustering. You won't just learn how to use these methods, you'll build a strong intuition for how they work and how to interpret their results. You'll develop this intuition by exploring three different datasets: soccer player positions, wholesale customer spending data, and longitudinal occupational wage data.

1. 1

#### Calculating distance between observations

Free

Cluster analysis seeks to find groups of observations that are similar to one another, but the identified groups are different from each other. This similarity/difference is captured by the metric called distance. In this chapter, you will learn how to calculate the distance between observations for both continuous and categorical features. You will also develop an intuition for how the scales of your features can affect distance.

2. #### K-means clustering

In this chapter, you will build an understanding of the principles behind the k-means algorithm, learn how to select the right k when it isn't previously known, and revisit the wholesale data from a different perspective.

3. #### Hierarchical clustering

This chapter will help you answer the last question from chapter 1 - how do you find groups of similar observations (clusters) in your data using the distances that you have calculated? You will learn about the fundamental principles of hierarchical clustering - the linkage criteria and the dendrogram plot - and how both are used to build clusters. You will also explore data from a wholesale distributor in order to perform market segmentation of clients using their spending habits.

4. #### Case Study: National Occupational mean wage

In this chapter, you will apply the skills you have learned to explore how the average salary amongst professions have changed over time.

1. 1

#### Calculating distance between observations

Free

Cluster analysis seeks to find groups of observations that are similar to one another, but the identified groups are different from each other. This similarity/difference is captured by the metric called distance. In this chapter, you will learn how to calculate the distance between observations for both continuous and categorical features. You will also develop an intuition for how the scales of your features can affect distance.

2. #### Hierarchical clustering

This chapter will help you answer the last question from chapter 1 - how do you find groups of similar observations (clusters) in your data using the distances that you have calculated? You will learn about the fundamental principles of hierarchical clustering - the linkage criteria and the dendrogram plot - and how both are used to build clusters. You will also explore data from a wholesale distributor in order to perform market segmentation of clients using their spending habits.

3. #### K-means clustering

In this chapter, you will build an understanding of the principles behind the k-means algorithm, learn how to select the right k when it isn't previously known, and revisit the wholesale data from a different perspective.

4. #### Case Study: National Occupational mean wage

In this chapter, you will apply the skills you have learned to explore how the average salary amongst professions have changed over time.

### What do other learners have to say?

“I've used other sites, but DataCamp's been the one that I've stuck with.”

Devon Edwards Joseph

Lloyd's Banking Group

“DataCamp is the top resource I recommend for learning data science.”

Louis Maiden

“DataCamp is by far my favorite website to learn from.”

Ronald Bowers

Decision Science Analytics @ USAA

##### Dmitriy Gorenshteyn

Lead Data Scientist at Memorial Sloan Kettering Cancer Center

Dmitriy is a Lead Data Scientist in the Strategy & Innovation department at Memorial Sloan Kettering Cancer Center. At MSK he develops predictive models for programs aimed at improving patient care. Prior to this role, Dmitriy completed his Doctorate in Quantitative & Computational Biology at Princeton University. With a passion for teaching and for R, he regularly holds cross-departmental R training sessions within MSK. His core teaching philosophy is centered on building intuition and understanding for the methods and tools available.

See More
• Yashas Roy

• Sascha Mayr