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)
# PCA for dimensionality reduction
pca <- prcomp(student_features[, -1], scale. = TRUE)
# Print summary of PCA
summary(pca)
## Importance of components:
## PC1 PC2
## Standard deviation 1.0104 0.9895
## Proportion of Variance 0.5104 0.4896
## Cumulative Proportion 0.5104 1.0000
#Clustering using KMeans
kmeans_clustering <- kmeans(pca$x[, 1:2], centers = 3)
# Print cluster centers
print(kmeans_clustering$centers)
## PC1 PC2
## 1 1.044392617 -0.4654233
## 2 -0.900902816 -0.5128470
## 3 -0.002811599 1.0925446
# Plot clusters
plot(pca$x[, 1:2], col = kmeans_clustering$cluster)
points(kmeans_clustering$centers, col = 1:3, pch = 8, cex = 2)
We can then use this data frame to perform unsupervised learning to identify groups of students with similar learning patterns,
#Interpret the results - The PC1 and PC2 explain most of the variance in the data. Together these actually account for 100% of the variance in the data. It is almost a 50 50 split in proportion but PC1 has a slight edge of about 1%. - Since the clusters in the graph are very well seperated it means that the features we used for clustering are clear and informative. This means there is a clear difference between student, their performance, and how much they are engaged in the course.
Submit a report containing the following:
-I used a PCA to reduce the dimensionality of the dataset, and then I used kmeans to cluster and identify groups of students with similar learning patterns.
-KMeans identified 3 clusters, Cluster 1 indicates students who have a high engagement but a moderate to low performance in the course, Students in Cluster 2 have relatively high performance and a modest amount of engagement, while cluster 3 shows that students have low engagement and low performance. These results show us the different groups of students and that there may almost be a bell shaped curve in regards to how well a student performs given their engagement.
-Bharara, S., Sabitha, S., & Bansal, A. (2018). Application of learning analytics using clustering data Mining for Students’ disposition analysis. Education and Information Technologies, 23, 957-984.
Your report should include your code. Submit the published RPubs link to Blackboard.