
The lab provides space to work with data and to reflect on how the concepts and techniques introduced in each lab might apply to your own research.
To earn a badge for each lab, you are required to respond to a set of prompts for two parts:
In Part I, you will extend our model by adding another variable.
In Part II, you will reflect on your understanding of key concepts and begin to think about potential next steps for your own study.
In this part of the badge activity, please add another variable – a variable for the number of days before the start of the module students registered. This variable will be a third predictor. By adding it, you’ll be able to examine how much more accurate your model is (if at al, as this variable might not have great predictive power). Note that this variable is a number and so no pre-processing is necessary.
In doing so, please move all of your code needed to run the analysis over from your case study file here. This is essential for your analysis to be reproducible. You may wish to break your code into multiple chunks based on the overall purpose of the code in the chunk (e.g., loading packages and data, wrangling data, and each of the machine learning steps).
```{setwd(“/Users/nickponzi/lab-1/data”)
library(tidyverse) library(tidymodels)
f <- list.files(pattern = “courses|assessments|studentInfo|studentRegistration|oulad-interactions|students|vle”, full.names = TRUE) f
l <- map(f, read_csv)
l[[2]] # courses l[[3]] # student assessment l[[4]] # student info l[[5]] # student registration l[[6]] # student interactions
l[[5]] %>% count(id_student) l[[5]] %>% count(id_student, code_module, code_presentation)
l[[2]] %>% count(code_module, code_presentation)
l[[2]] %>% count(id_assessment) # some assessments apparently not taken l[[2]] %>% count(id_assessment)
l[[5]] %>% count(id_site) l[[5]] %>% count(id_site)
l[[2]] %>% count(id_assessment)
students <- l[[4]] %>% # student info left_join(l[[2]]) %>% # courses left_join(l[[5]])
assessments <- l[[6]] %>% left_join(l[[1]])
interactions <- l[[6]] %>% left_join(l[[7]]) %>% left_join(l[[2]])
students %>% write_csv(“students.csv”) interactions %>% write_csv(“oulad-interactions.csv”) assessments %>% write_csv(“students-assessments.csv”)
students_ss <- students %>% select(gender, highest_education, num_of_prev_attempts, disability, final_result, age_band, studied_credits)
students %>% View()
assessments %>% count(assessment_type)
l[[1]] %>% count(code_module, code_presentation, assessment_type) %>% View()
assessments %>% filter(assessment_type == “Exam”)
interactions %>% group_by(assessment_type) %>% summarize(mean = mean(sum_click), n = n()) %>% arrange(desc(mean))
#Extending the model students <- students%>% mutate(days_before_start = as.numeric(date - date_registration)) # Fit previous model previous_model <- glm(final_result ~ gender + highest_education + num_of_prev_attempts + disability + age_band + studied_credits, data = students, family)
new_model <- glm(final_result ~ gender + highest_education + num_of_prev_attempts + disability + age_band + studied_credits + days_before_start, data = students, family = binomial)
previous_model_accuracy <- predict(previous_model, type = “response”) new_model_accuracy <- predict(new_model, type = “response”)
summary(previous_model_accuracy) summary(new_model_accuracy) }
Previous results: The initial results show that there is a correlation between our model and prediciton.
New results: The new results also show that there is a high corrrelation betweeen our model and prediction.
How does the accuracy of this new model compare? Add a few reflections below: While the new model shows that there is high accuracy, it is not significantly improved from our last model. This might mean that the new variable we added did not play a large factor.
Part A: Please refer back to Breiman’s (2001) article for these three questions.
Part B:
Part C: Use the institutional library (e.g. NU Library), Google Scholar or search engine to locate a research article, presentation, or resource that applies machine learning to an educational context aligned with your research interests. More specifically, locate a machine learning study that involves making predictions.
Provide an APA citation for your selected study.
What research questions were the authors of this study trying to address and why did they consider these questions important?
What were the results of these analyses?
Complete the following steps to knit and publish your work:
First, change the name of the author: in the YAML
header at the very top of this document to your name. The YAML
header controls the style and feel for knitted document but doesn’t
actually display in the final output.
Next, click the knit button in the toolbar above to “knit” your R Markdown document to a HTML file that will be saved in your R Project folder. You should see a formatted webpage appear in your Viewer tab in the lower right pan or in a new browser window. Let your instructor know if you run into any issues with knitting.
Finally, publish your webpage on Rpubs by clicking the “Publish” button located in the Viewer Pane after you knit your document.
Congratulations, you’ve completed your first badge activity! To receive credit for this assignment and earn your first official Lab Badge, submit the link on Blackboard and share with your instructor.
Once your instructor has checked your link, you will be provided a physical version of the badge below!
