{"id":19176527,"url":"https://github.com/leftcoastnerdgirl/unsupervised_learning","last_synced_at":"2025-09-07T18:40:59.498Z","repository":{"id":226827728,"uuid":"769740668","full_name":"LeftCoastNerdGirl/Unsupervised_Learning","owner":"LeftCoastNerdGirl","description":"This project is the first step in machine learning, using K Means and Principal Component Analysis.","archived":false,"fork":false,"pushed_at":"2024-07-22T00:57:39.000Z","size":66,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-23T01:14:00.060Z","etag":null,"topics":["kmeans-clustering","pca","pca-analysis","principal-component-analysis","unsupervised-learning","unsupervised-machine-learning"],"latest_commit_sha":null,"homepage":"https://extension.berkeley.edu/search/publicCourseSearchDetails.do?method=load\u0026courseId=35106003","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LeftCoastNerdGirl.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-03-09T23:16:18.000Z","updated_at":"2024-07-22T00:57:42.000Z","dependencies_parsed_at":null,"dependency_job_id":"e9ba008a-722f-42e1-9898-411b417942c0","html_url":"https://github.com/LeftCoastNerdGirl/Unsupervised_Learning","commit_stats":null,"previous_names":["leftcoastnerdgirl/cryptoclustering","leftcoastnerdgirl/kmeans_and_pcas"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/LeftCoastNerdGirl/Unsupervised_Learning","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LeftCoastNerdGirl%2FUnsupervised_Learning","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LeftCoastNerdGirl%2FUnsupervised_Learning/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LeftCoastNerdGirl%2FUnsupervised_Learning/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LeftCoastNerdGirl%2FUnsupervised_Learning/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LeftCoastNerdGirl","download_url":"https://codeload.github.com/LeftCoastNerdGirl/Unsupervised_Learning/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LeftCoastNerdGirl%2FUnsupervised_Learning/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260570149,"owners_count":23029632,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["kmeans-clustering","pca","pca-analysis","principal-component-analysis","unsupervised-learning","unsupervised-machine-learning"],"created_at":"2024-11-09T10:28:54.688Z","updated_at":"2025-06-18T14:32:50.063Z","avatar_url":"https://github.com/LeftCoastNerdGirl.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Unsupervised learning using K Means and Principal Component Analysis (PCA)\n\nThis project uses unsupervised learning techniques including k-means clustering and PCA to predict changes cryptocurrencies.  \n\n# Prepare the Data  \n-Use the StandardScaler() module from scikit-learn to normalize the data from the CSV file.  \n-Create a DataFrame with the scaled data and set the \"coin_id\" index from the original DataFrame as the index for the new DataFrame.  \n\n![image](https://github.com/user-attachments/assets/7b6a61c1-0516-405f-bb0d-14ed11397755)\n\n# Data discovery  \n-Find the Best Value for k Using the Original Scaled DataFrame.  \n-Use the elbow method to find the best value for k using the following steps:  \n  -Create a list with the number of k values from 1 to 11.  \n  -Create an empty list to store the inertia values.  \n  -Create a for loop to compute the inertia with each possible value of k.  \n  -Create a dictionary with the data to plot the elbow curve.  \n  -Plot a line chart with all the inertia values computed with the different values of k to visually identify the optimal value for k.  \n  -Answer the following question in your notebook: What is the best value for k?  \n\n![image](https://github.com/user-attachments/assets/e4fac361-aca8-457b-8f2e-3e5f39c230a6)\n  \n  \n# Cluster Cryptocurrencies with K-means Using the Original Scaled Data  \n-Use the following steps to cluster the cryptocurrencies for the best value for k on the original scaled data:  \n  -Initialize the K-means model with the best value for k.  \n  -Fit the K-means model using the original scaled DataFrame.  \n  -Predict the clusters to group the cryptocurrencies using the original scaled DataFrame.  \n  -Create a copy of the original data and add a new column with the predicted clusters.  \n  -Create a scatter plot using hvPlot as follows:  \n    -Set the x-axis as \"price_change_percentage_24h\" and the y-axis as \"price_change_percentage_7d\".  \n    -Color the graph points with the labels found using K-means.  \n    -Add the \"coin_id\" column in the hover_cols parameter to identify the cryptocurrency represented by each data point.  \n\n![image](https://github.com/user-attachments/assets/776cb605-af01-4191-8445-5238525a9b30)\n\n\n# Optimize Clusters with Principal Component Analysis  \n-Using the original scaled DataFrame, perform a PCA and reduce the features to three principal components.  \n-Retrieve the explained variance to determine how much information can be attributed to each principal component and then answer the following question in your notebook:  \n  -What is the total explained variance of the three principal components?  \n-Create a new DataFrame with the PCA data and set the \"coin_id\" index from the original DataFrame as the index for the new DataFrame.  \n\n![image](https://github.com/user-attachments/assets/a10297d7-280d-4f50-a845-ca93a3676f34)\n\n# Find the Best Value for k Using the PCA Data  \nUse the elbow method on the PCA data to find the best value for k using the following steps:  \n-Create a list with the number of k-values from 1 to 11.  \n-Create an empty list to store the inertia values.  \n-Create a for loop to compute the inertia with each possible value of k.  \n-Create a dictionary with the data to plot the Elbow curve.  \n-Plot a line chart with all the inertia values computed with the different values of k to visually identify the optimal value for k.  \n\n![image](https://github.com/user-attachments/assets/f339c749-7fb7-44d9-bb5b-9a553f49b8d4)\n\n\n# Cluster Cryptocurrencies with K-means Using the PCA Data  \nUse the following steps to cluster the cryptocurrencies for the best value for k on the PCA data:  \n-Initialize the K-means model with the best value for k.  \n-Fit the K-means model using the PCA data.  \n-Predict the clusters to group the cryptocurrencies using the PCA data.  \n-Create a copy of the DataFrame with the PCA data and add a new column to store the predicted clusters.  \n-Create a scatter plot using hvPlot as follows:  \n  -Set the x-axis as \"PC1\" and the y-axis as \"PC2\".  \n  -Color the graph points with the labels found using K-means.  \n  -Add the \"coin_id\" column in the hover_cols parameter to identify the cryptocurrency represented by each data point.  \n\n![image](https://github.com/user-attachments/assets/b0cb69bf-7d3d-4d4d-a64d-a48f35a57e25)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleftcoastnerdgirl%2Funsupervised_learning","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleftcoastnerdgirl%2Funsupervised_learning","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleftcoastnerdgirl%2Funsupervised_learning/lists"}