14 Answers
New AnswerGreat job! You finished Module 4, Decision Tree Model, of our Machine Learning course! For additional practice, try this code coach challenge https://sololearn.com/coach/103
It is code coach 103 machine learning. My code bits 52. Answer is oké. Test case #3,4,5. ???
It concerns gini impurity. Input: 1 0 1 0 1 0. Suppose: 1 = 0.5. Suppose: 0 = 0. Gini = 1 - (0.5) ^ 2 + (0) ^ 2 + (0.5) ^ 2 etc. Gini = 1 - 0.75 Gini = 0.25
Made this...although it does do what you original wanted...not sure if it's still relevant after seeing your last post:- # this changes "1 0 1 0 1 0" to "1 1 1 0 1 0" stringlist = list(''.join("1 0 1 0 1 0".replace(' ', ''))) stringlist[1] = "1" mystring = ' '.join(stringlist) print(mystring)
Sololearn Inc.
535 Mission Street, Suite 1591Send us a message