kristianolesenlarsen / sdseml_online_exercises

Online exercise classes for the course "Social Data Science: Econometrics and Machine Learning"
11 stars 39 forks source link

Feedback Ex10: #23 #365

Closed kristianolesenlarsen closed 4 years ago

kristianolesenlarsen commented 4 years ago

@LJ-9 (please reply to this issue when you have read your feedback)

The warmup Looks alright, but you dont need the inner loop over c's instead if a,b can form a pythagorean triple they do so with c=sqrt(a^2 + b^2) and c will be integer. Also in your solution you dont get all triples with a,b< 10000 because you limit your search to c<10000, but c is the longest side in the triangle. In fact you would need to search up to around sqrt(2*10000^2). In summary it is much better to exploit that c=sqrt(a^2 + b^2) being an integer is equivalent with a,b,c being a triple.

The exercises Looks very good! Instead of using the louvain method from the writeup you could also have plotted the network in which case the optimal clustering would be very apparent.

Score: 1

LJ-9 commented 4 years ago

Great, thank you for your feedback! :-)