This lesson summarizes the topics we'll be covering in section 06 and why they'll be important to you as a data scientist.
You will be able to:
- Understand and explain what is covered in this section
- Understand and explain why the section will help you to become a data scientist
From the start of this course, you've been surrounded by objects and "Object Oriented Programming" (OOP)! In an earlier lesson, we talked very briefly about objects in Python when we introduced built in functions and methods, and many times when you use a data science library, you'll find that it was written and should be used in an "Object Oriented" way.
While it may not seem immediately applicable to predicting values or categories or creating clusters, a strong foundation in OOP will put you in a much better position to use and write code in a way that'll be easy to read, use and test, so please work your way through this content carefully. The concepts introduced will continue to be of value to you throughout your data science career!
We start with a brief intorduction to Object Oriented Programming.
We then dig into the difference between classes (a kind of thing) and instances (a particular thing). We might have a Person class which identifies the behaviors of people in general, but we create (instantiate) an instance of the class for a particular person - Ann or Fred or Bill.
From there we dig into instance methods which are actions (methods) you can call on a particular object (e.g. bill.speak()
) and variables (like bill.age
to see how old he is). We also dig into the principle of "self" in OO Python.
Finally, we learn about and practice the use of methods for accessing instance variables to improve the robustness and flexibility of our code.
In this section, we'll start to provide you with a solid introduction to Object Oriented Programming which you will find useful whenever you're writing code.