#309: What ML Can Teach Us About Life: 7 Lessons Transcript
00:00 machine learning and data science are full of best practices and important workflows. Can we extrapolate these to our broader lives, Eugenia and I give it a shot on this slightly more philosophical episode of talk Python to me. This is Episode 309, recorded March 19 2021.
00:30 Welcome to talk Python, a weekly podcast on Python, the language, the libraries, the ecosystem, and the personalities. This is your host, Michael Kennedy. Follow me on Twitter where I'm @mkennedy, and keep up with the show and listen to past episodes at talk python.fm. And follow the show on Twitter via @talkPython. This episode is brought to you by 'Retool' and 'Linode' please check out what they're offering during their segments. It really helps support the show,
00:54 we'll be giving away 5 tickets to attend 'PyCon US 2021'. This conference is one of the primary sources of funding for the PSF. And it's going to be held may 14 to 15th. Online. And because it's online this year, it's open to anyone around the world. So we decided to run a contest to help people especially those who have never been part of 'PyCon' before attended this year, just visit a talk python.fm/pycon2021. And enter your email address. And you'll be in the running for an individual PyCon ticket complements of talk Python, these normally sell for about $100 each. And if you're certainly want to go I encourage you to visit the 'PyCon' website, get a ticket and that money will go to support the PSF and the Python community. Congratulations to Ron Lee. He went number three of the five tickets that were given away and there's still more chances to win. If you want to be in this drawing, just visit talk python.fm/py con2021. Enter your email address, you'll be in the running to win a ticket. Now let's get on to that interview. Eugene, welcome to talk Python to me. Thank you. Yeah, it's great to have you here. I love getting down into the details of programming and writing code and working with API's and building amazing things. But it's also really interesting to sort of step back and take a big picture view of the world of the software. And you wrote a really interesting article about applying some of the lessons you might learn from code back to your life. And I really enjoyed the idea of it. So I'm looking forward to talking to you about it on the show. Thank you happy to chat more about that as well. Yeah, it's gonna be super fun. Now, before we get into the details of all that, you know, let's start with your story. How did you get into programming and Python, my degrees in psychology. So since then, I've been really interested in understanding you know, how people behave, why they think the way they think and how information changes their perceptions and behavior, you know, do this, I used to run experiments and analyze the data in 'SPSS' and 'Excel'. But eventually, the data just got bigger and bigger. So I moved on to R. And now I'm using Python. So that's how it happened. I mainly use Python, because I have problems to solve that require me to process data with Python. Yeah, really cool. One of my very first programming Jobs was at this incredibly cool place where it started as a research lab and then spun out of the university to a startup. And the whole premise of what they did was to use eye tracking, not some bone thing, but like, where you're looking to understand how people solve problems and how they think and so on. And it was mostly a bunch of PhD cognitive science folks. And they would work in 'MATLAB' and 'Excel' and all that stuff. And I would help write software that would take that stuff and turn it into products and turn it into automation and, and whatnot. It's a really interesting world. And there's a lot more opportunities for code and solving problems with code, especially on the data analysis side in psychology fully agree than you might first think, right? You think of psychology that's talking to people on the couch, like sometimes, but not always, not a lot of the time, right? A lot of it is running experiments. And like I'm sure they collected data by tracking any other process that they are and oh, yeah, that happens in real life as well. We run experiments, a B testing, and we have to analyze the data. Yeah, that was it. We would run tons of experiments, we would have maybe a week where 50 people came in, we'd have like one way mirrors and all sorts of recording equipment and like analyze that they even put ads, I think in Craigslist, all sorts of plays like hey, we need somebody to come like surf on these websites for half an hour. I'll pay you 50 bucks. Can you come do that during lunch? Be like yeah, I'll do that is really cool. Yeah, it was really fun. But it was really need to do the programming stuff there. So tell me a little bit more about that transition, because it must have been a little bit challenging, right? There's not a lot in your, like traditional education of psychology that teaches you programming, maybe a little bit but not a ton, right? No, actually, in my traditional education. For psychology, we use SPSS and our SPSS is this IBM product. Yeah, proprietary, so nothing about it. I didn't know a bit of about the statistics and you know how to work with data, but that's about it. So I think back then, when I first started getting my first job, I had to learn a lot of 'Python' and 'SQL' my own. And you know, there was the time when you know, 'Coursera' was available and 'Coursera 'is a lifesaver. You asked me I learned on my Python and data science stuff from 'Coursera'. So it was
05:00 After work spending one or two hours during the courses and doing the lessons, the hands on exercises were amazing. And today nowadays you have so much available Python resources to help you quickly pick up, get something working, iterate on something, fix the bugs and you know, have something that you can play with. And it just makes it so fun to learn Python now. Yeah, there's so much to know, in programming these days. But at the same time, there's so many resources out there to help you. It's really a huge benefit. I remember when 'MOOC's came on, as they call them, like these courses with many, many, many people in them. And it was such a revolution at the time. And now it's just one of the million options, you know? Yep. I agree. The I think 'MOOC's really the the great equalizer, I mean, Education is the great equalizer and 'MOOC's is by making it freely available across the internet with great educators can just teach anyone and not confined to a classroom. I think that was amazing. And that was what helped me transition from 'SPSS' and 'R' to Python and 'Spark' and 'Machine learning'. Yeah, it opened that door for me. Yeah, instead of studying neurons, you're studying neural networks now. Yeah. Nice. So how about now what do you do day to day, you just made a big life change. I was reading that you recently moved from 'Singapore' to 'Seattle'. That's a big change, even though not a whole lot in between those two things, if you draw a line, a lot of water, but yeah, it's still a big change in terms of jobs and whatnot. That's about that. So I think towards the end of 2019, I think maybe in the middle thing, I think my wife and I were thinking of, you know, stepping out of our comfort zone. I don't know how many of your listeners have been to Singapore. But it's a beautiful place. It's a very comfortable, tiny island. Amazing weather. We thought, you know, we like to travel. So we thought, No, let's try live somewhere for a bit. So we looked at a couple of pieces about a couple of pickups, Seattle, San Francisco, Berlin, Shanghai, and it so happens that I got an offer from 'Amazon'. Nice. Yeah. So that's why I'm now I'm an applied scientist at 'Amazon'. And so what I do, I'm part of the 'Kindle' team. So why do we my day to day job is I try to help people read more. And we try to do this by helping them find books that they need to find. So what I do is I work on recommendation engines, try to help people you know, as you're finding a book, or based on what you have read to the extent that you have read it, we know this because we have Kindle data, we know how much of a book you have completed, we can recommend you new books that you might be interested in, or based on what you browse on a website, we can have the recommendations in real time, and recommend new new books as well. So that's what I do in my day to day job. Yeah, well, that sounds really fun. I actually really appreciate that from Amazon, specifically around the Kindle, to be honest, like, a lot of stores are like, Oh, you might also like that. I'm like, No, I don't also like that. I really don't care. You know, there's just so many things where I'm shopping online, or whatever. And it just doesn't make sense. But specifically for kindle, I'll be reading a book to say, hey, you should also check out these other ones. Like, a lot of times, like my next book is out of that list. I really love it. So can't go browse a bookstore these days. I mean, we have a fantastic bookstore called 'Powell's'. It's like one of the largest bookstores around here in Portland. But you can't even go to it anymore. So yeah, it's pretty cool. Thanks for that. Good luck there, you and your folks, I'm happy to hear that. And this is a great place where what I'm doing is very aligned with what I do, which is trying to help people very aligned with my values, which is trying to help people learn more by reading more books. So that's great. Yeah, absolutely. And you talk a lot about writing. And well, I guess not just talk, you also put your time and energy, where your words are right, you do a lot of writing. And the reason that I wanted to talk to you about have you on the show, like I said is one of these articles that you wrote, but there's a whole bunch of them that you have. So there's a couple of people who are really successful in the tech field that I can think of who really make writing an important part of what they're doing. Like I had Jesse Davis on the podcast at the time. He's from MongoDB. I think he still is, anyway, he talks about like all these design patterns of technical writing, right? Like, here's the How to here's the first different and like all these really interesting things, and I kind of get that vibe from you as well. Like you got these really strong ideas about writing and how it reinforces your programming side of the world. What's your thoughts on that? Well, I guess maybe just to share a bit of backstory about why I started writing so much, I think, yeah, a couple of years ago, I was interviewing a couple of mentors, informal mentors, right. They didn't know I was getting them to be a mentor. But I would just reach out to people were to the three steps ahead of me paid off the assigned CTOs leader scientists have asked me know, I would ask them the same question what makes an effective data scientists? And I would say, you know, is it understanding the business domain deeply? Or is it PhD research level skills, Ninja hacking skills, 'Python' or 'c++' or 'Java'? And a lot of them said, actually, you know, all that is really important. But there's one thing that you're missing out and this one thing is transferable across all your your entire career. And that one thing that said is communication at that point, I'm, I didn't believe it. I was immature. I didn't think it was I didn't think it makes sense. But I thought so many of these people tried it. I owe it to them to so many of these people mentioned I owe it to them to try and update my progress. So for one year, I said I'm just going to volunteer for whatever writing opportunity whatever speaking opportunity the company has done I started writing about my side projects as
10:00 writing an internal company newsletter to share about what our team our data science team was doing. And I started speaking at conferences and meetups. And so that's why I've been started writing. And since then I found that writing actually helps me learn a lot, because I will write about something and I realize, Hey, no, I don't know anything about the state I'm writing about. Yeah, exactly. You think, you know, you've learned enough to sort of have some thoughts or, you know, in the programming space, you can maybe get something to work, right. But if you've got to explain it, all of a sudden, it's not enough to know Well, there's two ways. And I'll just use that way, you've got to know Well, here's the two ways. What are the trade offs? When should I use wage like, you got to dive into these sorts of details when you're either writing or speaking or presenting about it? And it could just forces you another level down in your understanding in depth? right? Exactly. Writing is really difficult and tricky, too. I think a lot of people say, you know, you must really love writing No, actually, I don't really love writing, which is a bit weird. I love learning. And I love sharing about what I've learned online, and writing is my vehicle to let me do that. So that's why I started writing. So why do I talk a lot about writing at work? or writing in general is there's this question, I asked myself a lot, I used to ask myself this question. And now, a lot of people ask me this question, you know, I said, Yes, I this is your job to write code, or is your job to write documents. And I used to think my job was to write code and build systems to help customers by then, as I'm doing this more, I find that hey, you know, a lot of times before writing code, I need to spend a lot of time thinking, researching and designing. And the medium of that work is writing documents. That's why I encourage a lot of people, you know, it's just like what you said, Do I serve my recommendations by our 'Redis Cache' of our 'Lambda API gateway', or whatever. And I'm thinking through all these designs, and I need to make trade offs and writing in a document, the pros and cons. And the rationale for decision forces me to do that. So that when we start implementing things, we don't do things the wrong way, which is really expensive, right? implementation is expensive. So that's why and I find that he has really helped me a lot. I don't feel that enough people talk about it. And I want to encourage people to write a lot. So Well, yeah, I agree. And it seems to me like one of the fundamental jobs of a data scientists, at least one branch of data science is to take the raw information, think about it, and then communicate what it means, right? And that seems to go really hand in hand with what you're saying, exactly. I think I was doing this one year of writing and speaking practice, right at work. And then in the past, I had people come up to me and say that, you know, Eugene, every time I have a meeting with the data scientists on your team for half an hour, and then I work with not knowing anything, I don't know what they spoke about. And that's because I think by and large, most people, you know, we tend to use jargon, like 'AUC', 'ROC' 'Distributor' all that area, assume their business people know it, but I made this mistake as well. And then one day, I had a great boss who brought me aside, you know, Eugene, the way you're communicating, no one understands you and asked, What do you mean, and he gave me very good feedback, he was a great boss, and I started changing how I communicate things. And that made me a lot more effective at work. So that's how I get started on that. Fantastic. Well, I really like what you've done with the writing and stuff. And so maybe let's spend some time diving into the one that I think is probably the centerpiece of what we'll talk about, we'll touch on a few other ones, because you do a really good job in your writing, of not just putting down your thoughts, but bringing other people's ideas and influences in there. So you have a lot of quotes, you have a lot of references to other things, and so on. So I really like the way the style. So let's talk about your article, 'What machine learning can teach us about life-7 lessons', why did you write this? Because when I was writing some of my previous articles, okay, this is an odd thing. I know that my audience, Machine Learning practitioners, and you know, sometimes I write about things that sometimes I want to write about things that I know will not interest them. So this is one of those I like to write about life lessons. Right. And I know they were not interested in but I think it's really important. I want to write about that anyway. So you know, in order to sneak it in, in this case, machine learning is really just a Trojan horse. Yeah, machine learning is a Trojan horse where I sneak in this life lessons that I found really helpful for me. And I just upon some reflection, I just want to write about it. And that's it. That's how this article came about. Interesting. I love these Trojan horse ideas like I'm going to teach you do something final actually had a lesson. Right? And now the secret's out. Yeah, I haven't actually shared that with anyone. Now they're gonna know That's right.
14:24 This portion of talk Python is brought to you by 'Retool', do you really need a full dev team to build that simple internal app at your company? I'm talking about those Back Office apps. The tool your customer service team uses to access your database, that 's3' uploader you built last year for the marketing team, the 'Quick Admin' panel that lets you monitor 'key KPI's, or maybe even the tool your Data Science team hacked together so they could provide 'custom Adspend insights'. Literally every type of business relies on these internal tools. But not many engineers love building these tools, let alone get excited about maintaining or supporting them over time. They eventually fall into the please
15:00 Don't touch it. It's working category of apps. And here's where 'Retool' comes in. Companies like 'DoorDash, 'Brex'. 'Plaid' and even 'Amazon' use 'Retool' to build internal tools super fast. Ideas them. Almost all internal tools look the same forms over data. They're made up of tables, dropdowns, buttons, text input, and so on. retool gives you a point, click and drag and drop interface that makes it super simple to build internal UI like this in hours, not days. 'Retool' can connect to any 'Database' or API, want to pull data from 'Postgres'. Just write a 'SQL query' and drag the table onto your canvas. search across those fields. Add a search input bar and update your query. Save it share it super easy. 'Retool" is built by engineers explicitly for engineers. It can be set up to run on prem in about 15 minutes using 'Docker' or 'Kubernetes' or 'Heroku'. Get started with 'Retools' today. Just visit talk python.fm/retool or click the 'Retool' link in your podcast player show notes.
16:00 So let's get through the seven lessons. The first one here is 'Data cleaning', assess what you consume. And I'm a big fan of this idea as a life lesson as well. So what's the story? Wait, before you get into like every one of these lessons, you start by saying, okay, here's the 'Machine Learning', meaning. And then here's the sort of follow on lesson. Right? So what's the Machine learning lesson of 'Data Cleaning'? I think the machine learning lifelong communities, most machine learning practitioners would know when you use noisy data, your machine learning model is going to be noisy, and it's just not gonna work. I think there's this cliche garbage in garbage out in machine learning. Well, that is absolutely true. Yeah. And cleaning the data itself is actually most of the work in terms of training your model, cleaning data, refining it, making the model be able to learn from it. So that's really important in the machine learning world. Yeah, absolutely. You have a really interesting quote in here. And you also have some really fun pictures, which we can talk about where it is in here. It was Randy out shares, data cleaning, isn't the grunt work, it is the work, right? I think so many of these things in a lot of these machine learning. And like scientific programming sides, you have these amazing libraries, right? Like you can 'Pip install' 'TensorFlow' or whatever. And then you just feed the data, you know, got your data frame, you feed it over, boom, and like magic happens, right? You've got to get that data, you got to like format the data, you got to convert the data like that's, you got to understand that it's all correct, right. There's cool libraries, like great expectations that are like sort of unit tests for your data to make sure you don't feed in bad data and all that. But yeah, I mean, I agree with that statement a lot. That's pretty neat. Thank you. And I link to Randy hours post, which is very good post. I think he wrote that. Of course, I might be putting words into his mouth. But I think he wrote that because a lot of people think that their data preparation is not sexy. They're cleaning is just grunt work, but and he's trying to get people to remind people No, actually, it is the work it is what actually makes a big difference, your analysis outcomes in your machine learning outcomes, and I fully agree. Yeah, absolutely. All right. So life lesson from this one was the parallel life lesson you're trying to draw? Well, the main life lesson now I'm trying to draw is actually the one below that image. Okay. So you have a really fantastic image and you talk a little bit about food first, before you get into what I think is more important other food is not important. But we've all seen these horrible pictures of in like the 50s and 60s of doctors recommending cigarettes, like my doctor recommends Camel, not Marlboro, like oh my god, what is this? There's like this really similar one for sugar. Like all these, like, here's like, how do you you don't get overweight? You eat your sugar, so you don't eat fatty food? Oh my gosh. Anyway, so yeah, that's one is food, which is really interesting. But then more importantly, is news, right? And information. So if you could just screw up to the image, just in this image, right, we see that food is important and bad food actually makes you bad makes you an unhealthy by in this image. This image is both bad food and bad information. There's so much bad information out there on Twitter or on Facebook or social media. And you really have to be careful about what you consume. Right? misinformation. I mean, it is really easy to consume, you know, this small 200 character tweets, or you know, small, empty calorie, I'd call them empty calories on social media, you know, there's empty calorie info bites you call them. That's great. Yeah, there's some influencers who post really short things and you know, they just go viral. And if you consume a lot, they actually the thing about hey, did actually change my life. No, it's actually kind of empty calories. And a lot of good writers, David parral writes about this, it's like, you want your content to be very niche, very deep, very high nutrition. So I think that's the same thing. When you consume like content, you don't actually gain a lot, it can be actually downright toxic. A lot of times it's like content is just one statement. You're trying to sway information through the public. So I think for your own sake, curate what you consume. I agree. I mean, it's so important, and there's so many knock on effects, right. And it also has some interesting machine learning tie ins. I would say, here are some recommendation engines. Yes, definitely. I think maybe it's I'm not 100% sure about the attribution but I think Tony Robbins said you got to be the guardian of your own mind.
20:00 Right, you've got to consciously decide what you let in what thoughts you let influence you and what ones you just reject. And say, this doesn't matter, because definitely what you think can really affect you. But I was thinking even more like if I go on to YouTube, and I started to consume something that's a little kind of crummy, but whatever the very next thing is, you're never intense enough for YouTube. If you watch three videos on one topic, like, it's like, you need 100 more of these videos, right? It's just yeah, with a lot of social media. I don't use Facebook enough. But I can imagine it's similar. Like, as you start to trend even a little bit in one way or the other, it just throws you a huge rope and tries to pull you hard for the sake of engagement down that path into small curves. These days seem to matter a lot more like if you used to like grab, I don't know, some crummy newspaper, like a rumor a newspaper at the grocery store and read it, then you went back and you read the New York Times when you got home, The New York Times wouldn't just stop showing you the important news that would show you all sorts of junk because you read the what but nowadays, that's what happens. It's crazy. It is I think a lot of is because of just how machine learning works. If you click on something, then you read something, it thinks that you like that thing. And they recommend you more of that thing. Yeah, which sometimes it's just you miss click or something. And sometimes it's a mistake in this way, machine learning and social media can sort of polarize people, which is not what we want to do. So it really takes you need to be conscious about how you're affected by right. Obviously, your articles not about this, but we're gonna have to reckon with this as a society. Definitely Yes, period in a big way. But let's go on to Lesson number 2 'Low versus High signal data' and seeking to disconfirm an update, tell us about this one. So maybe I'll start with the machine expert for I think what this here is seperate vector machine. So you know, you're trying to separate the blue dots from the red dots. And you know, on the left most image, I mean, it's very easy to separate, right, so we can see the margin is very wide, the margin is the dashed line, the distance from the dashed line to the solid line, on the middle image, all of a sudden, we introduce a new red dot, and the margin becomes very narrow. So you know, your certainty is a lot less, and you start to think, Hey, no, maybe I'm lesser than, and then on the right, and then you start to collect more information, more data points around the around the end, and all of a sudden, your margin becomes a curved margin. So what you thought was true, and you were very certain about it, and the left side of the image now suddenly changes to the right, you get a little bit more information. And you're like, Oh, this is not the dividing line, or the distinction at all. It's totally more nuanced, or whatever. Yeah, exactly. So I know, I shouldn't be referring to the image, because it's the podcast. But I think the image is really powerful in terms of how in machine learning, you change your decision boundaries. And in real life, this is the same. I think, Jeff Bezos has a very powerful quote. This is, I think, something like this that says that I actually didn't put it here. But I'm just reminded of it that says that, you know, when data disagrees with anecdotes, he tends to prefer the anecdotes, because a lot of times, it sort of means that maybe you're measuring things wrongly. So data is very easy to collect, we have a lot of data. But where's anecdote is one or two of those feedback points that disagrees. And we sort of need to jump into and collect more data around it. So I think this is the same thing. And when you're asking for feedback, often people give you good feedback, you know, you're doing great, continuing what you're doing, you're doing fantastic. And when people give you bad feedback, they didn't do it. Right. That is a gift for you to improve, dig into it. Ask them hey, you know, I love what you just said, Can you give me more detail? And so it's giving you more detail more information? Or how you should be thinking how you should be designing how your code should change your code reviews, any helps you grow? Yeah, I think and especially in the US, people are very uncomfortable with negative feedback, both giving and receiving it. If it's given in the right way, it can be very valuable. I mean, maybe listening to like what people put on your YouTube video, that might not be all that constructive. There's a lot of weird just people with issues at scale. But I totally agree. And you know, some more closed space, right, like a code review or something, right? That's definitely an opportunity to learn something, even if the person is wrong, it's still an opportunity to, you know, learn their perspective, definitely and learn from it. Right. So one of the quotes you have in this section is by Karl Popper. True ignorance is not the absence of knowledge, but the refusal to acquire it. And I think that also goes hand in hand with the polarization and stuff you talked about before. I agree. I think that I adopt the growth mindset, I think that people can change and grow. And that's what's necessary, right? in our industry, right? Things change so fast. Yeah. So we have to try to keep up with the times in terms of the technology. I think, fundamentally, we should focus on the problems, but don't neglect how technology is changing as well. For sure. Alright. Number 3 'Explore exploit balance for the greater long term reward'. It has to do with reinforcement learning, right? Yeah. So in reinforcement learning, well, we can imagine that at a start. You don't know anything about the state of the world, right? Unless let's say you have to, this is an example for me. Let's say you have a restaurant that you love. And let's say you first land in Seattle, when I first landed in Seattle, I didn't know where to eat. I didn't know what was good. And I would explore many different restaurants, many different takeouts and After exploring after maybe I explored 10 of them, I found
25:00 Know, this place is great. It's cheap is nearby, the food is solid. And I would just exploit it all the time. Exactly like in my neighborhood. There's maybe two or three Thai food restaurants that I always go to. And somebody says, hey, let's get some Thai food. I'm not gonna go well, there's another one we haven't tried yet. That's good. It's just like, nope, that one's good. We'll go in here. You know what I mean? I am exactly like that. I'm such a lazy thinker. And I just like this is really good. It's my appetite. And it fits my tastes. And it's cheap. Why do we have to try something new, but thankfully, my wife is an explorer. So while I'm exploiting, she encourages me, you know, let's explore this new things. And sometimes I find treasure gems that I would never have tried, but because she's encouraging me to explore, I found it. Yeah, so that's a balance. So at the start of your career is that when you're trying to solve a new problem, explore, take some time to explore as much as you can. And then once you find it, exploit by your as you're exploiting, don't forget to also be exploring a bit. Yeah, so you tie this back to careers a lot about basically, as you sort of touched on continuous learning, and, you know, don't get too comfortable. And it just go with go just fall all the way into the exploiting side. Like, I went to college, I got my engineering degree, why do I need to learn 'Jupyter'? I'm just gonna keep using 'MATLAB' or 'Excel'. And we're just going to keep working on this building a bridge or whatever, right? Like, I think it's easy to do that I spent the time and the money and worked hard and got good grades and a four year degree, why do I need I'm done with tests and learning? I can just stop. Right? Exactly. I was just gonna say this exact same. A very similar example. I studied 'SPSS' and 'R' in college, why do I need to learn 'Python'? Right? Well, you know, Python has a lot of benefits is a lot faster. And then, you know, now that I learn Python, I know SQL, why do I need to learn 'SPARC'? But you know, if you explore it, it can really help you make your world a lot more effective. Maybe I know, decision trees and linear regressions, do I really need neural networks? But you know, it's always taking some time to explore about explore what might be new, sometimes some of this exploration doesn't work out. And that's fine. If you think from a learning perspective, you're learning a lot. But take the time to sample around every now and then. Yeah, absolutely. You have a couple of great quotes in here from a two people I find both of them very interesting. Navall Silicon Valley guy, which goes why navall Naval? And he has a really interesting tweet storm that turned into a podcast series and some interesting thinking, are you familiar? This? Oh, yes. I love that. Yeah, I do, too. Actually, I may read your articles and stuff and remind me that but he says your goal in life is to find out the people who need you the most to find out the businesses that need you the most to find the projects and the art that needs you the most. There's something out there for you. And then Matthew McConaughey talks about when he was going, he was in law school and decided to go into film school, which is obviously a big career switch somebody and he's like, No, no, I have to do this, right. And he was afraid of what his dad would say. And instead of saying you thrown away your career or whatever, he just said, don't have asset like if you're going to do this, you better go do it. Right. So that's sort of the Naval is the Explore McConaughey he's, maybe it's the exploit like, once you're in it go in it for exactly. That being said, I mean, a lot of us maybe a couple years in our careers. But I think what Naval tries to remind us, you might not be very happy what you're doing right now, or you might love what you're doing right now. But there's always something that suits you specifically. So some people might love research, and they might not fit into a startup environment, or some people in, for example, maybe a big Innovation Lab, they need some of their data scientists to really focus on research, and they might not fit in there. If Data Scientist is more about iterating fast, and you know, shipping faster customers as well. There's always something better for you. So keep exploring. And once you found it exploited, like Matthew McCarney, he didn't have as he went all in, and he's doing fantastically well. Yeah, it worked out okay for him. Yeah, yeah.
28:51 Nice. All right, transfer learning books and papers or cheat codes. Yeah. So in machine learning, I think a couple of years ago, there was this thing called transfer learning, which didn't make quite a storm, but I thought it was really breakthrough. So what it means is that there's there's this competition called image net, where you try to classify images into 1000s of categories, or I think 1000 categories. And those big companies like Google or Microsoft, they will train huge models to classify this. And this will be deep neural networks. And what people found is that you can take what they have trained this huge model with all the weights and parameters, and you can just chop off the last layer and put your own model, maybe you're trying to classify cat versus dog, you can use that model and then classify cat versus dog and put in your own data and just update the model. And it would work fantastically well. And orders of magnitude better than if you had to train from scratch. Well, yeah, I think that's a cheat code. I use that when I first heard about it, I used that cheat code. Okay, since I've heard about it, I've only use transfer learning for work as much as I can, if there's a transfer learning model. Yeah. So the idea is you instead of start with a completely blank set of weights in your model, and just feeding data and going
30:00 No, that's right. That's not right. That's a dog. That's not a cat. No, that's Yes, that one is a cat. Good job, you can use kind of a vagues. One to automate some of that driving is that kind of idea. Like you give it a little bit of knowledge, but not too much. And then you keep still teaching it is that this model is able to distinguish 1000 different cats and dogs and hamburgers and cars. Yeah. And you're just taking all that knowledge as in the end, you're just fine tuning it for your specific use case of cat versus dog. And it really cuts off so much effort. Yeah, absolutely. Very, very cool. So in this one, the life lesson here is we were touching this before that people feel like a lot of times they've gotten they've got their degree they've studied, they've worked hard, like they just want to have fun and live their life and not just keep going but like the way to think of education, formalized education, let's say even I would say college, is this generalized pre training, right? You're not ready to really go to the thing. You haven't really learned the thing. But you're much closer than somebody who hasn't. Right? Something like that. Schools generalized pre training. Yes, I fully agree. I think a lot of people think that is what I've seen. Some people see that after they graduated, and then learning, but I don't know about you. But after I graduate that update going into working well, I realize, Hey, I didn't learn any of this stuff. Yeah, I know, I had to learn a lot more.
31:15 I think the only thing that I learned at school that helped was 'Excel' and 'R' in 'SPSS', the technical skills. So school sort of trains, you know, teamwork, how to work in a project team, communication, how to learn fast, because you know, every semester be taking four subjects, it teaches you the general stuff. And then once you get to work, there's a lot of on the job training that you have to do yourself. So the point that I was trying to make here is that school is really just the start of it is generalized P training, you could stop there. But if you find Q, if you take the effort to fine tune your model from school, on to your very specific pass, you will be orders of magnitude more effective. That's the message I'm trying to give. And I also want to tell people, and this is the next paragraph is that we have transfer learning models, right. And in real life, that's the same thing for transferring the models, which is books, yeah. And academic papers. I want to try to get people to read more books. I've gained a lot from books, I've gained a lot from academic papers. And you can imagine, I don't know maybe you read a book by I don't know, 'Sapiens' by 'Noah Harare', or 'Deep Work' by 'Cal Newport', who I'm a big fan of they have thought about this on the Val's novels trade, right? They have thought about this for so long, five years, decades, and they have compressed it in a book that you can read in eight to 10 hours, read it, and you'll be that much smarter. And you see through life see life in a different way. And you'll gain a lot. Yeah, that's super interesting. I do agree with it that you don't necessarily agree with everything they say. It doesn't have to match your situation. But it does give you a whole lot more experience without going through the hard ship of getting that experience. Exactly. And I think it's magic. Yeah, that's what separates human beings from animals, right? Where we can transfer knowledge, we can perform telepathy, I can transfer knowledge to you to anyone on the internet by writing when people do that through books in the past. Yeah, very interesting. So that's magic. So you say books are the weights and biases of the great thinkers who have come before us. That's pretty awesome.
33:14 This portion of talk python the way is sponsored by 'Linode'. Simplify your infrastructure and cut your cloud bills in half with lots of Linux virtual machines, develop, deploy and scale your modern applications faster and easier. Whether you're developing a personal project or managing large workloads, you deserve simple, affordable and accessible cloud computing solutions. As listeners of talk Python to me, you'll get a $100 free credit, you can find all the details at talk python.fm/linode. 'Linode' has data centers around the world with the same simple and consistent pricing. regardless of location, just choose the data center that's nearest to your users, you also receive 24/7, 365 human support with no tears or handoffs, regardless of your plan size. You can choose shared and dedicated compute instances. Or you can use your $100 in credit on s3, compatible 'Object storage', managed 'Kubernetes clusters'. And more. If it runs on Linux, it runs on 'Linode', visit talk python.fm/linode. Or click the link in your show notes. Then click that create free account button to get started.
34:18 On this, I wanted to ask you about what you thought about quote new media, right? Like I'm thinking in particular YouTube, but other places, right? Like these books are very, like the tradition of meaningful books are very important and long, and everybody knows about them. Right? But like you talked about the MOOCs before, I mean, YouTube, I was talking about the negative aspects of it before but they're, it's amazing what you can learn. If you go over to places like YouTube with the desire to seek out this kind of information. Like there's so much good stuff, they're mixed in with like cat videos. Right? Yeah. What do you think? I think that I am ambivalent to it. I think I have a preferred way of learning which is to read books.
35:00 Nonetheless, I know the video is awesome in the sense that I can write some code, I can iterate, and you can see me doing it, it's almost impossible to convey that in a book, maybe some code examples. So that's really amazing. I think both new media has strengths. And it also has the difference between New Media and traditional media is that new media is just a lot more powerful, a lot more powerful, it can be powerful for good and also powerful for not so good, a lot more powerful in the sense that you know, 'MOOC's are amazing, right, a professor can teleport into your house and teach you that's powerful, but powerful for not so good in the sense that we have things like that reduce your attention span, click on videos, or short snippets of articles that it's also very powerful. It's just whether it's for good or not so good. So that's something to think about when you're using new media to learn. It's definitely more risky, and that you can get distracted and pulled away because all those places are about that for sure. But you know, like, I was recently watching a video of an opera singer, and like vocal coach, analyzing like this heavy metal singer, and like dissecting the song from a perspective of like an opera singer, I'm like, I appreciate both of those art forms. Way more, having that scene like that experience right now, I would never have that experience. Exactly. And I would never go down to the bookstore and pick up a book on like, like singing theory and stuff I didn't write, I would find something else that to spend my time on. But anyway, like, those are the kinds of things I'm thinking that you just you wouldn't expect. But you can find interesting things there. Right? Definitely, definitely. I want to go back really to this one really, super quick, because I skipped over it right at the end. But you talk about this exploring versus exploitation thing and say, Look, you don't always have to worry so much about this stuff. Because sometimes many things are what you call two way doors. And there's this interview over here of Jeff Bezos, and he has this distinction of some decisions been two way doors, and some of them in one way doors and you shouldn't put about the same concern, worry energy, and whatnot into both types of decisions. They're not equal. So don't treat them equal. Can you speak to that real quick? I thought that was super interesting. Yeah, I'm just gonna use Jeff's example. For example, maybe you're doing a side hustle, and someone wants to acquire it, or someone wants to complete purchase it from you. That's a one way though, that, you know, after it's sold it there's no way to reverse it. Right? Yeah. So either you know, that the maybe you start a side hustle. And then maybe you're thinking, hey, should I be targeting Python programmers or our programmers or I don't know, Scala programmers, that's a two way door, you can easily pivot. So I think what Jeff is saying is that the one way, though, very difficult to reverse, but it's a lot less, it happens a lot less. And a lot of us a lot of people treat two way door decisions as one way door decisions. And I think he's saying that, you know, it is good to distinguish between both and devote the amount of energy and due diligence and analysis into each of this. Yeah. And that makes you help more help you make more effective decisions more efficiently. Yeah, I totally agree. I thought this was like I said, I thought this was insightful. And I feel like in programming and encode, a lot of people get stuck in the so called analysis paralysis, they're just stuck, died, trying to decide like every decision is like, it's overwhelming. And it's hard to decide what to do. Because you feel like you might make the wrong decision. You don't have enough experience, like so much of those things. You could dissolve or just refactor this later. Or we can just throw away this layer, like, oh, we're going to use a relational database, oh, we should have used a no SQL database, well just throw it away and switch it over. It's like, probably not that big of a deal versus Exactly. We're gonna let all the Python guys go and hire a bunch of data and rewrite the whole thing. Like, if you're a year into that decision, you're fairly committed, right, like, so there's really, I think understanding like, Oh, that's a two way door decision allows you to just like try it, and experiment fully agree. And hopefully, by understanding the difference between one way door 2way door also makes it easier to explore, right? Yeah, yeah, I agree. I think that's worth calling out. All right, iterations, find reps you can tolerate and iterate fast. So I think machine learning a lot of machine learning involves iteration, clearly neural networks iterations every time you pass the data to multiple 'Epochs'. And the data learns, with each iteration with each 'epoch', the machine learning model error reduces machine learning gets model provides better predictions and gets more accurate, richer metrics. That is the same with life. I think a lot of people expect this what I used to expect, I expected that I would read something once and I would fully understand it, all of the knowledge is in my brain. And then, you know, I realized that that is never true. So and actually, that actually lowers my expectation of myself. You know, sometimes I read a paper and then you know, I'll try to discuss it and realize I don't actually know the details, that low expectation myself, you know, I tell myself, Eugene, by reading it once, you're never going to get it. Yeah, don't fully expect yourself to that is too high a bar. So maybe read it a few times, be kinder to yourself. So that's the same thing. When I read papers, I go through it multiple times. When I do A B test, I fail two times for every one time I succeed. So I feel like 50 to 75% of the time, and you just got to learn to be kind of yourself with yourself. iterate right there. I think I've posted some exams.
40:00 bossier, the Angry Birds developers failed 51 times, Sir James Dyson failed 5000 times in 15 years before a vacuum cleaner work. Right. And you know, imagine if he gave up, we will never have that. Yeah. But again, a lot of great examples here by people who just iterated and just stuck to it, I think also sort of ties into the previous one, right, the two way doors, it's okay, if it doesn't work on a lot of these types of things. Just keep going. Just try again. Right. Eventually, you'll find one that fits. Yeah, exactly. Yeah. Speaking of fitting overfitting, focus on intuition and keep learning. So I think overfitting is well, I guess it's overfitting is when your machine learning model memorizes, the training set too much and can't predict Well, on the prediction set. Right? It's almost perfect on the training set, like it knows that it's called. But it's so specific that any slight variation, even though it should be should be a dog, it's it doesn't know what the dog exactly an example of this is when your machine learning model learns on customer IDs. And you know, when new customer IDs come in it just crap. Yeah. So I think the clearest, the person who really pushes for this is Richard Fineman, he says that there's no end the way he teaches math and physics is the same. He goes directly into intuition. Forget about formulas, or forget about memorizing stuff. If you understand the intuition, you will understand that better and you can generalize across many, many things, I think in life is also makes the same sense. Don't try to memorize things or don't try to memorize knowledge, right? I think if you have the intuition of the fundamentals, you'll find that it transfers across many, many different domains. For example, I think Elon Musk talks about knowledge as a tree. So you know, the fundamentals of the tree, or the trunk, that the trunk is the fundamentals that supports all the branches, you want to make sure that the intuition is like the trunk, you want to make sure that your trunk is solid, and then you can build on new branches or cut off new branches and grow new branches as necessary. I think the way to grow this intuition, at least for me, I find that being a beginner is the best way to do this. Absolutely. Okay. Very interesting. Last one has to do with ensembles, and ensembling. Diversity is strength. What is ensembling? Yeah, I guess ensembling is that I could train a model, maybe a 'Linear regression'. And another model may be a 'Decision tree'. And another model may be a K nearest neighbors, and they will all have their different errors, they will all have the different biases and strengths. But unusual thing in machine learning is that you know, you can just take all your predictions and average them. And they will do better than all of them combined. And actually, that's a, that's a cheat code that everyone is doing on kaggle competition, you just train 1000s of models and just combine all them interesting. It reminds me of like a much simpler example. There's sort of the wisdom of crowds, like you hear stories of people saying like, here's a jar, a big glass jar full of jelly beans, you got to guess how many jelly beans, there are like many if any given person will over underestimate a whole lot. But if you ask 100 people, it's usually really close to the actual number. Or there's some weird examples of this at like state fairs. They'll be like a cow. And people will have to ask, like, how much does the cow away? You know, it's like a competition and people get it really wrong. But it's usually really close if enough people answer and participate. And it's averaged. Right. Exactly. So having diversity, diversity of opinions, diversity of thought, I think it's very powerful. Yeah. So that's what I'm trying to encourage you as well. Yeah. So what's the story about life here? Instead of guessing the weight of cows, which is not all that practical? Well, I think that one way, okay, maybe a quick one, which is one way to do when you are trying to build teams is you might want to deliberately try to find people which are different from you, right, which complement your strengths. Sometimes in tech interviews, we want to find people that are similar to us have the same skill sets that you know, fit this mold for this job description that's useful is effective, but I personally have had built teams whereby it's very diverse, maybe from different countries or wanted female. And I found that the creativity comes from this is really powerful. And the other one, which is I think, of course, Scott Adams is, is known for this, he says that, you know, if you can't meet the top of your field, combine multiple superpowers like 'Scott Adams' did. He combined his ability to draw his sense of humor and his business law and he created 'Dilbert', which is a no one else can replicate the 'Dilbert' . It needs someone like Scott Adams to do that. Yeah, yeah. You know, that general idea, I actually hit on this a lot, because there are a lot of people who listen to this show who are not traditional computer science developers, traditional data science, folks. And I think sometimes they feel like they don't have quite the same skill set to compete with those people, and how are they going to compete with somebody with a master's degree from Stanford in computer science and what I my thought on all this is, you look, if you're really good at economics, and you're pretty good at programming, there's not too many people who have both of those skills, right? Like, all of a sudden, you go from competing with 100,000 down to like 500, or something, I don't know, not that maybe it's a little bit extreme. But you know, like the, if you need that intersection of skills, all of a sudden, it becomes super powerful. And what you're suggesting here is maybe like building teams, you can kind of build that in the team rather than in an individual. Exactly. And I want to go back to your previous example, someone who is maybe decent programmer, but you know, can't compete with
45:00 Some of them graduate with a degree in degree in CS and a master's in CS and PH.D in CS. It goes back to Nobel's tree right? There is something that is just right for you that can tap on your skills in economics and commerce, science. You just need to find it. And there'll be a great fit. Yeah, absolutely. All right. Well, that was the seven items. And I, you know, I enjoyed thinking about them. And just seeing how these machine learning examples maybe can be analogies for living life, and it's pretty cool. Thank you. Yeah, absolutely. So a couple other things real quick that you spoken about is you've read a couple of things on sort of productivity as a developer, and in the tech field, one article called 'How to accomplish more with less useful tools and routines', and then also 'Routines and tools to optimize your day', which is a guest post by 'Susan Chu'. Yep. So those were really interesting. But in particular, during one of them, I don't remember which one, you talk about this article by 'Paul Graham'. And Paul Graham wrote this thing called 'Makers schedule' versus 'Manager schedule'. And, you know, I think you talk a lot, or we talk in the tech field a lot about getting into flow, really programming and just having uninterrupted time. And yet, I think probably more than ever, people are being pulled in different directions, because everyone is just a zoom call away. It's not even if you're not in the office, you're now just as eligible to be sucked into a meeting as anyone else, right? Yep, definitely. Yes, you can you talk real quickly about this, because I think it's a short article. But I think having awareness of this idea of a 'Makers schedule or a 'Manager schedule', and how they're not super compatible, and you got to be careful to help them coexist. I think that's important. Yeah. So I think that, of course, all credit goes to Paul Graham for this. So makers, to even start to design something or to start the core a framework, you sort of need, I don't know about you, but it takes me like 30 minutes to warm up to have to load all the concepts into my memory, so I can start juggling them in my head. I mean, I know once I load it into my head, and then I can Okay, I can start writing pseudocode, you know, tweaking things, testing things, iteratively. And that takes time, and it takes me 45 minutes, 60 minutes to get into flow. And once I'm in the flow, I'm moving really quickly, I speeding things through or once I'm in the flow of, you know, fixing a bug, and I don't know about you, but if I don't fix the bug, I can't stop, I can't go for lunch. And that motivation that drive, if someone pulls me into a meeting, it sort of kills the motivation, sometimes for the day. And you know, if you had continued for just 30 minutes, you will have fixed it. But if if it's broken by something in the middle, you will be gone. So how I tried to do this is that I actually deliberately block my time in the morning before lunch, I actually block it out with meetings, my own meetings so that I can actually use it. And again, that flow depends on when your energy level is highest. For me, it's actually in the morning. And then I actually have I say that when people want to ask for me to say, Oh, sure, let's do it after 3pm, if you're okay with it, because after 3pm, I mostly can't do deep work anyway. So I think that's useful to be aware of. Yeah, it's really interesting. And I agree with that Paul talks about, if you're on a manager schedule, what you do is you go from meeting to meeting to meeting, and if you've got an hour gap in your day, you know, you could just meet with somebody else, maybe that's like a time to just set up a meeting as you get to know somebody and dig in with that, that person or the team or the project. And that's fine if you're on a manager schedule. But if you're on the maker schedule, maybe you do need the whole morning, uninterrupted so that you can get into that, you know, like, you know, you've had a good session, when you know, you've programmed programming, then you stop for a second and you're like, wow, I'm hungry. We have to go guess if it's like three in the afternoon, I forgot to eat lunch. Like, that's totally possible that that happens, right? And I would just want to say that these sessions feel so fulfilling feels so satisfying. You feel like you've gotten so much work done in such a compressed amount of time that Okay, and now you can sure you can have office hours now. So those sessions are really fulfilling. Yeah, I don't know how that's gonna work out. But after reading this, and some of your your other writing, I decided on my calendar, I'm just blocking, like, Tuesday and Friday, like all day, and I'm just gonna call those maker days. We'll see how that works out. And wow, I get a lot of stuff done. So other days, I have more meetings? We'll see. I don't know. I'm looking forward to hearing your experience. Yeah, absolutely. And Chris may Hey, Chris, out in the livestream says personal productivity brings superpowers to the powers you got by learning Python. Totally agree. Yep. Awesome. Very cool. All right. Well, I think that's probably about all the stuff that we have time to talk about. Although you may be really quickly you could touch on the bottom of your homepage, got a bunch of resources, maybe just highlight something you think that people would find valuable there. So yeah, I like to, again, a lot of these answering questions that people ask me so people asked me know what your favorite papers are, what people should read. So that's the second one on the list 'Applied ML' where, you know, I try to collect papers on real machine learning by by companies that have implemented the lessons they learned. And you know, sometimes people ask me, you know, why there's so I'm starting again, to this view, there's so much to learn. And there's the third link there where I find machine learning surveys where you know, people summarize what has happened in the past. And of course, you know, people ask me things, you know, how do you set up your python
50:00 repo so that you have code reviews and all that automatically or linting. So I have things like, you know, the Python color template, or you know, how to test machine learning models. And of course, recently I wrote about how to write machine learning 'Design docs', 'Design documents', and of course, I have that as well. So you know, I mean, some of these are Git repo. Some of these are just articles. And of course, there's a, the email course, which is a lot of people asked me, you know, what makes an effective data scientist? This is the question I asked a lot of my mentors five years ago, and I try to summarize the five lessons that I've learned in a short email course, where I only send you one lesson a day. And of course, there's a short exercise that I hope people will do. And that's why I send you one lesson a day. And that's your exercise maybe takes an hour each and I hope that after this, it sort of opens your mind that, you know, being an effective data scientist is beyond coding well, is beyond PhD level research is beyond math. Oh, yeah, that looks really useful. And you also have a 'papermill' dash
55:00 Feed at /play and the direct RSS feed at /RSS on talk python.fm. We're live streaming most of our recordings these days. If you want to be part of the show and have your comments featured on the air, be sure to subscribe to our YouTube channel at talk python.fm/YouTube. This is your host, Michael Kennedy. Thanks so much for listening. I really appreciate it. Now get out there and write some Python code