Last active
March 31, 2017 04:30
-
-
Save tomca32/693d6a47d1be2411ed955ccef8b2f90b to your computer and use it in GitHub Desktop.
Naive Regression Params Mapping
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
# 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