Latest / Talk Python To Me / #309: What ML Can Teach Us About Life: 7 Lessons
Transcript
- 0:00Machine learning and data science are full of best practices and important workflows.
- 0:03Can we extrapolate these to our broader lives?
- 0:06Eugene Yan and I give it a shot on this slightly more philosophical episode of Talk Python To Me.
- 0:11This is episode 309, recorded March 19th, 2021.
- 0:16Welcome to Talk Python To Me, a weekly podcast on Python, the language, the libraries, the ecosystem, and the personalities.
- 0:36This is your host, Michael Kennedy.
- 0:38Follow me on Twitter where I'm @mkennedy.
- 0:40And keep up with the show and listen to past episodes at talkpython.fm.
- 0:44And follow the show on Twitter via at talkpython.
- 0:47This episode is brought to you by Retool and Linode.
- 0:50Please check out what they're offering during their segments.
- 0:52It really helps support the show.
- 0:53We'll be giving away five tickets to attend PyCon US 2021.
- 0:58This conference is one of the primary sources of funding for the PSF.
- 1:02And it's going to be held May 14th to 15th online.
- 1:05And because it's online this year, it's open to anyone around the world.
- 1:09So we decided to run a contest to help people, especially those who have never been part of PyCon before, attend it this year.
- 1:15Just visit talkpython.fm/PyCon 2021 and enter your email address and you'll be in the running for an individual PyCon ticket.
- 1:23Compliments of Talk Python.
- 1:25These normally sell for about $100 each.
- 1:28And if you're certain you 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.
- 1:35Congratulations to Ron Lee.
- 1:37He won number three of the five tickets that were given away.
- 1:40And there's still more chances to win.
- 1:41If you want to be in this drawing, just visit talkpython.fm/PyCon 2021.
- 1:45Enter your email address.
- 1:47You'll be in the running to win a ticket.
- 1:49Now let's get on to that interview.
- 1:52Eugene, welcome to Talk Python To Me.
- 1:54Thank you.
- 1:54Yeah.
- 1:55It's great to have you here.
- 1:56I love getting down into the details of programming and writing code and working with APIs and building amazing things.
- 2:02But it's also really interesting to sort of step back and take a big picture view of the world of the software.
- 2:08And you wrote a really interesting article about applying some of the lessons you might learn from code back to your life.
- 2:14And I really enjoyed the idea of it.
- 2:15So I'm looking forward to talking to you about it on this show.
- 2:17Thank you.
- 2:17Happy to chat more about it as well.
- 2:19Yeah.
- 2:19Yeah.
- 2:19It's going to be super fun.
- 2:20Now, before we get into the details of all that, you know, let's start with your story.
- 2:24How did you get into programming and Python?
- 2:26My degree is in psychology.
- 2:27So 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.
- 2:36You know, I'll do this.
- 2:37I used to run experiments and analyze the data in SPSS and Excel.
- 2:41But eventually, the data just got bigger and bigger.
- 2:44So I moved on to R.
- 2:45And now I'm using Python.
- 2:46So that's how it happened.
- 2:48I mainly use Python because I have problems to solve that require me to process data with Python.
- 2:54Yeah, really cool.
- 2:54One of my very first programming jobs was at this incredibly cool place where it started out as a research lab and then it spun out of the university to a startup.
- 3:03And the whole premise of what they did was to use eye tracking, not some phone thing, but like where you're looking to understand how people solve problems and how they think and so on.
- 3:13And it was mostly a bunch of PhD cognitive science folks.
- 3:17And they would work in MATLAB and Excel and all that stuff.
- 3:19And I would help write software that would take that stuff and turn it into products and turn it into automation and whatnot.
- 3:25And it's a really interesting world.
- 3:27And there's a lot more opportunities for code and solving problems with code, especially on the data analysis side in psychology.
- 3:33Fully agree.
- 3:34Then you might first think, right?
- 3:36You think, oh, psychology, that's talking to people on the couch.
- 3:38Like sometimes, but not always.
- 3:40Not a lot of the time.
- 3:41You're right.
- 3:42A lot of it is running experiments.
- 3:43And like, I'm sure they collected data about eye tracking and you have to process the data.
- 3:47And that happens in real life as well.
- 3:49We run experiments, A-B testing, and we have to analyze the data.
- 3:53Yeah, that was it.
- 3:54We would run tons of experiments.
- 3:55We would have maybe a week where 50 people came in.
- 3:58We'd have like one-way mirrors and all sorts of recording equipment and like analyze that.
- 4:03They'd even put ads, I think, in Craigslist.
- 4:06All sorts of places.
- 4:07Like, hey, we need somebody to come like surf on these websites for half an hour.
- 4:10We'll pay you 50 bucks.
- 4:11Can you come do that during lunch?
- 4:12Be like, yeah, I'll do that.
- 4:13That's really cool.
- 4:14Yeah, it was really fun.
- 4:15But it was really neat to do the programming and stuff there.
- 4:17So tell me a little bit more about that transition, because it must have been a little bit challenging, right?
- 4:22There's not a lot in your traditional education of psychology that teaches you programming.
- 4:28Maybe a little bit, but not a ton, right?
- 4:29No, actually, in my traditional education, for psychology, we use SPSS and R.
- 4:34SPSS is this IBM product proprietary.
- 4:37So nothing about it.
- 4:38I did know a bit about the statistics and how to work with data, but that's about it.
- 4:43So I think back then, when I first started getting my first job, I had to learn a lot of Python and SQL on my own.
- 4:51And, you know, that was the time when, you know, Coursera is available.
- 4:53And Coursera is a lifesaver.
- 4:55If you ask me, I learned all my Python and data science stuff from Coursera.
- 4:58So it was after work, spending one or two hours doing the courses and doing the lessons, the hands-on exercises were amazing.
- 5:06And today and 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.
- 5:15And it just makes it so fun to learn Python now.
- 5:17Yeah.
- 5:18There's so much to know in programming these days.
- 5:20But at the same time, there's so many resources out there to help you.
- 5:23It's really a huge benefit.
- 5:25I remember when MOOCs came on, as they called them, like these courses with many, many, many people in them.
- 5:31And it was such a revolution at the time.
- 5:33And now it's just one of the million options, you know?
- 5:36Yeah, I agree.
- 5:37I think MOOCs really the great equalizer.
- 5:39I mean, education is the great equalizer.
- 5:41And MOOCs, by making it freely available across the internet with great educators, can just teach anyone and not confine to a classroom.
- 5:47I think that was amazing.
- 5:48And that was what helped me transition from SPSS and R to Python and Spark and machine learning.
- 5:54Yeah.
- 5:55It opened that door for me.
- 5:56Yeah, yeah.
- 5:57Instead of studying neurons, you're studying neural networks now.
- 6:00Yeah.
- 6:00Nice.
- 6:01So how about now?
- 6:02What do you do day to day?
- 6:03You just made a big life change.
- 6:05I was reading that you recently moved from Singapore to Seattle.
- 6:08That's a big change, even though not a whole lot in between those two things.
- 6:11If you draw a line, just a lot of water.
- 6:13But yeah, it's still a big change in terms of jobs and whatnot.
- 6:15Tell us about that.
- 6:16So I think towards the end of 2019, I think, or maybe in the middle of 2019, my wife and I were thinking of, you know, stepping off our comfort zone.
- 6:23I don't know how many of your listeners have been to Singapore, but it's a beautiful place.
- 6:28It's a very comfortable, tiny island, amazing weather.
- 6:31But we thought, you know, we like to travel.
- 6:33So we thought, hey, no, let's try to live somewhere for a bit.
- 6:35So we looked at a couple of places, a couple of tech hubs, Seattle, San Francisco, Berlin, Shanghai.
- 6:42And it so happens that I got an offer from Amazon.
- 6:46Nice.
- 6:46Yeah.
- 6:47So that's where I am now.
- 6:48I'm an applied scientist at Amazon.
- 6:49And so what I do, I'm part of the Kindle team.
- 6:53So what I do in my day-to-day job is I try to help people read more.
- 6:57And we try to do this by helping them find books that they need to find.
- 7:00So 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.
- 7:08We know this because we have Kindle data.
- 7:10We know how much of a book we have completed.
- 7:11We can recommend you new books that you might be interested in.
- 7:14Or based on what you browse on the website, we can update our recommendations in real time and recommend you new books as well.
- 7:20So that's what I do in my day-to-day job.
- 7:22Yeah.
- 7:22Well, that sounds really fun.
- 7:23I actually really appreciate that from Amazon, specifically around the Kindle, to be honest.
- 7:28Like a lot of stores are like, oh, you might also like that.
- 7:31I'm like, no, I don't also like that.
- 7:32I really don't care.
- 7:33You know, there's just so many things where I'm shopping online or whatever, and it just doesn't make sense.
- 7:37But specifically for Kindle, I'll be reading a book and say you should also check out these other ones.
- 7:41Like a lot of times, like my next book is out of that list.
- 7:44I really love it.
- 7:45So can't go browse a bookstore these days.
- 7:47I mean, we have a fantastic bookstore called Powell's.
- 7:49It's like one of the largest bookstores around here in Portland, but you can't even go to it anymore.
- 7:54So, yeah, it's pretty cool.
- 7:55Thanks for that good list there.
- 7:56Yeah, you and your folks.
- 7:57I'm happy to hear that.
- 7:58And this is a great place where what I'm doing is very aligned with what I do,
- 8:01which is trying to help people, very aligned with my values, which is trying to help people learn more by reading more books.
- 8:07So that's great.
- 8:08Yeah, absolutely.
- 8:08And you talk a lot about writing.
- 8:10And well, I guess not just talk.
- 8:12You also put your time and energy where your words are, right?
- 8:16You do a lot of writing.
- 8:18And the reason that I wanted to talk to you about having you on the show, like I said, is one of these articles that you wrote.
- 8:23But there's a whole bunch of them that you have.
- 8:26So 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.
- 8:33Like I had Jesse Jiryu Davis on the podcast at the time.
- 8:38He's from MongoDB.
- 8:38I think he still is.
- 8:39Anyway, he talks about like all these design patterns of technical writing, right?
- 8:43Like here's the how to, here's the first and like all these really interesting things.
- 8:47And I kind of get that vibe from you as well, that like you've got these really strong ideas about writing and how it reinforces your programming side of the world.
- 8:56What's your thoughts on that?
- 8:58Well, I guess maybe just to share a bit of backstory on why I started writing so much.
- 9:02I think a couple of years ago, I was interviewing a couple of mentors, informal mentors, right?
- 9:08They didn't know I was getting them to be a mentor, but I would just reach out to people who are two to three steps ahead of me.
- 9:13Heads of data science, CTOs, lead data scientists.
- 9:15I would ask them the same question.
- 9:17What makes an effective data scientist?
- 9:20And 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?
- 9:29And a lot of them said, actually, you know, all that is really important, but there's one thing that you're missing out.
- 9:34And this one thing is transferable across all your entire career.
- 9:37And that one thing that said is communication.
- 9:39At that point in time, I didn't believe it.
- 9:41I was immature.
- 9:41I didn't think it was, I didn't think it makes sense, but I thought so many of these people tried it.
- 9:45I owe it to them to, so many of these people mentioned, I owe it to them to try it and update it on my program.
- 9:50So for one year, I said, I'm just going to volunteer for whatever writing opportunity, whatever speaking opportunity the company has.
- 9:57So I started writing about my side projects.
- 9:59I started writing an internal company newsletter to share about what our team, our data science team was doing.
- 10:05And I started speaking at conferences and meetups.
- 10:07And so that's why I've been started writing.
- 10:09And since then, I found that writing actually helps me learn a lot because I would write about something and I realized, hey, you know, I don't know anything about this thing I'm writing about.
- 10:16Yeah, exactly.
- 10:17You 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.
- 10:23Right.
- 10:24But 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.
- 10:29You've got to know, well, here's the two ways.
- 10:30What are the trade-offs?
- 10:32When should I use which?
- 10:33Like you've got to dive into these sorts of details when you're either writing or speaking or presenting about it.
- 10:38And it just forces you another level down in your understanding and depth, right?
- 10:43Exactly.
- 10:43Writing is really difficult.
- 10:45And truth be told, I think a lot of people say, you know, you must really love writing.
- 10:48No, actually, I don't really love writing, which is a bit weird.
- 10:51I love learning and I love sharing about what I've learned online.
- 10:56And writing is my vehicle to let me do that.
- 10:58So that's why I started writing.
- 10:59So why do I talk a lot about writing at work or writing in general?
- 11:03There's this question I ask myself a lot.
- 11:05I used to ask myself this question and now a lot of people ask me this question.
- 11:08Hey, you know, as a data scientist, is your job to write code or is your job to write documents?
- 11:13And I used to think my job was to write code, to build systems, to help customers.
- 11:17But then as I'm doing this more, I find that, hey, you know, a lot of times before writing code,
- 11:21I need to spend a lot of time thinking, researching and designing.
- 11:25And the medium of that work is writing documents.
- 11:29That's why I encourage a lot of people, you know, it's just like what you said.
- 11:32Do I serve my recommendations via Redis cache or via Lambda or API Gateway or whatever?
- 11:37And I'm thinking through all these designs and I need to make trade-offs.
- 11:40And writing in a document the pros and cons and the rationale for the decision forces me to do that.
- 11:45So that when we start implementing things, we don't do things the wrong way,
- 11:50which is really expensive, right?
- 11:51Implementation is expensive.
- 11:52So that's why, and I find that it has really helped me a lot.
- 11:56I don't feel that enough people talk about it.
- 11:59And I want to encourage people to write a lot.
- 12:01Well, yeah, I agree.
- 12:02And it seems to me like one of the fundamental jobs of a data scientist, at least one branch of data science,
- 12:09is to take the raw information, think about it, and then communicate what it means, right?
- 12:14And that seems to go really hand in hand with what you're saying.
- 12:18Exactly.
- 12:18I think I was doing this one year of writing and speaking practice, right?
- 12:22At work.
- 12:23And 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 scientist on your team for half an hour,
- 12:31and then I work with not knowing anything.
- 12:33I don't know what they spoke about.
- 12:34And that's because I think, by and large, most people, you know, we tend to use jargon like AUC, ROC, distributed, all that.
- 12:41And we assume that business people will know it.
- 12:43But I made this mistake as well.
- 12:45And then one day, I had a great boss who brought me aside, you know, Eugene, the way you're communicating, no one understands you.
- 12:50And I asked, what do you mean?
- 12:51And he gave me very good feedback.
- 12:53He was a great boss.
- 12:54And I started changing how I communicated things.
- 12:57And that made me a lot more effective at work.
- 12:59So that's how I get started on that.
- 13:02Oh, fantastic.
- 13:03Well, I really like what you've done with the writing and stuff.
- 13:05And so maybe let's spend some time diving into the one that I think is probably the centerpiece of what we'll talk about.
- 13:12We'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.
- 13:21So you have a lot of quotes.
- 13:22You have a lot of references to other things and so on.
- 13:26So I really like the way, the style.
- 13:28So let's talk about your article, What Machine Learning Can Teach Us About Life?
- 13:33Seven Lessons.
- 13:33Why did you write this?
- 13:34Because when I was writing some of my previous articles, okay, this is an odd thing.
- 13:39I know that my audience are machine learning practitioners.
- 13:42And, you know, sometimes I write about things that sometimes I want to write about things that I know will not interest them.
- 13:47So this is one of those.
- 13:49I like to write about life lessons, right?
- 13:51And I know it will not interest them, but I think it's really important.
- 13:54I want to write about that anyway.
- 13:55So, you know, in order to sneak it in, in this case, machine learning is really just a Trojan horse.
- 14:00Yeah.
- 14:01Machine learning is a Trojan horse where I sneak in these life lessons that I found really helpful for me.
- 14:05And I just, upon some reflection, I just want to write about it.
- 14:09And that's it.
- 14:09That's how this article came about.
- 14:11I love these Trojan horse ideas.
- 14:13Like, oh, I'm going to teach you.
- 14:14I'll do something fun.
- 14:15I'll actually have a lesson, right?
- 14:16Yeah.
- 14:17And now the secret's out.
- 14:18Yeah.
- 14:18I haven't actually shared that with anyone yet.
- 14:19Now they're going to know.
- 14:21That's right.
- 14:24This portion of Talk Python To Me is brought to you by Retool.
- 14:26Do you really need a full dev team to build that simple internal app at your company?
- 14:30I'm talking about those back office apps.
- 14:33The tool your customer service team uses to access your database.
- 14:36That S3 uploader you built last year for the marketing team.
- 14:39The quick admin panel that lets you monitor key KPIs or maybe even the tool your data science team hacked together so they could provide custom ad spend insights.
- 14:47Literally every type of business relies on these internal tools.
- 14:51But not many engineers love building these tools, let alone get excited about maintaining or supporting them over time.
- 14:57They eventually fall into the please don't touch it, it's working category of apps.
- 15:02And here's where Retool comes in.
- 15:04Companies like DoorDash, Brex, Plaid, and even Amazon use Retool to build internal tools super fast.
- 15:11The idea is that almost all internal tools look the same.
- 15:13Forms over data.
- 15:15They're made up of tables, drop-downs, buttons, text input, and so on.
- 15:18Retool gives you a point, click, and drag and drop interface that makes it super simple to build internal UIs like this in hours, not days.
- 15:27Retool can connect to any database or API.
- 15:30Want to pull data from Postgres?
- 15:32Just write a SQL query and drag the table onto your canvas.
- 15:35Search across those fields, add a search input bar and update your query.
- 15:39Save it, share it, super easy.
- 15:41Retool is built by engineers, explicitly for engineers.
- 15:45It can be set up to run on-prem in about 15 minutes using Docker, Kubernetes, or Heroku.
- 15:50Get started with Retool today.
- 15:52Just visit talkpython.fm/retool or click the Retool link in your podcast player show notes.
- 15:58So let's go through the seven lessons.
- 16:01The first one here is data cleaning.
- 16:04Assess what you consume.
- 16:06And I'm a big fan of this idea as a life lesson as well.
- 16:10So what's the story?
- 16:11Wait, before you get into that, like every one of these lessons, you start by saying, okay, here's the machine learning meaning.
- 16:17And then here's the sort of follow-on lesson, right?
- 16:20So what's the machine learning lesson of data cleaning?
- 16:22I think the machine learning lesson of data cleaning is 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 going to work.
- 16:31I think that's this cliche, garbage in, garbage out.
- 16:34In machine learning world, that is absolutely true.
- 16:36Yeah.
- 16:37And cleaning the data itself is actually most of the work in terms of training your model, cleaning the data, refining it, making the model be able to learn from it.
- 16:45So that's really important in the machine learning world.
- 16:47Yeah, absolutely.
- 16:48You have a really interesting quote in here.
- 16:50And you also have some really fun pictures, which we can talk about.
- 16:53Where is it in here?
- 16:54It was Randy Au shares, data cleaning isn't the grunt work.
- 16:59It is the work, right?
- 17:00I think so many of these things in a lot of these machine learning and like scientific programming sides, you have these amazing libraries, right?
- 17:08Like you can pip install in TensorFlow or whatever.
- 17:11And then you just feed the data, you know, you got your data frame, you feed it over, boom.
- 17:14And like magic happens, right?
- 17:15You've got to get that data.
- 17:17You've got to like format the data.
- 17:18You've got to convert the data.
- 17:19Like that's, you've got to understand that it's all correct, right?
- 17:22There'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.
- 17:28But yeah, I mean, I agree with that statement a lot.
- 17:30That's pretty neat.
- 17:30Thank you.
- 17:31And I linked to Randy Au's post, which is a very good post.
- 17:34I 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 data preparation is not sexy.
- 17:42Their cleaning is just grunt work.
- 17:43But, and he's trying to get people to remind people, no, actually it is the work.
- 17:47It is what actually makes a big difference in your analysis outcomes, in your machine learning outcomes.
- 17:51And I fully agree.
- 17:52Yeah, absolutely.
- 17:53All right.
- 17:53So life lesson from this one, what's the parallel life lesson you were trying to draw?
- 17:57Well, the main life lesson that I was trying to draw is actually the one below that image.
- 18:02Okay.
- 18:03So 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.
- 18:09Although food is not unimportant.
- 18:10But we've all seen these horrible pictures of like the 50s and 60s of doctors recommending cigarettes.
- 18:16Like my doctor recommends Camel, not Marlboro.
- 18:19You're like, oh my God, what is this?
- 18:20But there's like this really similar one for sugar of like all these like, here's like, how do you, you don't get overweight.
- 18:26You eat your sugar.
- 18:27So you don't eat fatty food.
- 18:28Oh my gosh.
- 18:29Anyway, so yeah, that's one is food, which is really interesting.
- 18:32But then more importantly is news, right?
- 18:34And information.
- 18:35So if you could just scroll up to the image, just in this image, right?
- 18:38We see that food is important and bad food actually makes you bad, makes you unhealthy.
- 18:43But in this image, this image is both bad food and bad information.
- 18:47There's so much bad information out there on Twitter, on Facebook or social media.
- 18:52And you really have to be careful about what you consume, right?
- 18:55Misinformation.
- 18:56I mean, it is really easy to consume, you know, this small 200 character tweets or, you know, a small empty calorie.
- 19:04I like to call them empty calories on social media.
- 19:06You know, there's empty calorie info bites, you call them.
- 19:09That's great.
- 19:09Yeah.
- 19:10There's some influencers who post really short things and, you know, they just go viral.
- 19:14And if you consume a lot of that, it actually, you think about, hey, did that actually change my life?
- 19:19No, it's actually kind of empty calories.
- 19:21And a lot of good writers, David Perel writes about this.
- 19:24It's like, you want your content to be very niche, very deep, very high in nutrition.
- 19:28So I think that's the same thing.
- 19:30When you consume light content, you don't actually gain a lot.
- 19:34It can be actually downright toxic.
- 19:35A lot of times it's light content.
- 19:36It's just one statement, you know, trying to sway information, sway the public.
- 19:39So I think for your own sake, curate what you consume.
- 19:42I agree.
- 19:43I mean, it's so important.
- 19:44And there's so many knock on effects, right?
- 19:46And it also has some interesting machine learning tie-ins.
- 19:49I would say here is some recommendation engine tie-ins.
- 19:52Yes, definitely.
- 19:53I think maybe it's, I'm not 100% sure about the attribution, but I think Tony Robbins said,
- 19:58you've got to be the guardian of your own mind, right?
- 20:00You've got to consciously decide what you let in, what thoughts you let influence you and
- 20:05what ones you just eject and say, this doesn't matter.
- 20:07Because what you think can really affect you.
- 20:11But I was thinking even more, like if I go onto YouTube and I start to consume something
- 20:15that's a little kind of crummy, but whatever.
- 20:17The very next thing is you're never intense enough for YouTube.
- 20:21If you watch three videos on one topic, like it's like you need a hundred more of these
- 20:25videos, right?
- 20:25It's just, with a lot of social media, and I don't use Facebook enough, but I can imagine
- 20:29it's similar.
- 20:30Like as you start to trend even a little bit in one way or the other, it just throws you
- 20:35a huge rope and tries to pull you hard for the sake of engagement down that path.
- 20:40And so small curves these days seem to matter a lot more.
- 20:43Like if you used to like grab, I don't know, some crummy newspaper, like a rumor newspaper
- 20:48at the grocery store and read it.
- 20:49Then you went back and you read the New York Times and you got home.
- 20:51The New York Times wouldn't just stop showing you the important news.
- 20:54It would show you all sorts of junk because you read the, but nowadays that's what happens.
- 20:58It's crazy.
- 20:59It is.
- 21:00I think a lot of it is because of just how machine learning works.
- 21:03If you click on something and you read something, it thinks that you like that thing and it recommends
- 21:07you more of that thing, which sometimes it's just a, you misclick or something and sometimes
- 21:12it's a mistake.
- 21:13And that's why machine learning and social media can sort of polarize people, which is not what
- 21:17we want to do.
- 21:18So it really takes, you need to be conscious about how you're affected by it.
- 21:22Right.
- 21:22Obviously your article is not about this, but we're going to have to reckon with this as
- 21:25a society.
- 21:26Definitely.
- 21:26Yes.
- 21:27Period.
- 21:27In a big way.
- 21:28But let's go on to lesson number two, low versus high signal data and seeking to disconfirm
- 21:34an update.
- 21:35Tell us about this one.
- 21:36So maybe I'll start with the machine learning aspect for it.
- 21:38I think what this here is a support vector machine.
- 21:41So, you know, you're trying to separate the blue dots from the red dots.
- 21:44And, you know, on the leftmost image, I mean, it's very easy to separate, right?
- 21:47So you can see the margin is very wide.
- 21:49The margin is the dash line, the distance from the dash line to the solid line.
- 21:53On the middle image, all of a sudden we introduce a new red dot and the margin becomes very narrow.
- 21:59So, you know, your certainty is a lot less and you start to think, hey, you know, maybe
- 22:02I'm less certain.
- 22:02And then on the right, and then you start to collect more information, more data points
- 22:06around that, around that.
- 22:07And then all of a sudden your margin becomes a curved margin.
- 22:09So what you thought was true and you were very certain about it on the left side of the
- 22:15image now suddenly changes to the right.
- 22:18Yeah.
- 22:18You get a little bit more information and you're like, oh, this is not the dividing line or
- 22:22the distinction at all.
- 22:23It's totally more nuanced or whatever.
- 22:25Yeah.
- 22:26Exactly.
- 22:26So I know I shouldn't be referring to the image because this is a podcast, but I think
- 22:30the image is really powerful in terms of how in machine learning, you change your decision
- 22:34boundaries.
- 22:35And in real life, this is the same.
- 22:37So I think Jeff Bezos has a very powerful quote that says, I think something like this
- 22:41that says that, I actually didn't put it here, but I'm just reminded of it that says that,
- 22:45hey, you know, when data disagrees with anecdotes, he tends to prefer the anecdotes because
- 22:51a lot of times it sort of means that maybe you're measuring things wrongly.
- 22:55So data is very easy to collect.
- 22:57We have a lot of data, but whereas anecdotes is one or two of those feedback points that
- 23:01disagrees and we sort of need to jump into an anecdote, collect more data around it.
- 23:05So I think this is the same thing.
- 23:07And when you're asking for feedback, often people give you good feedback, you know, you're
- 23:10doing great, continuing what you're doing, you're doing fantastic.
- 23:13And when people give you bad feedback, dig into it, right?
- 23:17That is a gift for you to improve.
- 23:19Dig into it.
- 23:20Ask them, hey, you know, I love what you just said.
- 23:22Can you give me more detail?
- 23:23And so it's giving you more detail, more information on how you should be thinking, how you should
- 23:28be designing, how your code should change in your code reviews.
- 23:31And it helps you grow.
- 23:33Yeah.
- 23:33I think especially in the US, people are very uncomfortable with negative feedback, both
- 23:37giving and receiving it.
- 23:38If it's given in the right way, it can be very valuable.
- 23:41I mean, maybe listening to like what people put on your YouTube video, that might not be
- 23:45all that constructive.
- 23:46There's a lot of weird, just people with issues at scale.
- 23:49But I totally agree.
- 23:50And, you know, some more close space, right?
- 23:52Like a code review or something, right?
- 23:54That's definitely an opportunity to learn something.
- 23:56Even if the person is wrong, it's still an opportunity to learn their perspective.
- 23:59Definitely.
- 24:00And learn from it, right?
- 24:01So one of the quotes you have in the section is by Karl Popper.
- 24:04True ignorance is not the absence of knowledge, but the refusal to acquire it.
- 24:09And I think that also goes hand in hand with the polarization and stuff you talked about
- 24:12before.
- 24:12I agree.
- 24:13I think that I adopt the growth mindset.
- 24:15I think that people can change, can grow.
- 24:17And that's what's necessary, right?
- 24:18In our industry, right?
- 24:19Things change so fast.
- 24:20Yeah.
- 24:21So we have to try to keep up with the times in terms of the technology.
- 24:24I think fundamentally, we should focus on the problems, but don't neglect how technology
- 24:28is changing as well.
- 24:29For sure.
- 24:29All right.
- 24:30Number three, explore, exploit.
- 24:32Balance for the greater long-term reward.
- 24:34It has to do with reinforcement learning, right?
- 24:36Yeah.
- 24:37So in reinforcement learning, well, you can imagine that at a start, you don't know anything
- 24:41about the state of the world, right?
- 24:42Let's say you have two, this is an example for me.
- 24:46Let's say you have a restaurant that you love.
- 24:48Let's say you first landed in Seattle.
- 24:49When I first landed in Seattle, I didn't know where to eat.
- 24:51I didn't know what was good.
- 24:52And I would explore many different restaurants, many different takeouts.
- 24:56And after exploring, after maybe I explored 10 of them, I found that, hey, you know, this
- 25:01place is great.
- 25:01It's cheap.
- 25:02It's nearby.
- 25:03The food is solid.
- 25:03And I would just exploit it all the time.
- 25:06Exactly.
- 25:06Like in my neighborhood, there's maybe two or three Thai food restaurants that I always
- 25:11go to.
- 25:11And if somebody says, hey, let's get some Thai food, I'm not going to go, well, there's
- 25:14another one we haven't tried yet.
- 25:15Let's go to, it's just like, nope, that one's good.
- 25:17We're going here.
- 25:18You know what I mean?
- 25:18I am exactly like that.
- 25:20I'm such a lazy thinker.
- 25:21Yeah.
- 25:21And I just like, this is really good.
- 25:24It's my appetite.
- 25:25It fits my taste.
- 25:26And it's cheap.
- 25:27Why do we have to try something new?
- 25:28But thankfully, my wife is an explorer.
- 25:31So while I'm exploiting, she encourages me, you know, let's explore these new things.
- 25:36And sometimes I find treasure gems that I would never have tried.
- 25:40But because she's encouraging me to explore, I found it.
- 25:44Yeah.
- 25:44So that's a balance.
- 25:46So at the start of your career or at the start when you're trying to solve a new problem,
- 25:49explore.
- 25:50Take some time to explore as much as you can.
- 25:52But then once you find it, exploit.
- 25:54But you know, as you're exploiting, don't forget to also be exploring a bit.
- 25:58Yeah.
- 25:58So you tie this back to careers a lot about basically, as you sort of touched on, continuous
- 26:03learning and, you know, don't get too comfortable and it just go with, don't just fall all the
- 26:09way into the exploiting side.
- 26:11Like I went to college, I got my engineering degree.
- 26:13Why do I need to learn Jupyter?
- 26:15I'm just going to keep using MATLAB or Excel and we're just going to keep working on this
- 26:19building or bridge or whatever.
- 26:20Right.
- 26:20Like I think it's easy to do that.
- 26:22I spent the time and the money and worked hard and got good grades and a four year degree.
- 26:26Why do I need, I'm done with tests and learning.
- 26:29I can just stop.
- 26:29Right.
- 26:30Exactly.
- 26:30I was just going to say this exact same, a very similar example.
- 26:34I studied SPSS and R in college.
- 26:36Why do I need to learn Python?
- 26:37Right.
- 26:38Well, you know, Python has a lot of benefits.
- 26:39It's a lot faster.
- 26:40And then, you know, now that I learned Python, I know SQL, why do I need to learn Spark?
- 26:45But, you know, if you explore a bit, it can really help you make your work a lot more
- 26:50effective.
- 26:50Maybe I know decision trees and linear regressions.
- 26:52Do I really need neural networks?
- 26:54But, you know, it's always taking some time to explore about, explore what might be new.
- 26:58Sometimes some of this exploration doesn't work out and that's fine.
- 27:02If you think of it from a learning perspective, you're learning a lot, but take the time to
- 27:05sample around every now and then.
- 27:07Yeah, absolutely.
- 27:07You have a couple of great quotes in here from two people.
- 27:11I find both of them very interesting.
- 27:12Naval, Silicon Valley guy that just goes by Naval, N-A-V-A-L.
- 27:17And he has a really interesting wheat storm that turned into a podcast series and some interesting
- 27:23thinking.
- 27:23Are you familiar with this?
- 27:24Oh, yes.
- 27:24I love that.
- 27:25Yeah, I do too, actually.
- 27:26It may be reading your articles and stuff.
- 27:28It reminded me of that.
- 27:29But he says your goal in life is to find out the people who need you the most, to find
- 27:33out the businesses that need you the most, to find the projects and the art that need
- 27:37you the most.
- 27:38There's something out there for you.
- 27:39And then Matthew McConaughey talks about when he was going, he was in law school and decided
- 27:45to go into film school, which is obviously a big career switch, somebody.
- 27:49And he's like, no, no, I have to do this.
- 27:50Right.
- 27:50And he was afraid of what his dad would say.
- 27:52And instead of saying you've thrown away your career or whatever, he just said, don't
- 27:57half-ass it.
- 27:57Like, if you're going to do this, you better go do it.
- 27:59Right.
- 28:00So that's sort of the, Naval's is the explore, McConaughey's, maybe it's the exploit.
- 28:04Like once you're in it, go in it full.
- 28:06Exactly.
- 28:06That being said, I mean, a lot of us, maybe we are a couple of years in our careers, but
- 28:11I think what Naval tries to remind us, you might not be very happy what you're doing right
- 28:15now, or you might love what you're doing right now, but there's always something that
- 28:19suits you specifically.
- 28:21So some people might love research and they might not fit into a startup environment.
- 28:25Or some people in a, for example, maybe a big innovation lab, they need some of their
- 28:31data scientists to really focus on research and they might not fit in there.
- 28:34If the data scientist is more about iterating fast and, you know, shipping fast to customers.
- 28:37So there's always something better for you.
- 28:39So keep exploring.
- 28:41And once you found it, exploit it like Matthew McConaughey.
- 28:43He didn't half-ass it.
- 28:45He ran all in and he's doing fantastically well.
- 28:47Yeah.
- 28:47It worked out okay for him.
- 28:49Yeah.
- 28:49Yeah.
- 28:49Nice.
- 28:51All right.
- 28:51Transfer learning.
- 28:52Books and papers are cheat codes.
- 28:54Yeah.
- 28:55So in machine learning, I think a couple of years ago, there was this thing called transfer
- 29:00learning, which it didn't make quite a stop, but I thought it was really breakthrough.
- 29:03So what it means is that there's this competition called ImageNet, where you try to classify images
- 29:08into thousands of categories, right?
- 29:10I think 1,000 categories.
- 29:12And those big companies like Google, Microsoft, they would train huge models to classify this.
- 29:18And this would be deep neural networks.
- 29:19And what people found is that you can take what they have trained, this huge model with
- 29:24all the weights and parameters, and you can just chop off the last layer and put your own
- 29:29model.
- 29:29Maybe you're trying to classify cat versus dog.
- 29:31You can use that model and then classify cat versus dog and put in your own data and just
- 29:36update the model.
- 29:37And it would work fantastically well.
- 29:40And all those of magnitude better than if you had to train from scratch.
- 29:43Wow.
- 29:43Yeah.
- 29:44I think that's a cheat code.
- 29:45I use that when I first heard about it, I use that cheat code.
- 29:47Okay.
- 29:48Since I've heard about it, I've only used transfer learning for work as much as I can.
- 29:52If there's a transfer learning model.
- 29:53Yeah.
- 29:53So the idea is you, instead of starting with a completely blank set of weights in your model
- 29:58and just feeding data and going, no, that's right.
- 30:00That's not right.
- 30:01That's a dog.
- 30:01That's not a cat.
- 30:02No, that's yes.
- 30:03That one is a cat.
- 30:03Good job.
- 30:04You can use kind of a vague one to automate some of that driving.
- 30:08Is that kind of the idea?
- 30:09Like you give it a little bit of knowledge, but not too much.
- 30:11And then you keep still teaching it.
- 30:13Is that this model is able to distinguish a thousand different cats and dogs and hamburgers
- 30:18and cars.
- 30:19Yeah.
- 30:19And you're just taking all that knowledge that's in there and you're just fine tuning
- 30:23it for your specific use case of cat versus dog.
- 30:26And it really cuts out so much effort.
- 30:28Yeah, absolutely.
- 30:29Very, very cool.
- 30:30So in this one, the life lesson here is we were touching this before that people feel
- 30:34like a lot of times they've gotten, they've got their degree, they've studied, they've
- 30:37worked hard.
- 30:37Like they just want to have fun and live their life and not just keep going.
- 30:40But like the way to think of education, formalized education, let's say, even I would say college
- 30:46is this generalized pre-training, right?
- 30:49You're not ready to really go do the thing.
- 30:50You haven't really learned the thing, but you're much closer than somebody who hasn't, right?
- 30:55Something like that.
- 30:55Schools, generalized pre-training.
- 30:57Yes, I fully agree.
- 30:58I think a lot of people think that at least what I've seen, some people see that after
- 31:03they graduated, I'm done learning.
- 31:05But I don't know about you, but after I graduated, after I got into working world, I realized,
- 31:09hey, I didn't learn any of this stuff.
- 31:11Yeah.
- 31:11In the working world, I had to learn a lot more.
- 31:14Almost none.
- 31:15I think the only thing that I learned at school that helped was Excel and R and SPSS, the technical
- 31:20skills.
- 31:20So school sort of trains, you know, teamwork, how to work in a project team, communication,
- 31:26how to learn fast because, you know, every semester you'll be taking four subjects.
- 31:30It teaches you the general stuff.
- 31:31And then once you get to work, there's a lot of on-the-job training that you have to do yourself.
- 31:35So the point that I was trying to make here is that school is really just the start of
- 31:40it.
- 31:40It's generalized pre-training.
- 31:41You could stop there.
- 31:42But if you fine-tune, if you take the effort to fine-tune your model from school onto your
- 31:48very specific tasks, you would be orders of magnitude more effective.
- 31:52That's the message I'm trying to give.
- 31:53And I also want to tell people, and this is the next paragraph, is that we have transfer
- 31:58learning models, right?
- 31:59And in real life, that's the same thing for transfer learning models, which is books and
- 32:04academic papers.
- 32:05I want to try to get people to read more books.
- 32:08I've gained a lot from books.
- 32:10I've gained a lot from academic papers.
- 32:12And you can imagine, I don't know, maybe you read a book by, I don't know, Sapiens by
- 32:16Noah Harari or Deep Work by Cal Newport, who I'm a big fan of.
- 32:21They have thought about this on the Vals, Naval's thread, right?
- 32:24They have thought about this for so long, five years, decades, and they have compressed it in
- 32:29a book that you can read in eight to 10 hours.
- 32:31Read it and you'll be that much smarter.
- 32:34And you'll see life in a different way and you'll gain a lot.
- 32:37Yeah, that's super interesting.
- 32:39I do agree with it that you don't necessarily have to agree with everything they say.
- 32:42It doesn't have to match your situation, but it does give you a whole lot more experience
- 32:47without going through the hardship of getting that experience.
- 32:50Exactly.
- 32:50And I think it's magic.
- 32:52Yeah.
- 32:52That's what separates human beings from animals, right?
- 32:55Where we can transfer knowledge.
- 32:56We can perform telepathy.
- 32:58I can transfer knowledge to you, to anyone on the internet by writing.
- 33:02And people do that through books in the past.
- 33:04Yeah, very interesting.
- 33:05So that's magic.
- 33:06So you say books are the weights and biases of the great thinkers who've come before us.
- 33:11That's pretty awesome.
- 33:14This portion of Talk Python To Me is sponsored by Linode.
- 33:16Simplify your infrastructure and cut your cloud bills in half with Linode's Linux virtual machines.
- 33:20Develop, deploy, and scale your modern applications faster and easier.
- 33:25Whether you're developing a personal project or managing large workloads, you deserve simple, affordable, and accessible cloud computing solutions.
- 33:32As listeners of Talk Python To Me, you'll get a $100 free credit.
- 33:36You can find all the details at talkpython.fm/Linode.
- 33:40Linode has data centers around the world with the same simple and consistent pricing regardless of location.
- 33:46Just choose the data center that's nearest to your users.
- 33:49You'll also receive 24-7365 human support with no tiers or handoffs regardless of your plan size.
- 33:56You 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.
- 34:06If it runs on Linux, it runs on Linode.
- 34:08Visit talkpython.fm/Linode or click the link in your show notes, then click that create free account button to get started.
- 34:16On this, I wanted to ask you about what you thought about, quote, new media, right?
- 34:22Like, I'm thinking in particular YouTube, but other places, right?
- 34:26Like, these books are very, like, the tradition of meaningful books are very important and long, and everybody knows about them, right?
- 34:33But, you talked about the MOOCs before.
- 34:35I mean, YouTube, I was talking about the negative aspects of it before, but there, 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.
- 34:46Like, there's so much good stuff there mixed in with, like, cat videos, right?
- 34:52Yeah.
- 34:53What do you think?
- 34:53I think that I am ambivalent to it.
- 34:57I think I have a preferred way of learning, which is to read books.
- 35:00Nonetheless, I know that video is awesome in the sense that I can write some code, I can iterate, and you can see me doing it.
- 35:05It's almost impossible to convey that in a book, maybe some code examples.
- 35:09So, that's really amazing.
- 35:11I 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.
- 35:19A lot more powerful.
- 35:20It can be powerful for good, and also powerful for not so good.
- 35:23A lot more powerful in the sense that, you know, MOOCs are amazing, right?
- 35:26A professor can teleport into your house and teach you.
- 35:29That's powerful.
- 35:30But powerful for not so good in the sense that we have things like that reduce your attention span, TikTok videos, or short snippets of articles that it's also very powerful.
- 35:39It's just whether it's for good or not so good.
- 35:42So, that's something to think about when you're using new media to learn.
- 35:46It is.
- 35:46It's definitely more risky in that you can get distracted and pulled away because all those places are about that for sure.
- 35:52You 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.
- 36:04And I'm like, I appreciate both of those art forms way more having seen, like, that experience.
- 36:10And I would never have that experience.
- 36:12Exactly.
- 36:12And I would never go down to the bookstore and pick up a book on, like, singing theory and stuff.
- 36:17I just wouldn't, right?
- 36:19I would find something else to spend my time on.
- 36:21But anyway, like, those are the kinds of things I'm thinking that you just, you wouldn't expect.
- 36:24But you can find interesting things there, right?
- 36:26Definitely.
- 36:27Definitely.
- 36:27Hey, I want to go back really to this one really super quick because I skipped over it right at the end.
- 36:32But you talk about this exploring versus exploitation thing and saying, look, you don't always have to worry so much about this stuff because sometimes many things are what you call two-way doors.
- 36:42And there's this interview over here of Jeff Bezos.
- 36:45And he has this distinction of some decisions being two-way doors and some of them being one-way doors.
- 36:51And you shouldn't put about the same concern, worry, energy, and whatnot into both types of decisions.
- 36:57They're not equal, so don't treat them equal.
- 36:58Can you speak to that real quick?
- 36:59I thought that was super interesting.
- 37:01Yeah.
- 37:01I'm just going to use Jeff's example.
- 37:03For example, maybe you're doing a side hustle and someone wants to acquire it or someone wants to completely purchase it from you.
- 37:10That's a one-way door that, you know, after you sold it, there's no way to reverse it, right?
- 37:13Yeah.
- 37:14So, however, you know that maybe you start a side hustle and then maybe you're thinking, hey, should I be targeting Python programmers or R programmers or, I don't know, Scala programmers?
- 37:24That's a two-way door.
- 37:26You can easily pivot.
- 37:27So, I think what Jeff is saying is that the one-way door, very difficult to reverse, but it's a lot less.
- 37:33It happens a lot less.
- 37:34And a lot of us, a lot of people treat two-way door decisions as one-way door decisions.
- 37:39And I think he's saying that, hey, you know, it's good to distinguish between both and devote the amount of energy and due diligence and analysis into each of this.
- 37:48And that makes you help you make more effective decisions more efficiently.
- 37:53Yeah.
- 37:53I totally agree.
- 37:54I thought this was, like I said, I thought this was insightful.
- 37:57And I feel like in programming and in code, a lot of people get stuck in the so-called analysis paralysis.
- 38:04They're just stuck, like, trying to decide.
- 38:06Like, 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.
- 38:12You don't have enough experience.
- 38:13Like, so much of those things, you can just, oh, we'll just refactor this later.
- 38:16Or we can just throw away this later.
- 38:17Like, oh, I'm going to use a relational database.
- 38:19Oh, we should have used a NoSQL database.
- 38:21We'll just throw it away and switch it over.
- 38:23It's, like, probably not that big of a deal versus we're going to let all the Python guys go and hire a bunch of Java guys and rewrite the whole thing.
- 38:30Like, if you're a year into that decision, you're fairly committed, right?
- 38:33Like, 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.
- 38:40Fully agree.
- 38:40And that's hopefully by understanding the difference between one-way door and two-way doors, it makes it easier to explore, right?
- 38:46Yeah.
- 38:46Yeah.
- 38:47I agree.
- 38:47I think that's worth calling out.
- 38:48All right.
- 38:49Iterations.
- 38:49Find reps you can tolerate and iterate fast.
- 38:52So I think machine learning, a lot of machine learning involves iteration.
- 38:55Clearly, neural networks are iterations.
- 38:57Every time you pass the data through multiple epochs and the data learns, with each iteration, with each epoch, the machine learning model error reduces.
- 39:06Machine learning gets model, provides better predictions and gets more accurate with your metrics.
- 39:11That is the same with life.
- 39:12I think a lot of people expect, this is what I used to expect.
- 39:16I expected that I would read something once and I would fully understand it.
- 39:19All of the knowledge is in my brain.
- 39:21And then, you know, I realized that that is never true.
- 39:23So, and actually, that actually lowers my expectation of myself.
- 39:27You know, sometimes I'll read a paper and then, you know, I'll try to discuss it and realize I don't actually know the details.
- 39:32That lowers expectation of myself.
- 39:33You know, I tell myself, Eugene, by reading it once, you're never going to get it.
- 39:37Yeah.
- 39:37Don't fully expect yourself to that.
- 39:39It's too high a bar.
- 39:40So maybe read it a few times.
- 39:42Be kinder to yourself.
- 39:43So that's the same thing.
- 39:44When I read papers, I go through it multiple times.
- 39:47When I do A-B tests, I fail two times for every one time I succeed.
- 39:52So I feel like 50 to 75% of the time.
- 39:54And you just got to learn to be kinder with yourself where you iterate, right?
- 39:58I think I've posted some examples here.
- 40:00The Angry Birds developers failed 51 times.
- 40:03Sir James Dyson failed 5,000 times in 15 years before a vacuum cleaner work, right?
- 40:09And, you know, imagine if he gave up, we would never have that.
- 40:12Yeah, yeah.
- 40:13But again, a lot of great examples here about people who just iterated and just stuck to it.
- 40:17I think it also sort of ties into the previous one, right?
- 40:20The two-way doors.
- 40:21It's okay if it doesn't work on a lot of these types of things.
- 40:23Just keep going.
- 40:24Just try again, right?
- 40:25Eventually, you'll find one that fits, yeah?
- 40:27Exactly.
- 40:27Yeah.
- 40:28Speaking of fitting, overfitting, focus on intuition and keep learning.
- 40:31So I think overfitting is, well, I guess it's overfitting is when your machine learning model
- 40:36memorizes the training set too much and can't predict well on the prediction set.
- 40:40Right.
- 40:40It's almost perfect on the training set.
- 40:42Like it knows that it's cold, but it's so specific that any slight variation, even though
- 40:46it should be a dog, it doesn't know it's a dog.
- 40:49Exactly.
- 40:49An example of this is when your machine learning model learns on customer IDs.
- 40:53And, you know, when new customer IDs come in, it's just crap.
- 40:57So I think the clearest, the person who really pushes for this is Richard Feynman.
- 41:01He says that there's no, and the way he teaches math and physics is the same.
- 41:04He goes directly into intuition.
- 41:06Forget about formulas or forget about memorizing stuff.
- 41:09If you understand the intuition, you will understand it better and you can generalize across
- 41:15many, many things.
- 41:15I think in life, it also makes the same sense.
- 41:18Don't try to memorize things or don't try to memorize knowledge, right?
- 41:22I think if you have the intuition of the fundamentals, you'll find that it transfers across many,
- 41:28many different domains.
- 41:29For example, I think Elon Musk talks about knowledge as a tree.
- 41:32So, you know, the fundamentals of the tree are the trunk.
- 41:35That thick trunk is the fundamentals that supports all the branches.
- 41:38You want to make sure that the intuition is like the trunk.
- 41:41You want to make sure that your trunk is solid and then you can build on new branches or cut
- 41:45off new branches and grow new branches as necessary.
- 41:47So I think the way to grow this intuition, at least for me, I find that being a beginner
- 41:52is the best way to do this.
- 41:53Yeah, absolutely.
- 41:54Okay.
- 41:54Very interesting.
- 41:55A last one has to do with ensembles and ensembling.
- 41:58Diversity is strength.
- 42:00What is ensembling?
- 42:01Yeah, I guess ensembling is that I could train a model, maybe a linear regression and another
- 42:06model, maybe a decision tree and then another model, maybe a k-nearest neighbors.
- 42:09And they would all have their different errors.
- 42:12They would all have the different biases and strengths.
- 42:13But the unusual thing in machine learning is that, you know, you can just take all their
- 42:17predictions and average them and they would do better than all of them combined.
- 42:21And actually that's a cheat code that everyone is doing on Kaggle competition.
- 42:25You just train thousands of models and just combine all of them.
- 42:29It reminds me of like a much simpler example.
- 42:32There's sort of the wisdom of crowds.
- 42:34Like you hear stories of people saying, look, here's a jar, a big glass jar full of jelly
- 42:39beans.
- 42:39You got to guess how many jelly beans there are.
- 42:41Like many, any given person will over underestimate a whole lot.
- 42:45But if you ask a hundred people, it's usually really close to the actual number.
- 42:48Or there's some weird examples of this at like state fairs, there'll be like a cow and people
- 42:53have to ask like, how much does the cow weigh?
- 42:56You know, it's like a competition and people get it really wrong.
- 42:58But it's usually really close if enough people answer and participate and it's average, right?
- 43:03Exactly.
- 43:03So having diversity, diversity of opinions, diversity of thoughts, I think is very powerful.
- 43:08Yeah.
- 43:09So that's what I'm trying to encourage here as well.
- 43:11Yeah.
- 43:11So what's the story about life here instead of like guessing the way to cows, which is not
- 43:15all that practical.
- 43:16Well, I think that one way, okay, maybe a quick one, which is one way to do when you are trying
- 43:21to build teams is you might want to deliberately try to find people which are different from
- 43:27you, right?
- 43:27which complement your strengths.
- 43:29Sometimes in tech interviews, we want to find people that are similar to us, have the
- 43:33same skill sets that, you know, fit this mold, fit this job description.
- 43:37That's useful.
- 43:38It's effective.
- 43:39But I personally have built teams whereby it's very diverse, maybe from different countries
- 43:43or one third female.
- 43:45And I found that the creativity that comes from this is really powerful.
- 43:49And the other one, which is, I think, of course, Scott Adams is known for this.
- 43:52He says that, you know, if you can't be the top of your field, combine multiple superpowers
- 43:56like Scott Adams did.
- 43:57He combined his ability to draw, his sense of humor and his business know-how and he created
- 44:01Dilbert, which is no one else can replicate Dilbert.
- 44:05It needs someone like Scott Adams to do that.
- 44:07Yeah.
- 44:08You know, that general idea, I actually hit on this a lot because there are a lot of people
- 44:12who listen to this show who are not traditional computer science developers, traditional data
- 44:16science folks.
- 44:17And I think sometimes they feel like they don't have quite the same skill set to compete with
- 44:23those people.
- 44:23And how are they going to compete with somebody with a master's degree from Stanford in computer
- 44:27science?
- 44:27And what I, my thought on all this is, you look, if you're really good at economics and
- 44:33you're pretty good at programming, there's not too many people who have both of those skills,
- 44:36right?
- 44:37Like all of a sudden you go from competing with a hundred thousand down to like 500 or something.
- 44:41I don't know.
- 44:42Not that maybe it's a little bit extreme, but you know, like the, if you need that intersection
- 44:45of skills, all of a sudden it becomes super powerful.
- 44:48And what you're suggesting here is maybe like building teams.
- 44:51You can kind of build that in the team rather than in an individual.
- 44:54Exactly.
- 44:55And I want to go back to your previous example, someone who's maybe decent programmer, but,
- 44:59you know, can't compete with someone who graduated with a degree in, degree in CS and a
- 45:03master's in CS and PhD in CS.
- 45:04It goes back to Naval's tweet, right?
- 45:07There's something that is just right for you that can tap on your skills in economics and
- 45:12comm science.
- 45:13You just need to find it and that'll be a great fit.
- 45:15Yeah, absolutely.
- 45:16All right.
- 45:17Well, that was the seven items and I, you know, I enjoyed thinking about them and just seeing
- 45:22how these machine learning examples maybe can be analogies for living life.
- 45:27It's pretty cool.
- 45:28Thank you.
- 45:28Yeah.
- 45:29Yeah, absolutely.
- 45:30So a couple of other things real quick that you've spoken about is you've written a couple
- 45:33of things on sort of productivity as a developer and in the tech field.
- 45:38One article called how to accomplish more with less useful tools and routines.
- 45:42And then also routines and tools to optimize your day, which is a guest post by Susan Hsu.
- 45:48Yep.
- 45:48So those are really interesting.
- 45:50But in particular, during one of them, I don't remember which one you talk about this article
- 45:56by Paul Graham and Paul Graham wrote this thing called maker's schedule versus manager's schedule.
- 46:03And, you know, I think you talk a lot or we talk in the tech field a lot about getting into flow,
- 46:08really programming and just having uninterrupted time.
- 46:12And yet I think probably more than ever, people are being pulled in different directions because
- 46:17everyone is just a Zoom call away.
- 46:19It's not even if you're not in the office, you're now just as eligible to be sucked into a meeting
- 46:23as anyone else.
- 46:24Right.
- 46:24Yep, definitely.
- 46:26Yes.
- 46:26Can you talk real quickly about this?
- 46:27Because I think it's a short article, but I think having awareness of this idea of a maker's
- 46:32schedule and a manager's schedule and how they're not super compatible and you got to be careful
- 46:37to help them coexist.
- 46:38I think that's important.
- 46:39Yeah.
- 46:40So I think that, of course, all credit goes to Paul Graham for this.
- 46:43So makers to even start to design something or to start to code a framework, you sort of
- 46:48need, I don't know about you, but it takes me like 30 minutes to warm up, to have to load
- 46:52all the concepts into my memory so I can start juggling them in my head.
- 46:55And then, you know, once I load all that into my head and then I can, okay, I can start
- 46:58writing pseudocode, you know, tweaking things, testing things iteratively.
- 47:02And that takes time.
- 47:03And it takes me maybe about 45 minutes, 60 minutes to get into flow.
- 47:07And once I'm in the flow, I'm moving really quickly, like speeding things through or once
- 47:11I'm in the flow of, you know, fixing a bug.
- 47:12And I don't know about you, but if I don't fix the bug, I can't stop.
- 47:16I can't go for lunch.
- 47:16And that motivation, that drive, if someone pulls me into a meeting, it sort of kills the
- 47:21motivation sometimes for the day.
- 47:23And, you know, if you had continued for just 30 minutes, you would have fixed it.
- 47:27But if it's broken by something in the middle, you'll be gone.
- 47:31So how I try to do this is that I actually deliberately block my time in the morning before
- 47:36lunch.
- 47:37I actually block it out with meetings, my own meetings, so that I can actually use that time
- 47:40to get in the flow.
- 47:41Depends on when your energy level is highest.
- 47:43For me, it's actually in the morning.
- 47:44And then I actually have, I say that when people want to ask for a meeting, I say, oh, sure,
- 47:48let's do it after 3 p.m.
- 47:49If you're okay with it.
- 47:50Because after 3 p.m., I mostly can't do deep work anyway.
- 47:53So I think that's useful to be aware of.
- 47:55Yeah, it's really interesting.
- 47:56And I agree with that.
- 47:57Paul talks about if you're on a manager's schedule, what you do?
- 48:01You go from meeting to meeting to meeting.
- 48:02And if you've got an hour gap in your day, you know, oh, you could just meet with somebody
- 48:06else.
- 48:06Maybe that's like a time to just set up a meeting so you could get to know somebody and dig in
- 48:10with that person or the team or the project.
- 48:12And that's fine if you're on a manager's schedule.
- 48:15But if you're on the maker's schedule, maybe you do need the whole morning uninterrupted so
- 48:19that you can get into that.
- 48:20You know, like, you know, you've had a good session when, you know, you've been programmed,
- 48:25program, and then you stop for a second.
- 48:26And you're like, wow, I'm hungry.
- 48:28I really have to go get sick.
- 48:29It's like three in the afternoon.
- 48:31I forgot to eat lunch.
- 48:32Like, that's totally possible that that happens, right?
- 48:34And I would just want to say that these sessions feel so fulfilling, feel so satisfying.
- 48:38You feel like you've gotten so much work done in such a compressed amount of time that, okay,
- 48:43and now you can, sure, I can have office hours now.
- 48:46So those sessions are really fulfilling.
- 48:47Yeah.
- 48:48I don't know how this is going to work out.
- 48:49But after reading this and some of your other writing, I decided on my calendar, I'm just
- 48:54blocking, like, Tuesday and Friday, like, all day.
- 48:57And I'm just going to call those maker days.
- 48:58We'll see how that works out.
- 48:59Wow.
- 49:00And if I can just, like, get a lot of stuff done.
- 49:01So other days, I'll have more meetings.
- 49:03We'll see.
- 49:03I don't know.
- 49:04I'm looking forward to hearing your experience.
- 49:05Yeah, absolutely.
- 49:06And Chris May.
- 49:07Hey, Chris.
- 49:08Out in the live stream says, personal productivity brings superpowers to the powers you got by learning
- 49:12Python.
- 49:13Totally agree.
- 49:13Yep.
- 49:14Yeah, awesome.
- 49:14Very, very cool.
- 49:15All right.
- 49:16Well, I think that's probably about all the stuff that we have time to talk about.
- 49:20Although, maybe really quickly, you could touch on the bottom of your homepage.
- 49:25You've got a bunch of resources.
- 49:26Maybe just highlight something you think that people would find valuable there.
- 49:29So, yeah, I like to, again, a lot of these answering questions that people ask me.
- 49:33So people ask me, you know, what your favorite papers are?
- 49:35What paper should I read?
- 49:36So that's the second one on the list, Applied ML, where, you know, I try to collect papers on
- 49:41real-world machine learning by companies that have implemented it.
- 49:44The lessons they learn.
- 49:45And, you know, sometimes people ask me, you know, wow, I'm starting to get into this field.
- 49:48There's so much to learn.
- 49:49And that's the third link there, where I find machine learning surveys, where, you know,
- 49:53people summarize what has happened in the past.
- 49:55And, of course, you know, people ask me things like, you know, how do you set up your Python
- 50:00repo so that you have code reviews and all that automatically or linting?
- 50:03So I have things like, you know, the Python collab template or, you know, how to test machine
- 50:07learning models.
- 50:08And, of course, recently I wrote about how to write machine learning design docs, design documents
- 50:14and, of course, I have that as well.
- 50:15So, you know, I mean, some of these are Git repos.
- 50:17Some of these are just articles.
- 50:19And, of course, there's the email course, which is a lot of people ask me, you know, what makes
- 50:23an effective data scientist?
- 50:24This is the question I ask a lot of my mentors five years ago.
- 50:28And I try to summarize the five lessons that I've learned in a short email course where I only
- 50:34send you one lesson a day.
- 50:35And, of course, there's a short exercise that I hope people will do.
- 50:39And that's why I send you one lesson a day.
- 50:40And that short exercise maybe takes an hour each.
- 50:42And I hope that after this, it sort of opens your mind that, you know, being an effective
- 50:46data scientist is beyond coding well, is beyond PhD level research, is beyond math.
- 50:52Cool.
- 50:52Yeah, that looks really useful.
- 50:54And you also have a Papermill-MLFlow.
- 50:57What do you think of Papermill?
- 50:58I started using this because I wanted to run rapid experimentations in Jupyter notebooks.
- 51:04And MLFlow is something that, you know, helps you track your machine learning models.
- 51:08Papermill allows you to parameterize.
- 51:10At least how I'm using it is I'm parameterizing my Jupyter notebooks.
- 51:13By combining both of them, I have a master Jupyter notebook that has all the different params
- 51:18and all the different countries and marketplaces.
- 51:20I just run that huge Jupyter notebook and all the experiments are logged.
- 51:23So I love it.
- 51:24So I decided to make it a template that other people can use as well.
- 51:27Well, yeah, people can check out all those things.
- 51:29Put them in the show notes also on your website.
- 51:31All right.
- 51:31Well, I think that's probably it for all the time we have.
- 51:34So let me ask you the final two questions before you get out of here.
- 51:37You've written about two options.
- 51:38So I don't know which one you're going to go with here.
- 51:40But you're going to write some Python code outside of Jupyter, say, like what text editor
- 51:44do you use?
- 51:44I have an answer.
- 51:45And I'm curious about your answer as well.
- 51:47For me, I'm a diehard PyCharm fan.
- 51:49I've tried using VS Code.
- 51:51Just doesn't feel as snappy, as IntelliSense as you think.
- 51:55I've been using VS Code for my JavaScript.
- 51:57But what's your take, Michael?
- 51:58Should I be using VS Code more?
- 52:00Look, I'm a fan of people doing VS Code.
- 52:02And I know a lot of people love it.
- 52:03The style of PyCharm is exactly, it just fits my brain.
- 52:06Like, I feel that it just so perfectly understands the project I'm working on, that it's the right
- 52:12tool for me as well.
- 52:13That's me.
- 52:13And I do some Scala on the side.
- 52:16And PyCharm has a Scala sister, which is IntelliJ.
- 52:18And it's just me that I'm still a diehard PyCharm fan.
- 52:21Yeah, right on.
- 52:22And then notable PyPI project or package that something out there, maybe not the most popular,
- 52:28but you're like, oh, I found this thing and it was super helpful.
- 52:30Well, off the top of my head, I cannot think of anything, honestly.
- 52:33But one thing that I love, that I hope people will love, is pytest.
- 52:37Yeah.
- 52:38All right.
- 52:38Yeah, pytest is super good.
- 52:39Yeah, let me throw out an example for you.
- 52:41Along with this pytest idea, something that I came across recently is great expectations,
- 52:47which is kind of like automated testing for the data cleaning and data validation,
- 52:51both when you're pulling it in the first time as well as like production.
- 52:54So there's a one to build on top of the pytest story.
- 52:57Exactly.
- 52:58So as of now, the things that are top of my mind, pytest, PyLint, mypy,
- 53:02the things that make code manageable and maintainable, I think about that a lot.
- 53:06Yeah, fantastic.
- 53:07All right.
- 53:08Well, that's it for all the stuff we've got to cover.
- 53:11Eugene, thank you for being on the show.
- 53:12Final call to action.
- 53:13People are, maybe they want to get into your writing or they want to start writing and
- 53:16thinking more, sort of almost become a developer philosopher type.
- 53:20So what advice you got for them?
- 53:21Just stop writing.
- 53:22Final advice.
- 53:23Why write?
- 53:24Like, okay, by writing, you put your stuff online and people find you.
- 53:27And this is why this podcast even happened, right?
- 53:29Michael found me through my writing and we talk about and we find like-minded people.
- 53:33That has happened to me.
- 53:34I find so many like-minded people talking to me about machine learning and systems and writing.
- 53:39And I've made so many new friends.
- 53:40Do that.
- 53:41And you'll make a lot of new friends online.
- 53:43Highly recommend it.
- 53:44Yeah, it's great advice.
- 53:45I find like stepping just even a tiny bit outside of your comfort zone starts to lead
- 53:49to other things.
- 53:50And maybe you're not doing writing.
- 53:51Maybe you're speaking at a meetup.
- 53:53That's even more possible than it used to be because you don't have to travel anymore,
- 53:56right?
- 53:56You can reach out to meetups that are not next to you and so on.
- 53:59All those things make huge differences.
- 54:01Definitely.
- 54:02Highly recommend.
- 54:02And if you write because of this podcast, email me.
- 54:06My email is on my website.
- 54:07I would love to read what you wrote about.
- 54:09Oh, fantastic.
- 54:09All right, Eugene, thank you for being on the show.
- 54:11It's been really great to chat with you about all this stuff.
- 54:13Welcome.
- 54:13It's my pleasure.
- 54:14Take care.
- 54:15Pat, take care.
- 54:15This has been another episode of Talk Python To Me.
- 54:19Our guest on this episode was Eugene Yan, and it's been brought to you by Retool and Linode.
- 54:24Supercharge your developers and power users.
- 54:27Let them build and maintain their internal tools quickly and easily with Retool.
- 54:31Just visit talkpython.fm/retool and get started today.
- 54:36Simplify your infrastructure and cut your cloud bills in half with Linode's Linux virtual machines.
- 54:41Develop, deploy, and scale your modern applications faster and easier.
- 54:44Visit talkpython.fm/Linode and click the Create Free Account button to get started.
- 54:49Be sure to subscribe to the show.
- 54:52Open your favorite podcast app and search for Python.
- 54:54We should be right at the top.
- 54:56You can also find the iTunes feed at /itunes, the Google Play feed at /play, and the
- 55:01direct RSS feed at /rss on talkpython.fm.
- 55:06We're live streaming most of our recordings these days.
- 55:08If you want to be part of the show and have your comments featured on the air, be sure to
- 55:13subscribe to our YouTube channel at talkpython.fm/youtube.
- 55:16This is your host, Michael Kennedy.
- 55:18Thanks so much for listening.
- 55:19I really appreciate it.
- 55:21Now get out there and write some Python code.
- 55:22I'll see you next time.