As you make changes to your code, it is important to consistently test to ensure that your code does not break. If you do not write tests, you may not notice errors in your code. In this video, learn how to write tests in your programs.
- [Instructor] Another common mistake … when working with data is not writing tests. … As you make changes to your code, … it's important to consistently test … to ensure that your code does not break. … If you do not write tests, … you may not notice errors in your code, … and you may produce bad output, … which can negatively affect decisions that are made from it. … I'll be walking through an example … to illustrate what happens when tests are not written … and to share my approach for writing tests. … Let's say I have a dataset containing students grades … for five exams, … and the students' instructor has the following two policies: … one, each student's lowest exam grade gets dropped … at the end of the term when determining final grades, … and two, when a student misses an exam, … the instructor marks the student's grade for that exam … as missing in their records but treats missing exam grades … as zeroes when calculating final grades. … Now, say I wanted to identify the lowest grade …
Skill Level Intermediate
1. Avoid Mistakes in Coding Practices
2. Avoid Mistakes in Structuring Code
3. Avoid Mistakes in Handling Data
4. Avoid Mistakes in Machine Learning
Using redundant features1m 45s
Get started with Python1m 7s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.