PYTHON && POETRY | 100 Days of Code 16

Daniel Bourke documents days 95-98 of his coding challenge, finishing CS50's HTTP module and working through linear regression with gradient descent. He explains Python's if name == "main" guard, outlines his self-designed AI master's roadmap using fast.ai and Andrew Ng's courses, and shares his first slam-poetry performance.
Chapters
What's going on, y'all? Day 95 of the 100 Days of Code series. I just had a cold shower, that's why my hair's wet. I got my favorite combination here, check it out. Or one of my favorite combinations. Pu-erh tea, coconut oil on top. Actually, this has got a bit of a, uh, herbal maté, uh, Japanese green tea in there as well. Soda water and CS50. So about halfway through the, the week 6 lecture. Which is on HTTP, which is a web— the web protocol, Hypertext Transfer Protocol, I think. Did I just remember what HTTP stands for? Whoa. And my puppies are having a war, of course. Um, but no, today I'm studying CS50. I'm gonna finish week 6 lectures, uh, and yeah, it's on— I'm actually excited because before CS50 was about the C language, which is not really sort of— I know it's important for me to understand sort of some of it, but it wasn't really relevant to what I'm trying to learn, which is sort of deep learning artificial intelligence. Well, let me rephrase that. See, I'm just not familiar with C language, so it was a bit harder to learn, a bit harder to understand. Whereas I'm up to the web now, which is something more I understand, but I'm also learning a lot about how the internet works, different ports, different protocols, et cetera, et cetera. But I'll check back in once I've learned a bit more. And yeah, later this week I'm gonna be doing Data Science to Udacity. And Andrew Ng's deep learning specialization starts on Coursera this week, so I might be checking that out as well. But we'll focus on one day at a time. So I just finished week 6 of CS50, which was all about HTTP. So we got HTML, CSS, HTTP, TCP/IP, Internet Primer, all about the internet generally. And it was pretty much like the 3 or a few protocol languages and a few protocols themselves condensed into a week's worth of lectures, whereas the lectures on C programming were about 5 weeks long. And so of course there's a lot more to the internet than just HTML, CSS, and then a bunch of protocols, but this is just really scratching the surface. But I'm really liking it because it's sort of relevant to what I've learned in the past. And I think when you're learning sort of things you, I don't know, haven't learned before or haven't gone over before, like it was me with C, which is why I didn't prefer it as much because I just wasn't as familiar with it as I was with HTML, CSS, different web protocols. So, got some notes here in Evernote, got some port numbers, whatnot, just a few, few bits. I like this picture actually. This is what connects you to the internet. You, you go through a DHCP server, DNS server, which converts like IP addresses to things like google.com, access point, which is like your router to the internet, which is of course full of cats. So I tick off week 7. This is my Trello board, by the way. I'll link it in the description of creating my own data science masters in artificial intelligence. As you can see, I'm doing a few things at once here. Udacity Intro to Data Science course, CS50, reading a book on deep learning. Supposed to read this paper about 3, 4, almost a month ago now. Been, been slack on that one. But here are some things I'm going to be doing in the future. So we've got Python for data science. These all may change as well. This is the only real one here. And that should be starting on September 1st. But that's it for coding today. I'm gonna go take a nap and then write about what I did today and put it on the Medium series. So check it out in the description. See you tomorrow. So day 96 of the 100 Days of Code series. And as you can see, I'm up to problem set 3, analyzing subway data on the Udacity Intro to Data Science course, aka assignment 3. So I've gotta work through these. That's gonna be my goal for the rest of today. It's about 2:00 PM. So we'll see how far I can get through this. But learning all about data science today, uh, linear regression, gradient descent in Python, whatnot. Uh, we're still working through the Intro to Data Science course on Udacity, keeping my, getting my Python skills up to scratch and getting my statistical analysis skills and data analysis skills because that's what artificial intelligence is to me at the moment is just, uh, really advanced data analysis and creating these models that are able to make predictions based off a whole bunch of data. Unsupervised learning and semi-supervised learning aren't up to scratch yet in terms of what supervised learning can do, but definitely in the future as computing power gets higher and higher and as these models get better and better, that'll be something to watch in the future. But another thing I want to show you, and I'll link it in the description as well, is— you may not or may have heard of this before— fast.ai. So it's another free course on neural networks, deep learning, practical deep learning for coders. Two-part course, and there's even a textbook now as well. Oh, sorry, that's for linear algebra. But their mission is to make deep learning accessible to all, and their courses are free online. Check it out. There's so much resource, so many resources, sorry. So that's another thing I'm going to keep in mind. I didn't even know about this one. I only learned about it after researching Andrew Ng's new course, deeplearning.ai, which I'm going to do as well. So maybe fast.ai is something I can add into the mix of my own data science slash artificial intelligence master's degree. So much to learn, guys. Leave a comment in the description, actually, sorry, leave a comment below if you have any course you want to recommend to other people. But these are the two of the best I've found so far. And if you've done them before, shoot me an email at daniel@mrdbourke.com. I'd love to hear your results or even post a comment below. But I'm going to get into this assignment and I'll check back in with my results in a couple hours or so. I think I just finished assignment 3 of the Udacity Intro to Data Science course. I used the statsmodels.api and the ordinary least squares linear regression model to get a better R-squared value. See, mine there is 0.03 compared to the 0.4 R-squared value achieved with gradient descent. That's pretty cool, and I only just learned about the ordinary least squares test just then. I'll give you a bit of intuition behind it, see if I can explain this, because I'm trying to still get my head around it myself. So if you imagine you've got a graph here, the ordinary least squares test works off calculating the distance between this point and the line. And does it for each, each and every point. So this distance, distance, that distance, that distance, that distance, and does it for every single point and then squares the sum of them. And the smaller the number, the better, I believe. Let me just read this. The smaller the sum of the squared vertical distances between each data point in the set and the corresponding point on the regression line, the better the model. So apparently that works better for this dataset than gradient descent. I'm not entirely sure of the differences between the two at the moment. I think gradient descent tries to get to the lowest point on the graph. That's, that's my sort of visualization of gradient descent. I still don't fundamentally understand each model yet, but let's check it out. See if I finish the Intro to Data Science assignment tree. Will I pass? Try again! Okay, this clip is, uh, is wasted. Nah, I'm kidding. I'll be back. I found my mistake. I didn't read this line: R-squared value is 0.4 or greater. I got confused. I thought a lower R-squared value was better than a bigger value, but no, you want an R-squared value as close to 1 as possible. Let's do this. I fixed it. So I'm trying to predict here the number of entries into a subway station. So entries hourly, uh, with the x value, with the parameters rain, fog, mean temp, hour, precip— precipitation, uh, and I added this one parameter here, exits. So that makes sense, predicting the number of entries into a subway using these parameters. So my R-squared value is now 0.55, still not the best. So the model could be improved more, but I'll leave it at this for now. But it makes sense that adding the number of exits as a parameter to predict the number of entries improved the model substantially. So that was 0.331 something now, or no, 0.03, and now it's over 0.5. So yeah, Makes sense. Exits correlated with entries, or you'd hope that the number of people exiting the subway is at least on par with the number of people entering it. Otherwise it's going to get clogged, right? So that's it for Assignment 3. I'm going to go get something to eat. I need to do some shopping actually. And then have a nap because that's enough coding for today. Just finished week 7 of the CS50 course. It was on machine learning, and so things like search engines, image recognition, voice recognition, natural language processing, and just a few notes here on what's, what's going on. There's actually a cool story there about Tesla's Autopilot and the technologies it's using, machine learning. So I really enjoyed this lecture, actually. It was a a brief introduction to machine learning, but I've sort of learned through Coursera and the deep learning course I've been doing on Udacity and whatnot, or I've graduated from recently, more in-depth stuff on machine learning. So it was good to sort of have another point of view from an introductionary, no, introductory, intro level. Let's just say that, intro level, introductory level. There we go. I got it right. But next week— oh, well, not next week. Well, the next time I do CS50, it's going to be week 8 on Python. So I'm excited for that because that's the language of choice I've been using for. Otherwise, check out my drawing of a horse. This is just a bit of note-taking from the lecture. That is supposed to be a horse. It looks like a sort of a duck/hot dog thing. Image classification. This is essentially how image classification works. You've got an image here. Machine learning algorithm that's fed training data. This should really be going into the algorithm and then you get it out and it's got it labeled with a horse. Listen, I'm going to do a little bit of coding today. I'm done for the day. I'm going to practice my poem that I'm doing because I'm going to a poetry slam event and hopefully there's space for me to get on and throw down my 2 minutes. I've never done it before and I'm kind of scared, so it should be a good experience. If I can film any of it, I'll put it on my YouTube, but otherwise we will see you tomorrow.
What's going on everyone?
Daniel Bourke. If anyone's seen 22 Jump Street, I'm just going to mimic exactly— no, I'm kidding. I'm kidding.
I've got my hair in a— sim! Um, you know, when I look in the mirror, I'm trying to figure out what I'm hearing.
What's my face trying to say?
What excuse is it making for not letting me be who I may?
So this is a note to face.
Dear face, we're in this together. You translate my thoughts into what others see, but you're not always honest. You're like a protective mother to a freshly laid nest, and supposedly, you're the one who knows best. So why then do you keep changing colour every time we put ourselves out there? Or when we talk to a future lover? See, we're in this together.
What do you see when you look in the mirror?
Is it not just you and I? Not him, not her, not that guy. So why pretend that this life is anything other than single player? Remember, we're in this together. And look, you know, I get it. You're trying to protect me. Even writing this down, you're scared. You don't want to show them. How does it sound? And see, I'm tired of playing these games. Isn't there something else we can play? You know, I was never good at playing Guess Who? Because after all, you are me and I am you. Eyo!
Day 98 of the 100 Days of Code series and it is August 17th, 2017. I hope I got that right. I didn't check the date, but I'm pretty sure it's day 98. Anyway, if I edited this video correctly, you should have just seen, which I'll make sure I did, my first slam poetry event. I forgot a whole verse even though I practiced it for— practiced the poem and had it nailed like 12 times at least. It was a cool event. I've had experience public speaking before, but that was something new. I was sort of throughout the week beforehand facing resistance, which is like sort of procrastinating on doing it because I was kind of scared to go up in front of a crowd I'd never seen before. But nonetheless, proud of my efforts. And today I spent on CS50 learning some Python. I just finished week 8, so you can see here. Up to week 9, SQL. I'm going to leave that for tomorrow though, or another time. So yeah, Python was one of my favorite modules so far because it has been on C and a bit of web development, and Python is probably the language that I know best. So not too many notes on Python today, just a bit of— I don't know, I learned about this function actually, the if name equals main, main. And so that calls your main function. And so what does that mean? If you had a program that was like 200 lines long and instead of running it from top to bottom, you wanted to run the main function, which is like at line 150, let's say. If you put that if name equals main at the bottom of your program, the main function will run first and then everything else will run from top to bottom. So that's a fun fact. I've been learning Python for about 5, almost 6 months now. Maybe a bit less, I'm not sure. And I didn't know what the main, what that line meant. Well, I sort of knew but didn't know. And I'm still learning about classes and objects and stuff like that. It's good to sort of go back to a fundamental introductory to Python rather than learning the high-level stuff that I'm doing in terms of data science and deep learning and whatnot to really nail down the fundamentals and so I can implement them in the future. But I'm gonna go eat. Some breakfast, or not breakfast, but like an afternoon meal, uh, cooking a pancake apiece, which is practically breakfast. I got a video on that actually, how I cook it, so I'll put that in the description as well. But we'll see you tomorrow. Not sure what I'm going to be working on, but catch you then.
More from Daniel

Small Language Models (SLMs) Are the Future: Fine-Tuning AI That Runs on Your iPhone

Introducing Sunny - A MedGemma-Powered Skin Health Tracking App (Kaggle Competition Entry)

Benchmarking: NVIDIA DGX Spark & NVIDIA RTX 4090 | Part 4 - Comparing the results

Benchmarking: NVIDIA DGX Spark & NVIDIA RTX 4090 | Part 3 - Running LLMs on the RTX 4090

Benchmarking: NVIDIA DGX Spark & NVIDIA RTX 4090 | Part 2 - Formalizing the tests

Benchmarking: NVIDIA DGX Spark & NVIDIA RTX 4090 | Part 1 - Creating a series of tests

Local Multimodal RAG on the NVIDIA DGX Spark | Part 4 - Publishing our demo to Hugging Face

Local Multimodal RAG on the NVIDIA DGX Spark | Part 3 - Putting it all together


