Skip to content

Análisis no supervisado: uso de los Algoritmos de clustering hclust() y k-means().

Para la realización de este proyecto se utiliza el dataset "Country-data" disponible en la página web de Kaggle (https://www.kaggle.com/datasets/rohan0301/unsupervised-learning-on-country-data).

El dataset recoge información sociodemográfica y económica de 167 paises:

  • country: Name of the country
  • child_mort: Death of children under 5 years of age per 1000 live births
  • exports: Exports of goods and services per capita. Given as %age of the GDP per capita
  • health: Total health spending per capita. Given as %age of GDP per capita
  • imports: Imports of goods and services per capita. Given as %age of the GDP per capita
  • income: Net income per person
  • inflation: The measurement of the annual growth rate of the Total GDP
  • life_expec: The average number of years a new born child would live if the current mortality patterns are to remain the same
  • total_fer: The number of children that would be born to each woman if the current age-fertility rates remain the same.
  • gdpp: The GDP per capita. Calculated as the Total GDP divided by the total population.

El objetivo de este proyecto se centrará en la agrupación de paises en función de sus características económicas.

Se carga el dataset.

countries = read.csv('Country-data.csv', na.string = c("", "NA"))

Se visualizan las primeras filas.

head(countries)
str(countries)

Resumen de los estadísticos más importantes para cada variable.

summary(countries)

Gráficos de barras de las principales variables.

freq<-table(countries$total_fer)
barplot(freq,xlab="Número de niños nacidos", ylab="Frecuencia")
title(main="Número de niños nacidos", col.main="blue", font.main=1)
freq<-table(countries$life_expec)
barplot(freq,xlab="life_expec", ylab="Frecuencia")
title(main="Esperanza de vida", col.main="blue", font.main=1)
freq<-table(countries$child_mort)

barplot(freq,xlab="child_mort", ylab="Frecuencia")
title(main="Mortalidad infantil", col.main="blue", font.main=1)