This file contains 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
# Fixed Choice Design Lunchtime Simulation | |
# 2019-02-06 | |
library(igraph) | |
library(dplyr) | |
library(ggplot2) | |
#Experimental Conditions | |
conds <- expand.grid( | |
c(150), |
This file contains 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
# Multinomial Logit Model vs Random Forest | |
# Predicting College Major from Items | |
library(data.table) # For fread function (v fast!) | |
library(dplyr) # For pre-processing | |
library(tm) # For cleaning text / pre-processing | |
library(nnet) #for MNL | |
library(randomForest) #For rf | |
# Helper function for making training / testing sets. | |
outersect <- function(x, y) { |
This file contains 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
# Multinomial Logit Model vs Random Forest | |
# Predicting College Major from Items | |
library(data.table) # For fread function (v fast!) | |
library(dplyr) # For pre-processing | |
library(tm) # For cleaning text / pre-processing | |
library(nnet) #for MNL | |
library(randomForest) #For rf | |
# Helper function for making training / testing sets. | |
outersect <- function(x, y) { |
This file contains 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
# Multinomial Logit Model vs Random Forest | |
# Predicting College Major from Items | |
library(data.table) # For fread function (v fast!) | |
library(dplyr) # For pre-processing | |
library(tm) # For cleaning text / pre-processing | |
library(nnet) #for MNL | |
library(randomForest) #For rf | |
# Helper function for making training / testing sets. | |
outersect <- function(x, y) { |
This file contains 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
# Multinomial Logit Model vs Random Forest | |
# Predicting College Major from Items | |
library(data.table) # For fread function (v fast!) | |
library(dplyr) # For pre-processing | |
library(tm) # For cleaning text / pre-processing | |
library(nnet) #for MNL | |
library(randomForest) #For rf | |
# Helper function for making training / testing sets. | |
outersect <- function(x, y) { |
This file contains 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
# Generate Fake Data | |
fake_data <- sample(x = c(1:5), size = 100, replace = T) %>% | |
matrix(ncol = 10) | |
# We want to programmatically recode these. | |
# 5 to 1 (and vice versa) | |
# 4 to 2 (and vice versa) | |
recoding_function <- function(x){ |