Learning analytics is the use of data to understand and improve learning. Unsupervised learning is a type of machine learning that can be used to identify patterns and relationships in data without the need for labeled data.
In this case study, you will use unsupervised learning to analyze learning data from a Simulated School course. You will use dimensionality reduction to reduce the number of features in the data, and then use clustering to identify groups of students with similar learning patterns.
The data for this case study is generated with the simulated function below. The data contains the following features:
Student ID: A unique identifier for each student Feature 1: A measure of student engagement Feature 2: A measure of student performance
simulate_student_features <- function(n = 100) {
# Set the random seed
set.seed(260923)
# Generate unique student IDs
student_ids <- seq(1, n)
# Simulate student engagement
student_engagement <- rnorm(n, mean = 50, sd = 10)
# Simulate student performance
student_performance <- rnorm(n, mean = 60, sd = 15)
# Combine the data into a data frame
student_features <- data.frame(
student_id = student_ids,
student_engagement = student_engagement,
student_performance = student_performance
)
# Return the data frame
return(student_features)
}
This function takes the number of students to simulate as an input and returns a data frame with three columns: student_id, student_engagement, and student_performance. The student_engagement and student_performance features are simulated using normal distributions with mean values of 50 and 60, respectively, and standard deviations of 10 and 15, respectively.
To use the simulate_student_features() function, we can simply pass the desired number of students to simulate as the argument:
student_features <- simulate_student_features(n = 100)
We can then use this data frame to perform unsupervised learning to identify groups of students with similar learning patterns,
Simulate the data.
Perform dimensionality reduction on the data using PCA.
pr.out <- prcomp(student_features,scale. = TRUE)
summary(pr.out)
Cluster the data using KMeans and other clustering
algorithms.
km.out <- kmeans(student_features, centers = 3, nstart = 20)
summary(km.out)
Interpret the results of your analysis.
Submit a report containing the following:
A brief description of your approach to dimensionality reduction and clustering.
My understanding of dimensionality reduction focuses on creation of
finding the linear combination in clustering while the basic clustering
still only focus is to create group from data
The results of your analysis, including the number of clusters identified, the characteristics of each cluster, and any other insights you gained from the data.
##RESULTS OF PCA SECTION##
# PC1 PC2 PC3
#Standard deviation 1.0825 0.9895 0.9214
#Proportion of Variance 0.3906 0.3264 0.2830
#Cumulative Proportion 0.3906 0.7170 1.0000
##RESULTS OF KMEANS SECTION##
# Length Class Mode
# cluster 100 -none- numeric
# centers 9 -none- numeric
# totss 1 -none- numeric
# withinss 3 -none- numeric
# tot.withinss 1 -none- numeric
# betweenss 1 -none- numeric
# size 3 -none- numeric
# iter 1 -none- numeric
# ifault 1 -none- numeric
##VIEW OF THE CLUSTERS##
#K-means clustering with 3 clusters of sizes 33, 35, 32
#Cluster means:
# student_id student_engagement student_performance
#1 52.0 53.04457 61.53054
#2 18.0 50.74352 61.58098
#3 84.5 47.38971 64.24894
#Clustering vector:
# [1] 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 3 3 3 3 3 3 3 3 3 3 3
#[81] 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
#Within cluster sum of squares by cluster:
# [1] 12305.63 14060.29 11821.42
#(between_SS / total_SS = 66.2 %)
#Available components:[1] “cluster” “centers” “totss” “withinss” “tot.withinss” “betweenss” “size” “iter” “ifault”
A discussion of the implications of your findings for learning
analytics.
For my project I can use clustering of SAT scores and group them together by scores and then compare them in multiple ways like government spending or geo politiacl location.
Provide at least one scholarly reference.
Your report should include your code. Submit the published RPubs link to Blackboard.