Latest / CyberSecurity Summary / Doing Data Science: Straight Talk from the Frontline
Transcript
- 0:00Speaker 1: Okay, let's unpack this today. We're embarking on a deep
- 0:03Speaker 1: dive into the fascinating, sometimes maybe often hyped, but fundamentally
- 0:09Speaker 1: important world of data science.
- 0:11Speaker 2: Definitely hyped at times, right, But.
- 0:13Speaker 1: Our mission here is really to demystify what data science
- 0:16Speaker 1: truly is. We want to explore its core processes, the
- 0:19Speaker 1: essential tools, and also confront some of the well the
- 0:22Speaker 1: critical real world challenges that come with working with data.
- 0:25Speaker 2: And the ethical ones too. They're huge.
- 0:27Speaker 1: Absolutely. We'll be drawing our insights primarily from Rachel Schutt's
- 0:31Speaker 1: pioneering book Doing Data Science, Straight Talk from the front Line,
- 0:35Speaker 1: which came out of her course at Columbia.
- 0:37Speaker 2: University, a really groundbreaking course back then.
- 0:40Speaker 1: Exactly. So by the end of this deep dive you
- 0:42Speaker 1: should have a much clearer understanding of this field, hopefully
- 0:46Speaker 1: equipped with the knowledge to you know, cut through the
- 0:48Speaker 1: noise and see why it's irrelevant. So let's dive straight
- 0:51Speaker 1: into the heart of it. What is data science? It's
- 0:55Speaker 1: a question that even the pioneers of the field really
- 0:58Speaker 1: grappled with.
- 0:58Speaker 2: They really did until.
- 1:00Speaker 1: Shuts introduction to data science course at Columbia I think
- 1:03Speaker 1: it started fall twenty twelve that really acted as an
- 1:06Speaker 1: incubator for this whole idea.
- 1:08Speaker 2: Yeah, it was a starting point, and Kathy O'Neill form
- 1:11Speaker 2: the mathbave dot org blog. She was instrumental in bringing
- 1:14Speaker 2: these ideas out, specifically pushing back against all the marketing hype.
- 1:19Speaker 1: There was a lot of hype back then.
- 1:20Speaker 2: Oh yeah. A crucial point here is that initial sort
- 1:24Speaker 2: of bewilderment around it. The term was just vague. People
- 1:28Speaker 2: were throwing around phrases like masters of the universe for
- 1:30Speaker 2: data scientists.
- 1:31Speaker 1: Right, which must have annoyed some statisticians.
- 1:34Speaker 2: You can imagine they felt like, hey, that's our feel.
- 1:36Speaker 2: The science of data identity theft almost. But the core
- 1:40Speaker 2: argument in the book, and I think it holds up,
- 1:42Speaker 2: is that data science isn't just rebranding.
- 1:45Speaker 1: Not just a new buzzword exactly.
- 1:47Speaker 2: It's genuinely a new idea, maybe still a bit fragile
- 1:50Speaker 2: or evolving, but it uniquely combines foundations from statistics and
- 1:54Speaker 2: computer science. Plus it has this distinct process tied to it.
- 1:58Speaker 1: And part of that newness I think came from this
- 2:00Speaker 1: idea of datification. Kenneth Kookier and Victor Merhr Schoenberger talked
- 2:04Speaker 1: about this in foreign affairs maybe mid two.
- 2:07Speaker 2: Thirteeneen Riise Big Data. Yeah.
- 2:09Speaker 1: They defined datification as basically taking all aspects of life
- 2:13Speaker 1: and turning them into data.
- 2:14Speaker 2: Which sounds huge.
- 2:16Speaker 1: It is. Think about it, Google glassdentifying your gaze, Twitter,
- 2:20Speaker 1: turning stray thoughts into data points LinkedIn mapping out your
- 2:23Speaker 1: professional life. Everything becomes potentially quantifiable.
- 2:28Speaker 2: Which immediately makes you ask, Okay, who is this we
- 2:32Speaker 2: doing the datafying and what kind of value are they
- 2:34Speaker 2: actually creating? Often it's well modelers, entrepreneurs.
- 2:38Speaker 1: Looking for efficiency, automation pretty much.
- 2:41Speaker 2: Yeah, And what's really striking is that so much of
- 2:44Speaker 2: this wasn't bubbling up in academia initially. It was happening
- 2:47Speaker 2: in industry, in tech companies. That's quite different from how
- 2:50Speaker 2: statistics traditionally develop.
- 2:52Speaker 1: So if it's this broad new thing happening in industry,
- 2:55Speaker 1: what does a data scientist actually look like? Should have
- 2:58Speaker 1: this interesting exercise for.
- 3:00Speaker 2: Her students, the self profiling, Yeah.
- 3:02Speaker 1: Right, rate yourself on computer science, math, stats, machine learning,
- 3:06Speaker 1: domain expertise, communication VIZ data visualization, and.
- 3:11Speaker 2: The results were all over the PLAYFFERNT thing. It showed
- 3:14Speaker 2: pretty clearly that you know, no single person is going
- 3:17Speaker 2: to be brilliant at all of those things.
- 3:19Speaker 1: Yeah, unicorns are rare exactly, which led to this idea.
- 3:24Speaker 2: Maybe it's more useful to define a data science team
- 3:28Speaker 2: than one perfect data scientist.
- 3:30Speaker 1: Makes sense Like that Josh Will's quote, Oh.
- 3:32Speaker 2: Yeah, the classic person who is better at statistics than
- 3:35Speaker 2: any software engineer, and better at software engineering than any statistician.
- 3:39Speaker 1: That captures it pretty well.
- 3:41Speaker 2: It does. Fundamentally, a data scientist extracts, meaning interprets data.
- 3:45Speaker 2: They need tools from stats and machine learning, sure, but
- 3:49Speaker 2: also crucially human intuition, and let's be honest, a huge
- 3:53Speaker 2: part of the job is just collecting, cleaning, and munging data. Yeah,
- 3:57Speaker 2: wrestling with it because real world data is just in
- 4:00Speaker 2: apparently messy always Okay.
- 4:02Speaker 1: So moving from the who to the how? How does
- 4:05Speaker 1: this actually get done? We hear big data all the time,
- 4:07Speaker 1: but it's kind of a.
- 4:08Speaker 2: Vague term it really is.
- 4:10Speaker 1: Yeah.
- 4:10Speaker 2: The book breaks it down nicely though, three parts. One,
- 4:14Speaker 2: it's a set of technologies. Two, it's potentially a revolution
- 4:19Speaker 2: in how we measure things, and a point of view,
- 4:21Speaker 2: really a philosophy about how decisions are going to be
- 4:25Speaker 2: made in the future based on data.
- 4:27Speaker 1: Right and connecting big data back to basic stats like
- 4:31Speaker 1: populations and samples.
- 4:33Speaker 2: That seems important, Oh, absolutely critical. There's this dangerous assumption
- 4:37Speaker 2: sometimes with big data that nal You know, you have
- 4:42Speaker 2: all the.
- 4:42Speaker 1: Data, but you never really do.
- 4:44Speaker 2: You pretty much never do. There's always something missing, some
- 4:47Speaker 2: context you don't have. Kate Crawford's talk on the Hurricane
- 4:50Speaker 2: Sandy tweets is such a powerful example of this.
- 4:52Speaker 1: Well was it gist of that?
- 4:53Speaker 2: Well, looking at the tweets, you might think New Yorkers
- 4:55Speaker 2: were just casually shopping before the storm and partying after.
- 4:59Speaker 2: But that's because they were the ones tweeting heavily.
- 5:01Speaker 1: Ah, so it missed the people really.
- 5:03Speaker 2: Affected exactly, coastal New Jerseyans whose homes were being destroyed.
- 5:08Speaker 2: They weren't tweeting about their grocery runs. It just shows
- 5:12Speaker 2: how subjective the whole process is. You, the data scientist,
- 5:16Speaker 2: are turning the world into data. It's not objective.
- 5:20Speaker 1: Data doesn't just speak for itself.
- 5:22Speaker 2: Never be very skeptical if someone claims it does.
- 5:25Speaker 1: Okay, so data is subjective. We need context. Then we
- 5:28Speaker 1: get to modeling. This sounds like where the magic.
- 5:31Speaker 2: Happens or the hard work maybe both, and when we
- 5:34Speaker 2: say model here, we don't mean like a database scheme.
- 5:36Speaker 2: We mean a statistical model.
- 5:38Speaker 1: Like a mathematical function.
- 5:40Speaker 2: Yeah, one that tries to capture the uncertainty, the randomness,
- 5:43Speaker 2: and how the data was generated and building these it's
- 5:46Speaker 2: definitely part art, part science. Textbooks don't really give you
- 5:49Speaker 2: a step by step guide. You have to make assumptions,
- 5:51Speaker 2: a lot of assumptions about reality. But yeah, we'll get
- 5:53Speaker 2: into how that works.
- 5:54Speaker 1: And you mentioned a big pitfall here overfitting.
- 5:57Speaker 2: Yes, get ready to hear about fitting a lot, possibly
- 6:02Speaker 2: until you have nightmares.
- 6:03Speaker 1: About Okay, okay, So what is it?
- 6:05Speaker 2: It's when your model gets too good at explaining the
- 6:07Speaker 2: specific data you train it on, including all the random
- 6:10Speaker 2: noise and quirks in that sample.
- 6:12Speaker 1: So it learns the noise, not the signal.
- 6:14Speaker 2: Precisely, and then it fails, often badly, when you try
- 6:18Speaker 2: to use it on new unseen data. It hasn't learned
- 6:20Speaker 2: the general pattern, just the specifics of the test it's
- 6:23Speaker 2: studied for, so to speak.
- 6:24Speaker 1: Right, it can't generalize. So before we even get to
- 6:26Speaker 1: complex models, what's the first step.
- 6:29Speaker 2: Exploratory data analysis? Eighty A. Yeah, it's absolutely fundamental.
- 6:33Speaker 1: And that's more than just plotting things, oh much more.
- 6:36Speaker 2: It's a mindset. It's about getting intuition, understanding the shape
- 6:40Speaker 2: of your data, feeling how it connects back to the
- 6:42Speaker 2: real world process that created it.
- 6:43Speaker 1: So what does it help you do practically well?
- 6:45Speaker 2: Gain intuition? Obviously, make comparisons, do basic sanity checks. Is
- 6:50Speaker 2: the data on the right scales, it the right format,
- 6:53Speaker 2: Spot missing values or crazy outliers, summarize things, even debug
- 6:58Speaker 2: how the data was logged in the first place.
- 7:00Speaker 1: Okay, like the example with the New York Times ad
- 7:02Speaker 1: data NYT one dot csv through NYT three one dot csv.
- 7:07Speaker 2: Exactly, the students had to plot distributions of ad impressions
- 7:12Speaker 2: and click through rates the CTR for different age groups,
- 7:15Speaker 2: and segment users by whether they clicked or not using
- 7:20Speaker 2: r In that case, it forces you to really look
- 7:23Speaker 2: at the data first.
- 7:24Speaker 1: And this whole process it kind of mirrors the scientific method,
- 7:27Speaker 1: doesn't it.
- 7:28Speaker 2: It really does. You ask a question, you research, explore
- 7:32Speaker 2: the data, you form a hypothesis, you test it, build
- 7:35Speaker 2: a model, analyze the results, communicate them.
- 7:37Speaker 1: But with a twist.
- 7:39Speaker 2: Yeah, The big difference is the feedback loop. When you
- 7:41Speaker 2: build a data product like a stam filter or a
- 7:43Speaker 2: recommendation engine. It goes out into the world, people use it,
- 7:47Speaker 2: Their interactions generate more data.
- 7:49Speaker 1: Which feeds back into the system.
- 7:51Speaker 2: Right, it's a dynamic cycle. It's not like predicting the weather,
- 7:53Speaker 2: where your forecast doesn't actually change tomorrow's weather. Here the
- 7:57Speaker 2: model influences the world, which generates new data for them, and.
- 8:00Speaker 1: The data scientist is involved all the.
- 8:02Speaker 2: Way through, absolutely, from deciding what data to even collect,
- 8:06Speaker 2: to asking the first questions, planning the attack, and yeah,
- 8:09Speaker 2: writing the code.
- 8:10Speaker 1: The Real Direct case study sounds like a good example
- 8:12Speaker 1: of this using data in real estate.
- 8:14Speaker 2: Yeah, Doug Pearlson's company. Yeah, the traditional real estate broker
- 8:17Speaker 2: system was well broken in terms of data. Brokers guarded
- 8:21Speaker 2: their info fiercely. Public data was months out of date.
- 8:25Speaker 1: So what did Real Direct do?
- 8:27Speaker 2: They heided agents who pooled their knowledge, use data driven tips,
- 8:31Speaker 2: built real time recommendations, tried to get live feeds on searches, offers,
- 8:34Speaker 2: closing times.
- 8:36Speaker 1: All that stuff, and the business model reflected that efficiency.
- 8:39Speaker 2: Right, a subscription model plus lower commission because the data
- 8:43Speaker 2: supposedly made things more efficient. The exercise for the students
- 8:46Speaker 2: was literally, okay, you're advising the CEO, define a data strategy.
- 8:50Speaker 2: What data do you need, where do you get it?
- 8:52Speaker 2: How do you clean it, explore it, summarize it, puts
- 8:54Speaker 2: it all together.
- 8:55Speaker 1: Okay, let's shift gears to the algorithms the engines driving this.
- 9:00Speaker 1: Machine learning versus statistical modeling always confusing.
- 9:03Speaker 2: It is confusing because there's so much overlap. mL algorithms,
- 9:07Speaker 2: mostly from computer science, do prediction classification clustering. Statistical modeling
- 9:12Speaker 2: from SaaS environments does well prediction classification clustering.
- 9:15Speaker 1: So what's the real difference? Then?
- 9:17Speaker 2: Often it's about the goal and the origin. Many mL algorithms,
- 9:21Speaker 2: especially the ones driving AI image recognition, speech recommenders, they
- 9:26Speaker 2: weren't typically part of a core stats curriculum, and crucially,
- 9:30Speaker 2: they're often not designed to help you infer the underlying why.
- 9:34Speaker 1: They just want the best prediction exactly.
- 9:36Speaker 2: Maximum accuracy is usually the goal, whereas statistical modeling often
- 9:40Speaker 2: puts more emphasis on understanding the relationships the uncertainty. But honestly,
- 9:45Speaker 2: good data scientists use both. They know when each approach
- 9:48Speaker 2: is more valuable.
- 9:49Speaker 1: Right, and the warning you mentioned don't be a hammer
- 9:52Speaker 1: looking for a nail.
- 9:53Speaker 2: Precisely, don't just grab the algorithm you know best and
- 9:56Speaker 2: force it onto the problem. First, understand the problem text,
- 10:00Speaker 2: figure out its mathematical structure, then see which algorithms fit
- 10:04Speaker 2: makes sense.
- 10:04Speaker 1: Let's start with a classic linear regression.
- 10:07Speaker 2: Ah, yes, your bread and butter. For predicting a continuous
- 10:10Speaker 2: outcome like price or temperature, using one or more predictors.
- 10:14Speaker 1: We usually start thinking about simple lines like why will
- 10:17Speaker 1: twenty five x deterministic?
- 10:20Speaker 2: Right? But the key mental shift is moving to stochastic functions,
- 10:24Speaker 2: acknowledging that there's randomness uncertainty. The line represents the average trend,
- 10:29Speaker 2: but the points will scatter around it, and.
- 10:31Speaker 1: How do you find the best line?
- 10:33Speaker 2: You minimize the distance between the points and the line,
- 10:36Speaker 2: specifically the sum of the squared vertical distances. That's the
- 10:40Speaker 2: mean squared.
- 10:40Speaker 1: Error, and you evaluate it with things like P values.
- 10:43Speaker 2: Yeah, P values help you test if your predictors actually
- 10:46Speaker 2: have a statistically significant effect. Are their coefficients likely different
- 10:51Speaker 2: from zero? You can add more predictors. That's multiple linear regression,
- 10:56Speaker 2: which then raises the question of feature selection, which predictors
- 10:59Speaker 2: matter most?
- 11:00Speaker 1: And simulating data can help understand.
- 11:02Speaker 2: This oh hugely useful, especially in learning. You create fake
- 11:05Speaker 2: data where you know the true relationship, then you see
- 11:08Speaker 2: if your model can recover it. How sample size effects things?
- 11:11Speaker 2: What happens if you add irrelevant variables? It builds intuition?
- 11:15Speaker 1: Okay, what about classifying things? Finding similar items?
- 11:18Speaker 2: That sounds like CA nearest neighbors or kNN.
- 11:21Speaker 1: Right knnn ad. How does that work?
- 11:22Speaker 2: The idea is simple. To classify a new unlabeled item,
- 11:26Speaker 2: you look at its K closest neighbors data set where
- 11:30Speaker 2: you do have labels. Then you assign the classes most
- 11:32Speaker 2: common among those neighbors. Examples could be anything classifying emails
- 11:36Speaker 2: as spam NOTT spam based on similar emails, assessing credit
- 11:40Speaker 2: risk based on similar applicants, recommending restaurants based on what
- 11:44Speaker 2: similar users like find The neighbors and the key choices
- 11:47Speaker 2: are two main things. First, how do you define closest?
- 11:50Speaker 2: You need a distance metric Euclidian is common for points,
- 11:53Speaker 2: Cosign for text, Hamming for strings, Manhattan for grid like paths.
- 11:58Speaker 2: Depends on the data. Second, choosing K how many neighbors
- 12:01Speaker 2: do you consult? One, five, twenty. That's a tuning parameter.
- 12:05Speaker 1: And this is where it gets interesting. The curse of dimensionality.
- 12:08Speaker 2: I asked. The curse kNN works great in low dimensions
- 12:11Speaker 2: like recognizing handwritten digits, where pixels in a two hundred
- 12:14Speaker 2: and fifty six dimension space have a natural closeness. But
- 12:17Speaker 2: imagine text data with thousands of dimensions.
- 12:20Speaker 1: Words things get spread out exactly.
- 12:23Speaker 2: In high dimensions, everything is kind of far away from
- 12:25Speaker 2: everything else. Your nearest neighbors might not be very similar
- 12:29Speaker 2: at all in a meaningful sense. K and N breaks down.
- 12:33Speaker 2: That's why it's usually bad for spam filtering.
- 12:35Speaker 1: Good point other K and N pitfalls.
- 12:38Speaker 2: Definitely need to scale your variables. If income is in dollars,
- 12:41Speaker 2: in ages in years, income will dominate the distance calculation
- 12:45Speaker 2: unless you scale them, and overfitting is a risk, especially
- 12:49Speaker 2: of K one. Then you're just copying the label of
- 12:52Speaker 2: the single closest point, which might be noise. Correlated features
- 12:55Speaker 2: can also distort distances.
- 12:57Speaker 1: Okay, so kNN needs labels. What if you don't have labels,
- 13:00Speaker 1: but you suspect there are groups in your data.
- 13:02Speaker 2: Then you're talking about unsupervised learning, and K means clustering
- 13:06Speaker 2: is a common technique there.
- 13:07Speaker 1: Unsupervised So the algorithm finds the groups itself precisely.
- 13:11Speaker 2: You tell it how many clusters K you think exist,
- 13:14Speaker 2: and the algorithm iteratively assigns points to the nearest cluster
- 13:17Speaker 2: center centroid, and then recapculates the centroids until things stabilize.
- 13:22Speaker 1: Why would you do that?
- 13:23Speaker 2: Lots of reasons. Maybe you want to segment users for
- 13:25Speaker 2: different marketing or product experiences, or build separate predictive models
- 13:30Speaker 2: for distinct customer groups. K means helps you discover those
- 13:33Speaker 2: groups automatically instead of you trying to define them with
- 13:36Speaker 2: arbitrary rules or thresholds.
- 13:38Speaker 1: So it automates finding clusters in like many dimensions.
- 13:42Speaker 2: Yeah, that's the power, but it has its quirks. Choosing
- 13:46Speaker 2: the right K is often more art than science, and
- 13:49Speaker 2: sometimes the algorithm can get stuck in a suboptimal solution
- 13:52Speaker 2: depending on where it starts.
- 13:54Speaker 1: Is it an old algorithm?
- 13:55Speaker 2: The basic idea goes back to the fifties Steinhaus and
- 13:58Speaker 2: Lloyd m the term K means in sixty seven. There
- 14:02Speaker 2: are newer versions like K means plus plus from two
- 14:04Speaker 2: thousand and seven that try to start the algorithm off better.
- 14:07Speaker 1: Okay, so we said canon isn't great for spam filtering
- 14:10Speaker 1: because of hi dimensions. What does work well that.
- 14:13Speaker 2: Brings us to naive base? A surprisingly effective probabilistic.
- 14:17Speaker 1: Approach based on Bayes Law.
- 14:19Speaker 2: Exactly remember baes Law from stats PA B p G.
- 14:22Speaker 1: Vaguely like the disease testing example, probability you're sick given
- 14:26Speaker 1: a positive test.
- 14:27Speaker 2: That's the one we applied the same logic to spam.
- 14:31Speaker 2: What's the probability in email is spam? Given that contains
- 14:34Speaker 2: the word viagra, p spam, word peace, damp, word.
- 14:37Speaker 1: Needs sense what's the naive part?
- 14:39Speaker 2: The naive assumption is that the words in the email
- 14:41Speaker 2: appear independently of each.
- 14:43Speaker 1: Other, which isn't true. Right, free and viagra probably appeared
- 14:46Speaker 1: together more often than by chance in spam.
- 14:50Speaker 2: Totally untrue. But the simplification makes the math tractable, and
- 14:55Speaker 2: surprisingly it often works really well in practice, especially for text.
- 14:59Speaker 1: Any pitfall just counting words.
- 15:01Speaker 2: Oh yeah, if a word like viagra only appeared in
- 15:04Speaker 2: spam in your training data, the model might assign a
- 15:07Speaker 2: one hundred percent probability of spam if it sees that
- 15:09Speaker 2: word again. It's overfitting. Also, what if you see a
- 15:12Speaker 2: word you've never seen before? The probability would be zero,
- 15:16Speaker 2: which messes up the calculation.
- 15:17Speaker 1: So how do you fix that?
- 15:18Speaker 2: With laplace smoothing sometimes called additive smoothing, you basically add
- 15:22Speaker 2: a small pseudo count to every word count, pretending you've
- 15:25Speaker 2: seen each word at least once or a fraction of
- 15:27Speaker 2: a time. It prevents zero probabilities and generally makes the
- 15:31Speaker 2: estimates more robust.
- 15:32Speaker 1: And this was used in that NYT article classification exercise.
- 15:36Speaker 2: Yes, exactly Jake's exercise. Download two thousand articles from different
- 15:39Speaker 2: sections arts, business, sports, et cetera. Using the API. Train
- 15:43Speaker 2: a naive base model specifically Bernoulli ni bays here to
- 15:48Speaker 2: classify them, tune the smoothing parameters, evaluate with a confusion matrix.
- 15:52Speaker 2: See which words were most indicative of each section. Great
- 15:55Speaker 2: hands on example.
- 15:56Speaker 1: Cool again, Another big one. Logistic regression. How's that different
- 16:00Speaker 1: from linear regression?
- 16:01Speaker 2: Linear regression predicts a continuous value, right like a house price.
- 16:05Speaker 2: Logistic regression predicts the probability of a binary outcome, something
- 16:09Speaker 2: that's either yes or no zero.
- 16:11Speaker 1: One like will a user click and add? Is this
- 16:13Speaker 1: email spam while this customer churn?
- 16:15Speaker 2: Exactly those kinds of things binary outcomes?
- 16:17Speaker 1: And how does it predict a probability? Doesn't a linear
- 16:20Speaker 1: model output any number.
- 16:21Speaker 2: It starts with a linear combination of features, just like
- 16:24Speaker 2: linear regression. Else plus matrox. But then it feeds that
- 16:27Speaker 2: result through a special function called the logistic function or sigmoid.
- 16:30Speaker 1: Function the S shaped curve that's the one.
- 16:33Speaker 2: Pt one plus et. This function squishes any input value
- 16:38Speaker 2: into an output between zero and one, perfect for representing
- 16:41Speaker 2: a probability.
- 16:42Speaker 1: So alpha and beta still means something yep.
- 16:45Speaker 2: Alpha spain is related to the baseline probability. The overall
- 16:48Speaker 2: odds and the betas are the weights for each feature,
- 16:52Speaker 2: telling you how much each feature changes the law odds
- 16:54Speaker 2: of the outcome.
- 16:55Speaker 1: How do you find the best alpha and betas?
- 16:58Speaker 2: Usually with maximum likelihood estimation, you find the parameters that
- 17:02Speaker 2: make the observed data most probable. This often involves optimization
- 17:06Speaker 2: algorithms like Newton's method, or, especially for huge data sets,
- 17:10Speaker 2: stochastic gradient descent SGD.
- 17:12Speaker 1: SGD sounds familiar.
- 17:14Speaker 2: Very common in large scale machine learning. It updates the
- 17:16Speaker 2: parameters using just one data point or a small batche
- 17:19Speaker 2: at a time, making it efficient for massive data sets,
- 17:21Speaker 2: especially sparse ones. Tools like mahood or valpol wabbit use
- 17:25Speaker 2: it heavily.
- 17:26Speaker 1: Now, evaluating these models, you said, accuracy isn't always great.
- 17:29Speaker 2: Right, especially with imbalanced classes. If only one percent of
- 17:32Speaker 2: emails are spam. A model predicting not spam one hundred
- 17:35Speaker 2: percent of the time is ninety nine percent accurate, but useless.
- 17:37Speaker 1: So what should we use instead?
- 17:39Speaker 2: Look at precision of the times you predicted spam, how
- 17:43Speaker 2: often were you right? And recall of all the actual
- 17:46Speaker 2: spam how much did you catch often? There's a trade off.
- 17:49Speaker 1: And F score AUC.
- 17:51Speaker 2: F score tries to combine precision and recall into one number.
- 17:55Speaker 2: AUC area under the ROC curve is really good because
- 17:58Speaker 2: it measures performance across all possible thresholds and isn't thrown
- 18:02Speaker 2: off by imbalanced classes. It's base rate invariant.
- 18:06Speaker 1: But even these metrics might not capture the real goal exactly.
- 18:10Speaker 2: Your model might have great AUC, but does it actually
- 18:13Speaker 2: increase revenue or user engagement. That's where AB testing comes in,
- 18:17Speaker 2: the gold standard for real world impact.
- 18:19Speaker 1: YE, run a controlled experiment, show the old system to
- 18:21Speaker 1: group A, the new model to group B, and measure
- 18:24Speaker 1: the actual business outcome you care about. Google's paper on
- 18:27Speaker 1: experimentation really drives this.
- 18:28Speaker 2: Home and Media six degrees M six D use logistic
- 18:32Speaker 2: regression for predicting AD clicks.
- 18:34Speaker 1: Yeah, a classic application user level conversion prediction, highly scalable,
- 18:37Speaker 1: and effective for binary outcomes.
- 18:39Speaker 2: So okay, let's get into some real world messiness. Time
- 18:41Speaker 2: stamps seems simple, but you said they're tricky. Oh they are.
- 18:45Speaker 2: You get tons of time stamped event data, user clicks,
- 18:48Speaker 2: check ins, sensor readings. That's big data right there. But
- 18:52Speaker 2: they introduce subtle problems like what the biggest is causality.
- 18:57Speaker 2: You cannot use information from the future to predict the
- 18:59Speaker 2: present or past. Sounds obvious, but it's easy to accidentally
- 19:03Speaker 2: leak future information into your training data if you're not
- 19:06Speaker 2: careful with time stamps.
- 19:08Speaker 1: Ah the time travel problem exactly.
- 19:10Speaker 2: You also have to be super careful distinguishing in sample
- 19:13Speaker 2: training data from out of sample testing data based on time,
- 19:18Speaker 2: and often you need running estimates, like a running average,
- 19:20Speaker 2: not a single average calculated over all past data, because
- 19:24Speaker 2: the world changes like in finance. Finance is a great example,
- 19:27Speaker 2: they often use log returns instead of simple percentage returns
- 19:31Speaker 2: because log returns handle compounding better and are more symmetric.
- 19:35Speaker 2: Volatility is key, and techniques like exponential downweighting let you
- 19:38Speaker 2: calculate a volatility estimate that gives more weight to recent data,
- 19:42Speaker 2: efficiently updating with just the latest info.
- 19:44Speaker 1: And financial markets have weak signals.
- 19:47Speaker 2: Extremely weak these days, so many algorithms are looking for
- 19:50Speaker 2: the same patterns that the signals get arbitraged away quickly.
- 19:55Speaker 2: You might aim for just a tiny positive correlation like
- 19:57Speaker 2: three percent over a day. Yet linear regression is still
- 20:01Speaker 2: used because it's robust even with all that noise.
- 20:04Speaker 1: And they use things like priors and regularization yes, to.
- 20:07Speaker 2: Keep the model stable. Priors incorporate existing beliefs, and regularization
- 20:12Speaker 2: adds penalties to stop coefficients from getting too large or
- 20:16Speaker 2: varying too wildly. It helps prevent overfitting in noisy high
- 20:20Speaker 2: dimensional data. Mathematically, it often simplifies to adding a term
- 20:24Speaker 2: to the covariance matrix.
- 20:25Speaker 1: Which brings us to figuring out what data to even
- 20:27Speaker 1: put into the model. Feature engineering the art of data science.
- 20:31Speaker 2: Some say it's about deciding which variables features to use
- 20:35Speaker 2: and how to transform them to be most effective for
- 20:37Speaker 2: your model. Should's four quadrants idea highlights thinking about relevance, usefulness,
- 20:42Speaker 2: whether something's even logged. Your creativity is a limit.
- 20:45Speaker 1: How do you select the best features?
- 20:47Speaker 2: Several ways filters rank features individually by predictive power like correlation,
- 20:52Speaker 2: but they miss interactions. Step rise regression ads or removes
- 20:57Speaker 2: features one by one from a model watching metas like
- 21:00Speaker 2: R squared or P values, but careful, it can easily overfit.
- 21:05Speaker 1: What about embedded methods.
- 21:06Speaker 2: These methods build feature selection right into the model. Training
- 21:09Speaker 2: decision trees are a prime example.
- 21:11Speaker 1: How do they work?
- 21:12Speaker 2: They recursively split the data based on the feature that
- 21:15Speaker 2: provides the most information game at each step, essentially creating
- 21:19Speaker 2: a flow chart to classify things. They're very interpretable. You
- 21:22Speaker 2: can see the rules.
- 21:22Speaker 1: Like the Titanic survival example.
- 21:24Speaker 2: Classic decision trees can figure out rules like if female survive,
- 21:28Speaker 2: if male and child survive. They handle continuous variables by
- 21:32Speaker 2: finding optimal split points, but you often need to prune
- 21:36Speaker 2: the tree, cutting back branches to stop it from overfitting
- 21:39Speaker 2: the training data. In random Force, they take decision trees
- 21:42Speaker 2: to the next level. They build many decision trees on
- 21:44Speaker 2: different random subsets of the data and features bagging, and
- 21:47Speaker 2: then average their predictions. Much more accurate and robust than
- 21:51Speaker 2: a single tree, But you lose that easy interpretability.
- 21:54Speaker 1: Now when selecting features that causation versus correlation issue seems
- 21:59Speaker 1: critical huge.
- 22:00Speaker 2: Is user played ten times a feature describing the user's behavior,
- 22:04Speaker 2: or is you show ten ads a future describing your action.
- 22:08Speaker 2: If you want actionable insights to change outcomes, you need
- 22:11Speaker 2: to focus on features you can actually control.
- 22:13Speaker 1: David Huffacker at Google talked about mixing message.
- 22:16Speaker 2: Yeah, they're a hybrid approach, combining qualitative insights from small
- 22:20Speaker 2: user interviews with quantitative analysis of large scale log data.
- 22:24Speaker 2: The Google Plus circles feature apparently came from that kind
- 22:27Speaker 2: of mix interviews, sparking ideas tested with big data moving
- 22:31Speaker 2: from description to prediction, which.
- 22:32Speaker 1: Also raises privacy concerns.
- 22:34Speaker 2: Absolutely, anytime you're dealing with human data, what are people
- 22:38Speaker 2: worried about? Identity, theft, financial loss, creepy ads. The book
- 22:43Speaker 2: mentions ideas like clearer data flow diagrams, privacy controls, sensible defaults,
- 22:49Speaker 2: big thorny issues.
- 22:51Speaker 1: Let's talk visualization again. Mark Hanson framed it as more
- 22:53Speaker 1: than just nice plots right.
- 22:55Speaker 2: As an art and information discipline that actually changes how
- 22:58Speaker 2: we see things. Change the instruments, and you change the theory.
- 23:02Speaker 2: His examples Million Dollar Blocks, Project Cascade, the NYT Lobby
- 23:06Speaker 2: display showed data as a powerful communication and exploration tool, sometimes.
- 23:11Speaker 1: Even as art and Ian Wong at Square connected this
- 23:13Speaker 1: directly to fraud.
- 23:14Speaker 2: Detection exactly. Square deals with massive potential fraud. The used
- 23:19Speaker 2: machine learning heavily, but Wong stressed the importance of visualization alongside.
- 23:23Speaker 2: It helps him understand why the model flags something, especially
- 23:26Speaker 2: with high class imbalance.
- 23:27Speaker 1: Where fraud is rare so accuracy is useless.
- 23:30Speaker 2: Decisely, they focus on precision and recall. Wong's tips were
- 23:34Speaker 2: great too. Models aren't black boxes. Iterate quickly like experiments.
- 23:38Speaker 2: Keep your code clean and reusable.
- 23:40Speaker 1: And productionizing the models.
- 23:42Speaker 2: Making them work in real time, minimizing the gap between
- 23:45Speaker 2: offline tests and online reality. Visualization isn't just for building
- 23:49Speaker 2: the model. It helps the human operations team review transactions efficiently.
- 23:55Speaker 2: It augments their intelligence like an exoskeleton.
- 23:58Speaker 1: Okay, this is a really important distinction. Prediction versus causality.
- 24:02Speaker 2: Yes, this is where things get philosophically deep. Maybe recommending
- 24:07Speaker 2: a book because you read a similar one that's prediction.
- 24:11Speaker 2: Understanding what causes someone to buy a book, or get
- 24:13Speaker 2: sick or click an add that's causality.
- 24:16Speaker 1: The methods might look similar, sometimes they might.
- 24:18Speaker 2: Use similar stats, but the intent is different, and that
- 24:21Speaker 2: changes everything about how you design your analysis and interpret
- 24:24Speaker 2: the results.
- 24:24Speaker 1: And observational data is tricky for causality.
- 24:27Speaker 2: Very ory. Steelman mentioned that Okay, Cupid, example, may be
- 24:31Speaker 2: beautiful in emails correlated with responses, but did it cause
- 24:33Speaker 2: them or were people writing beautiful also doing other things
- 24:37Speaker 2: differently confounders everywhere.
- 24:38Speaker 1: So the gold standard is.
- 24:40Speaker 2: Randomize controlled trials. RCTs randomly assign people to treatment or control.
- 24:45Speaker 2: If the group starts statistically identical thanks to randomization, any
- 24:49Speaker 2: difference in outcome can be attributed to the treatment. That's
- 24:52Speaker 2: causal Inference.
- 24:53Speaker 1: And ab tests are like RCTs for tech.
- 24:55Speaker 2: Pretty much much easier logistically than clinical trials, usually less
- 24:59Speaker 2: it's stay more control if you have the infrastructure randomly
- 25:03Speaker 2: show version A or version B of a web page,
- 25:06Speaker 2: measure the difference in clicks or conversions.
- 25:09Speaker 1: But watching out for things like Simpson's paradox, Oh.
- 25:11Speaker 2: Yeah, a huge pitfall and observational data, a trend appears
- 25:15Speaker 2: in the overall data, but reverses when you break it
- 25:17Speaker 2: down to the subgroups, so as you can't just trust
- 25:19Speaker 2: aggregated numbers.
- 25:20Speaker 1: David Madigan's work sounds intense. Using the Reuben causal model.
- 25:24Speaker 2: Right a formal framework to think about what you can
- 25:27Speaker 2: and can't know from observational studies. His almop project analyzed
- 25:32Speaker 2: huge medical databases.
- 25:33Speaker 1: Two hundred million people.
- 25:35Speaker 2: Yeah, and the shocking finding was that for many medical
- 25:37Speaker 2: questions using the same database but different standard analysis methods,
- 25:41Speaker 2: you could get opposite conclusions, like whether a drug caused
- 25:44Speaker 2: cancer or not.
- 25:45Speaker 1: Wow. That really underlines the challenge of inferring cause from
- 25:49Speaker 1: observed data.
- 25:50Speaker 2: It really does choices in analysis matter profoundly.
- 25:53Speaker 1: Another scary problem data leakage. Claudia or Perlic called it
- 25:57Speaker 1: a huge problem.
- 25:58Speaker 2: It is both in petitions and the real world. It's
- 26:01Speaker 2: when your model accidentally learns from information it wouldn't have
- 26:06Speaker 2: in a real prediction scenario. It learns the noise for signal.
- 26:09Speaker 1: How does that happen?
- 26:10Speaker 2: Could be implicit future information, like using diagnosis codes assigned
- 26:14Speaker 2: after a prediction should have been made, or non random sampling.
- 26:17Speaker 2: Perlik gave examples like patient IDs accidentally encoding clinic location,
- 26:22Speaker 2: making cancer prediction trivial, or pneumonia models exploiting diagnosis codes.
- 26:26Speaker 1: So how do you avoid it?
- 26:27Speaker 2: Specific advice, Yes, very specific. Strict temporal cutoff. Remove everything
- 26:33Speaker 2: learned even microseconds before the event you're predicting time, stamp
- 26:36Speaker 2: everything based on when it was known, not just when
- 26:38Speaker 2: it happened. Start clean with raw data, and most importantly,
- 26:42Speaker 2: understand how the data was generated.
- 26:44Speaker 1: Also important is model calibration. Are the probabilities right crucial?
- 26:48Speaker 2: A model might be good at ranking risks, but are
- 26:51Speaker 2: its predicted probabilities accurate? Like when it says seventy percent chance,
- 26:55Speaker 2: does it happen seventy percent of the time? Unprune decision
- 26:59Speaker 2: trees she showed often give probabilities that are too extreme,
- 27:03Speaker 2: while logistic progression tends to be better calibrated.
- 27:05Speaker 1: Okay, Last, big area data engineering, scale and complexity, map
- 27:10Speaker 1: reduce and hodup do data scientists need to know?
- 27:12Speaker 2: This? Often not directly coding map produced jobs anymore with
- 27:17Speaker 2: newer tools abstracting it, but understanding the concepts is still
- 27:20Speaker 2: really valuable.
- 27:21Speaker 1: Why was map reduce developed? What problem does it solve?
- 27:24Speaker 2: Think about counting word frequencies in terabytes of text. You
- 27:27Speaker 2: can't load it all into memory on one machine, and
- 27:30Speaker 2: even if you could split it, combining the accounts back together,
- 27:33Speaker 2: it creates a bottleneck the fan end problem. Map reduce
- 27:36Speaker 2: provides a framework for distributing the work across many machines,
- 27:39Speaker 2: handling failures automatically and managing the.
- 27:42Speaker 1: Complexity, but it can be unintuitive.
- 27:44Speaker 2: Converting some algorithms into map processed chunks and reduce aggurate
- 27:48Speaker 2: results steps isn't always obvious, and how evenly the data
- 27:52Speaker 2: is spread across the machines is critical for performance.
- 27:55Speaker 1: And Joshuall's big data economic law love that one.
- 28:00Speaker 2: No single record is that valuable, but every record, the
- 28:03Speaker 2: whole collection is incredibly valuable. The aggregate tells the story.
- 28:07Speaker 1: And tools like Prigle and mahoot build on this.
- 28:10Speaker 2: Yeah, prigles for large scale graph processing, mahoot for machine
- 28:13Speaker 2: learning algorithms implemented on top of doop map produce handling
- 28:17Speaker 2: the scale.
- 28:18Speaker 1: So wrapping up this deep dive, we've covered a lot.
- 28:21Speaker 1: The goal was really to show what it's like to
- 28:23Speaker 1: be a data scientist and also how some of this
- 28:25Speaker 1: work gets done.
- 28:26Speaker 2: From defining the field to specific algorithms and those tough
- 28:30Speaker 2: real world.
- 28:31Speaker 1: Challenges right and revisiting that core question what is data science?
- 28:35Speaker 1: The book suggests it's maybe a set of best practices
- 28:39Speaker 1: used in tech companies tackling problems with data, sometimes scientifically, but.
- 28:43Speaker 2: Also always be wary of the hype. It's not magic
- 28:46Speaker 2: it's work.
- 28:47Speaker 1: It's a process absolutely, and thinking about the future the
- 28:50Speaker 1: hope for next gen data scientists. It's not just about
- 28:53Speaker 1: technical skill or salary.
- 28:55Speaker 2: No, it's about being good problem solvers, asking the right questions,
- 28:59Speaker 2: thinking deeply about design process ethics.
- 29:02Speaker 1: Like Jeff Hammerbacker's famous quote about the best minds working
- 29:05Speaker 1: on clicking ads that sucks. The aspiration is to use
- 29:08Speaker 1: these powerful tools responsibly to make things better, not worse.
- 29:12Speaker 2: Which comes back to critical thinking always remembering data does
- 29:16Speaker 2: not speak for itself. It needs interpretation, criticism, evaluation. It
- 29:21Speaker 2: requires dealing with messy, incomplete, often inconclusive data. It's a
- 29:26Speaker 2: human process full of judgment calls.
- 29:28Speaker 1: So for you, our listener, as you maybe explore data
- 29:31Speaker 1: science yourself, what does all this mean. It's complex, it's evolving,
- 29:35Speaker 1: it has huge potential and pitfalls. You've heard the practicalities,
- 29:38Speaker 1: the ethical tightropes, the human effort involved.
- 29:40Speaker 2: It's not just about the algorithms.
- 29:42Speaker 1: Definitely not. So here's something to think about as you
- 29:45Speaker 1: continue your journey. What ethical questions will you inevitably face
- 29:49Speaker 1: when you start applying these powerful tools. How will you
- 29:52Speaker 1: handle that tension between what data can show you and
- 29:55Speaker 1: what should be done with that knowledge, especially when different
- 29:57Speaker 1: people have different interests. Ultimately, how will you try to
- 30:01Speaker 1: ensure that your work, your insights are used to make
- 30:03Speaker 1: the world genuinely better and not just, you know, to
- 30:06Speaker 1: make people click