Skip to content

Instantly share code, notes, and snippets.

@tomca32
Last active March 31, 2017 04:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tomca32/693d6a47d1be2411ed955ccef8b2f90b to your computer and use it in GitHub Desktop.
Save tomca32/693d6a47d1be2411ed955ccef8b2f90b to your computer and use it in GitHub Desktop.
Naive Regression Params Mapping
# I'm just showing the naive way to do the mapping between skills and ther respective regression params.
# I'm ignoring getting the actual values from the DB, rendering HTML, and all other stuff that goes into this
skill_regression_params = {
memorization: {t1: 0.059758, t2: -0.00076, t3: some_number, t4: some_other_number},
grit: {t1: 0.039758, t2: -0.00236, t3: some_number, t4: some_other_number}
# ... etc for all skills
}
def skill_regression
Skill.all.each do |skill|
do_regression(skill_regression_params[skill.skill_name.downcase])
end
end
def do_regression(regression_params)
# calculation happens here
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment