From the course: Python in Excel: Data Outputs in Custom Data Visualizations and Algorithms
Unlock this course with a free trial
Join today to access over 25,400 courses taught by industry experts.
Grouping data with the K-Means algorithm
From the course: Python in Excel: Data Outputs in Custom Data Visualizations and Algorithms
Grouping data with the K-Means algorithm
- [Instructor] The scikit-learn, or sklearn library, is a data science AI machine learning library for running models. To make our modeling more efficient, we'll just import the k-means function from the clusters section of the sklearn library. We'll import this along with Pandas and NumPy. We already have an ETL framework in this file to create a data frame object storing the daily temperatures for Santa Barbara. We'll run this code to create the data frame. Now, let's translate our Python code into Python Excel code. We'll note in the k-means tab that we're using the k-means function from the sklearn library. Let's first reference the daily data frame object that we created in the objects tab of our workbook. So, make this a bit bigger. We'll then select to just include the columns for date, low temperature, and high temperature by chaining it to the end of our code. We also need to create a data list object to use in our k-means algorithm within Excel. We'll do so using the Python…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
Introducing AI and machine learning algorithms2m 32s
-
(Locked)
Determining trends for linear regression with Excel functions5m 4s
-
(Locked)
Leveraging Excel Solver for logistic regression2m 49s
-
(Locked)
Determining trends for logistic regression with Python code4m 17s
-
(Locked)
Grouping data with hierarchical clustering5m 5s
-
(Locked)
Grouping data with the K-Means algorithm2m 51s
-
(Locked)
Determining anomalies with anomaly detection algorithms6m 43s
-
(Locked)
Challenge: Running algorithms with Python in Excel1m 5s
-
(Locked)
Solution: Running algorithms with Python in Excel5m 10s
-
-
-