This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
acc.email, | |
a1.program_user_id, | |
a1.assessment_id AS initial_assessment_id, | |
a2.assessment_id AS retake_assessment_id, | |
s1.statement_id AS statement_id, | |
FROM assessments a1 | |
JOIN assessments a2 ON a2.program_user_id = a1.program_user_id | |
JOIN scores s1 ON s1.assessment_id = a1.assessment_id | |
JOIN scores s2 ON s2.assessment_id = a2.assessment_id |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
get_recommendation_ratings <- function(rating_file_path) { | |
# Read user ID, item ID, user preference CSV data | |
ratings <- read.csv(file = rating_file_path, header = FALSE, col.names = c('user', 'item', 'preference')) | |
# Create item co-occurrence matrix | |
co_occurrence_matrix <- crossprod(table(ratings[, c('user', 'item')])) | |
# Convert long format to wide format and replace NAs with 0s | |
user_ratings <- tidyr::spread(ratings, user, preference, fill = 0) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(readr) | |
library(dplyr) | |
url <- "https://archive.ics.uci.edu/ml/machine-learning-databases/wine-quality/winequality-white.csv" | |
df <- | |
read_delim(url, delim = ";") %>% | |
dplyr::mutate(taste = as.factor(ifelse(quality < 6, "bad", ifelse(quality > 6, "good", "average")))) %>% | |
dplyr::select(-quality) |