{ "cells": [ { "cell_type": "markdown", "source": [ "## **Nigerian Music wey dem scrape from Spotify - one analysis**\n", "\n", "Clustering na one kain [Unsupervised Learning](https://wikipedia.org/wiki/Unsupervised_learning) wey dey assume say dataset no get label or say e input no dey match with any predefined output. E dey use different algorithms to arrange data wey no get label and group dem based on patterns wey e see for di data.\n", "\n", "[**Pre-lecture quiz**](https://gray-sand-07a10f403.1.azurestaticapps.net/quiz/27/)\n", "\n", "### **Introduction**\n", "\n", "[Clustering](https://link.springer.com/referenceworkentry/10.1007%2F978-0-387-30164-8_124) dey very useful for data exploration. Make we see whether e fit help us discover trends and patterns for how Nigerian people dey enjoy music.\n", "\n", "> ✅ Take small time think about wetin clustering fit do. For real life, clustering dey happen anytime you get pile of clothes wey you wan sort out for your family members 🧦👕👖🩲. For data science, clustering dey happen when you dey try analyze wetin person like or to find di characteristics of any dataset wey no get label. Clustering dey help make sense of confusion, like how you go arrange sock drawer.\n", "\n", "For work matter, clustering fit help for things like market segmentation, to know di age group wey dey buy certain items. Another example na anomaly detection, like to catch fraud for dataset wey get credit card transactions. Or you fit use clustering to find tumors for medical scans.\n", "\n", "✅ Think small about how you don see clustering 'for di wild', maybe for banking, e-commerce, or business.\n", "\n", "> 🎓 E funny say cluster analysis start for Anthropology and Psychology for di 1930s. You fit imagine how dem take use am?\n", "\n", "Another way you fit use am na to group search results - like shopping links, images, or reviews. Clustering dey useful if you get big dataset wey you wan reduce and analyze well well, so di technique fit help you sabi di data before you build other models.\n", "\n", "✅ Once you don arrange your data inside clusters, you go give am cluster Id. Dis technique fit help keep di dataset private; you fit dey refer to di data point by di cluster Id instead of di original data wey fit expose di person. You fit think of other reasons why you go use cluster Id instead of di original data?\n", "\n", "### How to start with clustering\n", "\n", "> 🎓 How we dey create clusters dey depend on how we dey gather di data points into groups. Make we break down di vocabulary:\n", ">\n", "> 🎓 ['Transductive' vs. 'inductive'](https://wikipedia.org/wiki/Transduction_(machine_learning))\n", ">\n", "> Transductive inference dey come from training cases wey dem observe wey dey match specific test cases. Inductive inference dey come from training cases wey dey form general rules wey dem go later apply to test cases.\n", ">\n", "> Example: Imagine say you get dataset wey no complete label. Some things na 'records', some na 'cds', and some no get label. Your work na to give label to di ones wey no get. If you use inductive approach, you go train model wey dey look for 'records' and 'cds', then apply di labels to di data wey no get label. Dis approach go struggle to classify things wey be 'cassettes'. But transductive approach go handle di unknown data better because e dey group similar items together before e give di group label. For dis case, clusters fit be 'round musical things' and 'square musical things'.\n", ">\n", "> 🎓 ['Non-flat' vs. 'flat' geometry](https://datascience.stackexchange.com/questions/52260/terminology-flat-geometry-in-the-context-of-clustering)\n", ">\n", "> Dis one dey come from mathematics, non-flat vs. flat geometry dey measure di distance between points either 'flat' ([Euclidean](https://wikipedia.org/wiki/Euclidean_geometry)) or 'non-flat' (non-Euclidean) way.\n", ">\n", "> 'Flat' for dis context na Euclidean geometry (di one wey dem dey teach as 'plane' geometry), and non-flat na non-Euclidean geometry. Wetin geometry get to do with machine learning? Well, since di two na mathematics, dem need common way to measure distance between points for clusters, and e fit be 'flat' or 'non-flat' way, depending on di data. [Euclidean distances](https://wikipedia.org/wiki/Euclidean_distance) dey measure di length of line between two points. [Non-Euclidean distances](https://wikipedia.org/wiki/Non-Euclidean_geometry) dey measure distance along curve. If your data no dey for plane when you visualize am, you go need special algorithm to handle am.\n", "\n", "
\n",
"
\n",
"
\n",
"
\n",
"
\n",
"
\n",
"