One Year as a Data Scientist at Stack Overflow
David Robinson, a data scientist at Stack Overflow, chronicles his change from a researcher to development, learning R, and the lessons he learned along the way.
Join the DZone community and get the full member experience.Join For Free
one day in january 2013, i found myself wasting time on the internet.
this wasn’t a good idea: i was as busy as anyone 2.5 years into their phd. i had to finish a presentation on some yeast genetics research, i was months behind on a paper with an nyu collaborator and even farther behind on some leftover undergraduate research. i was also busy in my personal life—i had returned from a trip to israel and had just taken up brazilian jiu-jitsu and jogging.
but this one day, i was wasting time by answering a stranger’s question about the beta distribution. the question was on cross validated, the statistics sister site of developer q&a site stack overflow. i’d been an active answerer on stack overflow for about a year at the time, and a less frequent answerer on cross validated: it was certainly my favorite way to waste time.
i did a lot in my phd that i am proud of, and i did a lot more that was forgettable or unimportant. but in terms of the effect on my career, that answer is the work that i’m happiest about.
one year at stack overflow
last thursday (june 16th) marks my one-year anniversary of working at stack overflow as a data scientist.
i’d finished my phd about a month before i joined, and my move to a tech company was a pretty big change for me. as of only a few months earlier, i’d been planning to stay in academic research, particularly in the field of computational biology. i’d started applying for postdoctoral fellowships, and hadn’t even considered applying to “industry” jobs.
what changed my mind? it started in january 2015, when jason punyon found my (then two-year-old) post about the beta distribution:
@drob p.s. i know we aren't as exciting as finishing your phd but if you want an interview here at stack you can have one :)— jsonp (@jasonpunyon) january 7, 2015
at the time i was pretty certain i was entering academia, but i didn’t want to pass up the chance to check out the stack exchange offices and meet some of the people behind the product. it took basically one visit to the office for me to change my mind, and a few weeks and interviews later i was offered the position and signed.
some things i’ve been working on
people know what web developers do, but what does a data scientist do? (i’m not the only person who gets asked that).
the following aren’t the only projects i’m working on, but they may give a sense of what i’ve been up to.
designing, developing and testing machine learning features
a lot of this process involves designing and analyzing a/b tests, particularly about changing our targeting algorithms, ad design, and other factors to improve clickthrough rate (ctr). this process is more statistically interesting than i’d expected, in some cases letting me find new uses for methods i’d used to analyze biological experiments, and in other cases encouraging me to learn new statistical tools. in fact, much of my series on applying bayesian methods to baseball batting statistics is actually a thinly-veiled version of methods i’ve used to analyze ctr across ad campaigns.
learning cool things
i’m not an academic scientist any more, but that doesn’t mean i’m not interested in drawing conclusions from data. stack overflow has a birds-eye view of the software development ecosystem—millions of questions, users, and daily visitors. what can we learn from all that data?
for starters, by looking at how tags are used together, we can find natural clusters of technologies:
this lets us automatically categorize frameworks and packages into the higher-level languages and clusters they belong to, all without manual annotation.
but it really shows us only how tags co-appear on specific programming questions, not how they’re used in the same projects (for example, c# and sql server may not always appear on the same questions, but they’re often used as part of the same technology stack). for that, i might look at another source of data, stack overflow careers profiles, and see which technologies tend to be used by the same developers:
i like how this divides the tags not just by strict categories, but by “technology ecosystems.” this kind of understanding isn’t limited to programming technologies. the stack exchange network contains a vast range of q&a sites. by looking at which communities tend to have the same active members, we can similarly create a network of how our sites are interrelated:
(not everything i do is networks, just some of the examples that are more interesting at a glance.)
why spend time on analyses like these? sometimes they can contribute directly to product features. for example, understanding clusters of technologies quantitatively lets us improve our model of developer types that drives the providence targeting. other insights can be valuable from a business perspective. i’ve worked a bit with the sales, marketing, and community teams to interpret their data and help make decisions.
but i’m also just intrinsically pretty interested in learning about and visualizing this kind of information; it’s one of the things that makes this a fun job. one plan for my second year here is to share more of these analyses publicly. in a previous post , i looked at which technologies were the most polarizing, and i’m looking forward to sharing more posts like that soon.
developing data science architecture (internal r packages)
i like using r to learn interesting things about our data, but my longer term goal is to make it easy for any of our engineers to do so. when i joined i was the first person at the company who used r, but it’s been spreading in the year since. r is just a really great way to engage with data directly and to answer interesting questions. (it makes me sad when brilliant software engineers open up excel to make a line graph!)
towards this goal, i’ve been focusing on building reliable tools and frameworks that people can apply to a variety of problems, rather than “one-off” analysis scripts. (there’s an awesome post by jeff magnusson at stitchfix about some of these general challenges). my approach has been building internal r packages , similar to airbnb’s strategy (though our data team is quite a bit younger and smaller than theirs). these internal packages can query databases and parsing our internal apis, including making various security and infrastructure issues invisible to the user.
this also has involved building r tutorials and writing “onboarding” materials. as an example, i’ve made public a tutorial that introduces the internal sqlstackr package for querying our databases. this doubles as a general dplyr/tidyr/ggplot2 introduction, which i find more useful than linking a developer to a general dplyr tutorial (since this is data my colleagues are sure to be interested in!) my hope is that as the data team grows and as more engineers learn r, this ecosystem of packages and guides can grow into a true internal data science platform.
academics and industry
there’s a popular definition of data scientists:
data scientist (n.): person who is better at statistics than any software engineer and better at software engineering than any statistician.— (((josh wills))) (@josh_wills) may 3, 2012
this version is framed positively, but it’s worth noting that the inverse is also true: in grad school, i knew less about statistics than others in my lab, and in my new job i know less about software engineering than my colleagues. so how has the transition been?
knowing more about statistics
there are plenty of dramatic articles about how “programmers need to learn statistics." it’s true that i have more statistical experience and training than my coworkers (also the first with a phd in any topic). but it hasn’t felt like an obstacle in my work.
for one thing, i’ve noticed this gap is closing in a lot of important areas. the developers i’ve met who interpret a/b testing are already aware of the dangers of p-hacking and multiple hypothesis testing, as well as the importance of effect sizes and confidence intervals. the data team in particular had already worked to spread good practices. the gaps that took more getting used to were more along the lines of “using poisson rather than linear regression” or “know when to use a log scale."
more importantly, i’ve found that developers have been more than willing to listen and learn when i brought up statistical issues, and i feel like my working relationships so far have built up mutual trust. this is one case in which my experience really hasn’t reflected the “programmers need to learn statistics” article , which painted developers as overconfident zealots. it’s possible we’re an unusually functional engineering department in this regard (i’ve heard worse stories from other companies!), but it’s also possible that the attitude of the software development industry has changed in the last six years, with the importance of statistics being more widely recognized.
one aspect of graduate school i miss is learning about statistics from others. i was surrounded by people much more knowledgeable than myself, and in lab meetings and seminars i got exposed to a lot of useful statistical theory and methods. i also could count on others to catch if i made a mistake. most of my current statistical education has to be self-driven, and i need to be very cautious about my work: if i use an inappropriate statistical assumption in a report, it’s unlikely anyone else will point it out.
knowing less about software engineering
i’ve long cared about programming practices, and i’ve been using github and contributing to open source python and r projects for years, but working for a tech company did represent something of a shift. i’m a lifetime mac user, and in the last few years have worked entirely in r. stack overflow is built on microsoft technologies, particularly c#, asp.net, and sql server, and before i joined nobody at the company had ever used r. i’m not attached to a particular side of a language war , but i was certainly nervous about what the change would mean for me.
this also turned out not to be much of an obstacle, especially i’ve found that i can contribute a lot to the company entirely from within r on a mac. i owe a lot to the developers of rsqlserver and the jtds driver ; thanks to them i can easily query our databases from rstudio. i have a parallels window with visual studio open at all times, but i find most days i don’t even need to use it. i do push code to production sometimes (usually related to ad targeting experiments), but it hasn’t been a source of friction. there’s many areas of software engineering that i know much less about than my colleagues, including front-end web design and site reliability engineering, but like in any company i end up pretty insulated from those concerns.
leaving biology research . this was probably the change i was most nervous about. for eight years (including most of my undergraduate degree), my research had been focused on biology. it took spending a few months working on other problems to realize that, honestly, i had never been that passionate about biological questions.
@daattali@jennybryan@noamross@hspter— david robinson (@drob) april 16, 2016
me: i had the weirdest, longest dream i cared about rna
wife: that wasn't a dream it was a phd
biology presents a lot of interesting computational and statistical problems, and there’s a lot of exciting work going on in bioinformatics. but when i finished a biological analysis, i’d end up with results (say, a hundred genes that changed expression in response to a stimulus) that i didn’t have the knowledge or interest to interpret myself. (even after years of working with the yeast genome as a whole, i can recognize only a handful of genes by name). in contrast, i’ve been a longtime user of stack overflow, and i have a general interest in the state of the software developer ecosystem, so i see a result like the above networks, i can tell whether it makes sense immediately. it feels different to work on data that i’m actually interested in.
writing : this is an advantage i’d underestimated. i did a lot of writing in my degree, mostly for journal articles and my dissertation, and the truth is that writing that kind of formal language can feel pretty stilted . in the last year, most of my writing has been for internal reports, for documentation, or for blog posts, where i get to write informally and conversationally (try comparing the language of my dissertation to any of the posts on this blog). i’ve had some leftover research i’m trying to get published, and for this reason it’s very hard to get back into the mindset of writing for a journal article.
the people i work with
i have a weird sense of humor, and many of my tweets involve a fictional “dev” that serves as a comedic foil, either to mock engineering culture or to mock my own inexperience in it.
me: you can't just add two p-values together.— david robinson (@drob) march 29, 2016
dev: the hell i can't:
newpval = pval1 + pval2;
dev: is all statistics this easy
me [smugly]: so you see, when you use the right correction, the p-value is .023, not .02— david robinson (@drob) april 11, 2016
dev: are you the guy who broke the build yesterday
in case it’s not obvious, every one of these tweets is a blatant lie. first, not one of these exchanges happened. but more importantly, they’re not remotely representative of developers i’ve worked with. the smart, competent, caring people at this company are one of my favorite parts of working here.
there are many worth listing (certainly all the members of the data and ad server teams), but i’m going to name just a few as examples. jason punyon is the developer who originally discovered my post on the beta distribution. jason’s an excellent engineer, and after six years here he’s built up a tremendous amount of useful product knowledge. one aspect that really impresses me is the way he combines caring about the data with caring about our users.
a few months ago i ran an experiment that showed there was a substantial benefit to displaying a salary range on job ads (more about that in future posts), and shared the results within the company. i was happy just to share some of the conclusions i’d learned. but jason took the results and turned them into action, starting a push for all employers (including ourselves) to provide salary information on listings. he did that because he takes data seriously, as something that guides his choices and that should guide the decisions of the company. he also cares about developers, as users of our product and as people, and thinks they deserve to know salary information up front. i’m proud to work with him.
there are a lot of people outside the engineering department i’m impressed with, and i’m especially glad to work with the community team . for instance, taryn pratt joined the team a few months before i started. i contributed to the stack overflow community before i worked here, but nothing compared to taryn’s contributions. she’d been an active answerer and moderator for years, including answering >3500 questions and casting >22,000 helpful flags (!!).
while taryn’s not a developer here, she’s got excellent technical experience and skills (true of most community managers). and she commits these skills (especially sql) to helping the stack overflow community. in that context she recently started learning r, so she could apply statistical, data-driven methods to analyze and understand patterns in q&a activity. with the help of her and other people on the team i’m really excited to see what data science can contribute to the community.
my advice to graduate students: create public artifacts
some time after i was hired, i learned a bit more of the story behind jason’s tweet, and that the internal conversation about reaching out to me had started on a whim.
i feel really lucky to have the job i have now, and seeing that made me feel even luckier. the circumstances of my hiring were probably too much of a freak accident to extract any advice from. but if i were to try to give advice to people still in graduate school, here’s what i’d come up with: public work is not a waste of time.
when i was in graduate school i cared most about getting papers published; in my understanding that was the mark of a successful degree, and the only thing that would matter for my career. i ended up publishing roughly the median number for a phd in my field. i’m glad i did so, but honestly it would be hard to point to a way my life would be different if i had published fewer or even none of them. but i do know for sure my life would be different if i hadn’t posted about the beta distribution, and even more different if i hadn’t started answering on stack overflow at all.
journal articles are one way of creating public work, but far from the only one: they’re slow to review and they need to be “perfect” before they’re submitted. i think there’s a dangerous attitude that they’re the only way to make work public, and that therefore a lot of good work in academia languishes for years or disappears entirely because it’s not quite a paper (certainly none of my blog posts would qualify for submission as a journal article). so i’d say that if you have something interesting but it’s not quite a paper, write it as a blog post, or a stack overflow answer, or an open source project on github. just get something out there!
like i said at the start, i’m really glad i answered that question about the beta distribution. it gave me the chance to work on a product that’s done so much for my programming knowledge and productivity. i get to work with the people who build it, who to this day consistently impress me. and one year in, it’s been the best job i could have asked for.
well, almost the best.
Published at DZone with permission of David Robinson, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.