We're actively looking for ideas on how to improve Weekly Challenges and would love to hear what you think!Submit Feedback
Sadly our IT has not installed us the Predictive Tools at the moment but i wanted to see if i can do the same in Python. I have to say my solution is done without spending too much work so it could be done much better. Hopefully when we get the Tools i can compare both ways.
I missed the hints in the description so I could have handled this better, but still...
#set threshold for 1 person that can reasonably be expected to be >.9 or <.5
z <- qnorm(0.9995)
#generate normally distributed data where 99.9% of samples are between .5 and .9
Score <- rnorm(1000, mean=0.7, sd=(0.2/z))
#reset values below 0.5 to 0.5 and above 0.9 to 0.9
Score <- ifelse(Score < 0.5, 0.5, Score)
Score <- ifelse(Score > 0.9, 0.9, Score)
#ensure the dataset is 1 column with 1000 rows (from 1 vector to 1 dataframe)
Score <- data.frame(Score)
#write to Alteryx