I am in the last graded cell of Week 4 after which I will be certified.
I have to say that class materials of Week 4 were highly visual and with minimal - most of the times absent - instructions of how to code and program decision trees and that’s why this section demands extremely high instinct of programming not seen in the lectures.
How come?
As a final attempt to match previous code with this assignment, here I’m baffled and confused on the assignment’s points where not even ChatGPT has a clear answer. We are asked to iterate through the features and calculate the information for each feature.
This specialisation of courses is focused on Machine Learning, not a Python programming course, and it does require some understanding of Python and programming skills. I can understanding your frustration. It might be helpful if you take a look at some python programming courses at Coursera and to get up to speed with Python alongside with doing the MLS courses.
In regards to the error you have encountered. Firstly, the original code should be:
max_info_gain = 0
but somehow, you have changed that to max_info_gain = -1.
Secondly, the line of code:
max_info_gain >= 0
is not correct, because, you are checking the variable max_info_gain is greater or equal to 0, but max_info_gain has not been defined before this line, so the unboundLocalError is raised.
I have graduated and excelled from 5 Python Courses in DataCamp and I enjoyed it.
I have saved all class commands in Jupyter Notebooks in Anaconda and every once in a while that I need revisions, I need 2 days to re-hit all commands in the platform. I didn’t respond out of frustration but out of high standards that if not accomplished effectively, I’m getting lost in labyrinths which are not my specialty.
For example, the previous discussions we had with APIs, or trying to recall the monotony of entropy in terms of this discussion. I need this knowledge to apply it in my projects first of all, not discussing all the different extensions of theory without solving the problem.
At the beginning of this assignment I tried to write down the formation of this decision tree problem and basic functions, cos the visualization of how we pass from the decision tree represented visually to Python commands is not easy. That’s why we say that machine learning specialists need to work hand in hand with the physical problem at hand.
Even then,when you get stuck or your head becomes a boiling cauldron with math and programming, I may forget what I know very well already. Furthermore, in Python classes I studied commands way beyond the scopes of this course.
Conclusively, I evaluate this discussion of us as an attempt not to decide what I know or not, but to read between the lines.
Thanks to all of you for the support! I have attached my certificates!
If I may say so, you have got the wrong end of the stick in your conclusion. If there is any solace that I can offer, please bear in mind that all the community members apart from the staff, are volunteers, offering their time, knowledge, experiences and dedication free of charge, with the purpose of giving back and help build a vibrant learning hub.
These courses are not personalised. If you have any suggestion to improve the content, then, please raise your suggestions. Community member can only answer your query based on your question and the information given to help you move forward, but they are not there solely to dish out answer for you to copy - that is why it is a violation of the code of conduct to post assignment code on the forums.
If not, use your Python knowledge to look at the error you got on your second attempt:
local variable 'max_info_gain' referenced before assignment
and look at the line that error is referring to see if you can find the error you made when trying to follow the suggestion from @wai_yar_aung111 after your initial question.