+21

# Edit binary numbers.

A matter. Input binary with spaces. For example: 1 0 1 0 1 0 and then edit the numbers individually. Suppose I want to give the value 1 a different value.

5/23/2020 4:43:19 PM

+3

Aad Hoogenboom Plz check it 👇👇👇 print(1-(sum([0.25 for i in (input()) if i=="1"])))

+20

Great 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

+17

Yes, nice. 👍👍

+16

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

+16

It is code coach 103 machine learning. My code bits 52. Answer is oké. Test case #3,4,5. ???

+2

+2

+1

Aad Hoogenboom Give an example of input & output

+1

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)

+1

Aad Hoogenboom could you please provide the coach text, since only pro users can see it

0

👍👌👌