#5 Data Science, Epidemiology and Public Health (with Maëlle Salmon)

Maëlle Salmon, a data scientist who studied biology and statistics, works on epidemiology projects using data to measure health impacts. She describes a study in rural India that collected air-pollution data to assess cardiovascular effects, and a European analysis of cycling infrastructure's health benefits. She emphasizes reproducible data management, open-source tools, and building diverse communities in data science.
Chapters
In this episode of Data Framed, a Data Camp podcast, we'll be looking at how data science is impacting epidemiology. I'll be speaking with Mael Saman, a data scientist who has worked in public health, both in infectious disease and environmental epidemiology. We'll be talking about the role of data science, statistics and data management in researching the health effects of air pollution and urbanization. In the process, we'll dive into the continual need for open source toolbox development, open data knowledge, organization, and diversity in this emerging discipline. I'm Hugo Baun Anderson, a Data Scientist at DataCamp and this is Data Framed. Welcome to Data Framed, a weekly Data Camp podcast exploring what data science looks like on the ground for working data scientists and what problems data science can solve. I'm your host, Hugo Bown Anderson. You can follow me on Twitter HugoBown and you can also follow DataCamp at Data Camp. You can find all of our episodes and show notes@datacamp.com Community Podcast Hey Mael, welcome to Data Framed.
Hi. Thanks for having me.
It's such a pleasure to have you on the show. I'm really excited to be delving into the role of data science in epidemiology, thinking about the RSTATS community, the role that the R community plays in data science in general today with you. But first I'd like to find out a bit about you. How did you get into data science originally?
Well, I've always liked math, but I was really interested into biology applications of math. So that's why I started out as a biology major and I really thought I would be a lab person. But then I did some lab work and I hated it. So I realized I needed to spend more time in front of a computer and that's how I discovered epidemiology, which is a way to look at life sciences application, use a lot of math and not do lab work.
When you were doing biology, you realized that either pipetting or spending time in the lab wasn't what you enjoyed the most. So you started programming and doing data analysis and that type of stuff.
Yeah, exactly. And this applied to epidemiology. And after doing that, after doing my master's in public health, I looked for a PhD and I thought it would be an epidemiology PhD and it was actually a PhD in statistics, which I hadn't done a lot of before because I had mostly used modeling, mathematical modeling in my internships and research projects. I was curious about statistics and it actually worked well. So I got my PhD and after that I looked for new positions, and the one I was very interested in and that I got was a data manager and statistician position. I wasn't a data manager at all, but that's when I learned the data management pattern, I guess. Statistics, data management. That's when I became a data scientist for real.
That's cool, because I don't know if you know much about where I came from, but I did my postdoc in a cell biology lab. My background's in pure math. Started doing applied math, and I was hired as a postdoc, ostensibly to do applied math, mathematical modeling. But that's where I got there and realized I needed to start doing a lot of data analysis, a lot of statistics. And that's when I learned R and Python as well, formally. So there's a similar trajectory there. So you didn't originally think of yourself as a data scientist, though, right?
No, I didn't. I thought of myself as a statistician because I worked. I had worked so hard to get my PhD in statistics, you know, so getting this statistician title was important for me. But then I did a lot of data wrangling, and for Women's International Day, David Robinson sent out this tweet, a series of tweets, where he was like, kind of making an advertisement for women in data science in statistics. And he put my name in a tweet of a data scientist, which was first, like, I was very happy and thankful for that, but also very surprised. And that's the first time I realized, oh, yes, I'm a data scientist.
And actually you have a lot in common with Dave. And one thing I admire about both of you is how much you like to communicate around data science and to blog. So maybe you can tell us a bit about that.
Yeah, I think I started blogging because I had all this small projects I had done for fun, but there were GitHub repos, and in some cases I had tweeted visualizations. But I had never taken the time to really explain how I had done these things. And I thought it would be great to blog about it, to take these old projects and just put them into blog posts. And actually I was very inspired by what Dave did and also what Julia Silji did as art blogger. So I really wanted to have fun blogs, as they do. So they were my inspiration.
So let's talk about epidemiology. What is epidemiology?
Well, it's a lot of things. So officially it's when you study the determinants of Disease. So what causes disease and how these determinants and how disease are distributed in a population. So it's a science, but it's a very applied one because the goal of doing all these studies is to control disease to improve the health of a population. And this population might be a human population, animal population, plant population. So you're really trying to improve the health of a living thing, but not necessarily humans.
So Mael, there are different types of epidemiology, for example, infectious disease epidemiology, to my understanding, versus non infectious disease epidemiology. Can you speak to this distinction?
Yeah, exactly. So sometimes when people say epidemiology, they only think of the movie contagion. So this is infectious disease epidemiology. So you're looking at Ebola, salmonella, this kind of disease. But there is also another kind of epidemiology which is looking at, for instance, cardiovascular disease, which is definitely not infectious, but which still need to be studied. So when you do epidemiology, you might be doing any of these things and, well, you might be doing this for humans or not for humans. So it's a very varied field.
Yeah, and I suppose obesity is another example, right?
Yeah, and I'm glad you mentioned that because I was first told it's a boring issue. When I started being interested in epidemiology, I needed to talk with a professor at my university that was in charge of helping me with my curriculum. And when I told this person about epidemiology, this person told me, oh yes, do that, but don't do epidemiology of obesity because it's a burrowing issue. So that's what this person told me. I was quite shocked. So it's not true. There is no borrowing issue in epidemiology at all. There is nothing we've completely figured out. And if you're not interested in obesity, that's fine because there are a lot of other things to study.
Yeah. And so something. I'm not quite sure if I'm correct or not, but my understanding is even with non infectious epidemiology, there can be network effects. For example, with obesity, if you're in a social group with a certain number of obese people, there's a higher probability of you being obese.
Yeah, exactly. So epidemiology is a very interesting field because it's not only about biology, it's also about social factors, for instance, that can influence your health. So it's very varied in that sense.
And it seems like it would be a very motivating place to work because you're doing something to improve people or other organisms health, right?
Yeah, exactly. That's what I think. I think it's very motivating because you're doing something good or you're trying to at least to improve the health of, I mean, global health, health of humans and health of animals. So it's very motivating in that sense.
So what are the most interesting challenges in epidemiology today, in the modern landscape of epidemiology?
I think it's an interesting question because I'm not sure any challenge is more interesting than another. But something that I really like to mention is that you can actually prioritize which research needs you're going to answer. There is this global project called Global Burden of Disease. So they're collecting data, modeling when data. Well, modeling to do statistical analysis, but also modeling when data is not enough, when data is too scarce. And what these people are doing is making a list of the most important causes of mortality, for instance. So right now you can say, for instance, if malaria is an important cause of mortality and if its effect is decreasing or increasing. So using Global Burden of Disease data, you could actually choose an epidemiology project that seems more crucial because it affects more people or because it's increasing.
Great. And is this all open data that they have?
Yeah, I'm not too sure whether the raw data is open, but they have a fantastic website where you can play with data visualization. So they're doing great work at communicating their findings. So in scientific journals, but also on this website with visualization with interactive tools where you can really visualize and play with the data to really understand finding for yourself.
Yeah, that's really interesting. And I think the role of interactive visualization, interactive data visualization is becoming more and more exciting.
Yeah. And actually I don't use a lot of interactive visualization myself. I mean, I don't play with them a lot. But I remember someone telling me about the global burden of disease projects and epidemiologists and telling me. And what I really like about them is this and showing me an interactive visualization. So I think they've really chosen a great way to communicate what they do.
So what are some other challenges in epidemiology that you currently find interesting or you're thinking about?
Well, so I say that the Global Burden of Disease helps you see what are the most important causes of mortality and disease. And if you compare that with existing research with results that have already been published, you can see that there is sometimes a gap so if we look at air pollution, at the effect of air pollution for instance, so most research has happened in high income countries, but most exposure and well, most people live currently in low and middle income countries. So I've worked for a research project called chai, this means cardiovascular health effect of air pollution in Telangana India. And this is one other research projects currently that aims at bridging the gap between existing research and research need we have in the field of air pollution.
Amazing. And so does that involve collecting more data or what type of things is CHAI doing to bridge these gaps?
So CHAI has been collecting a lot of data because in a place like India, so it's not like if you're looking at air pollution in say the US you can partly rely on data collected by the epa, which you cannot really do in India because there are less monitors. So data collection is very scarce and not necessarily open. And because CHAI is happening in a rural area, there was no air pollution monitor for ambient air pollution. So CHAI set up ambient air quality monitors. And on top of that there was a lot of data collection from people. So having them wear for instance personal air pollution monitors, having them fill questionnaires. So a lot of data was collected from the environment and from people themselves.
And so data collection is one thing, but then I suppose data management is a huge challenge when we're collecting so much data.
Yeah. So as you can imagine it's a lot of data. So you will necessarily have a few mistakes and a few things that don't really correspond to one another. So it was important to clean this data. So for instance, we were using a very cool personal air pollution monitor which was small and which gave you one really regular measures of a person exposure to small particles in the air. So this is a cold device, but it's actually not completely production ready. So it had a lot of issues in the data. So we had to spend for instance, a lot of time looking at this data and cleaning it before using it.
So this project in particular was in a rural area, you said, what's the role of urbanization in thinking about epidemiology?
So because of urbanization, so a lot of environmental factors are changing into people's lives. So this happens in India, but this happens in other countries. A lot of people are living in cities. So I'm going to branch out from CHAI and mention another project that I've worked for which was looking at how city infrastructure might change people's health. So the way your city is organized will influence the way you Go to work, for instance, the way you're commuting. And this project was looking at the influence of putting more cycle paths in your city and health. So it was very interesting because we had to model the influence of the length of bike paths you had in a city, how this influenced the number of people that go to work on a bike with public transport in a car, and how this in turn influence health.
That's incredible. That's such a diverse set of tools and ideas and concepts. I mean, you have city planning there, you have health, and you have data science, data management and statistics all converging there. That must be a really exciting type of project to work on.
Yeah, exactly. And it also means that you never feel completely expert in any of these things, but you're learning a lot and that's why it makes it so motivating.
Yeah. And that's something people, data working data scientists always say to aspiring data scientists is you need to be willing and have a strong desire to be learning constantly because you'll be working in domains which are challenging you that you may not have so much experience in as well. Right?
Yeah, exactly. Like when I started working for chai, I'd never done data management. So a really strong quality you need to have as a data scientist, the willingness to learn, but also the capacity to know where to look for resources to do things right or to learn how to do them right.
Yeah. In general, how do data science and statistics help to solve challenges in epidemiology?
Well, epidemiology is really like a evidence based field. So when city managers or like public health people make decision so often they will use evidence from epidemiology. And because of that, epidemiology relies on a lot of data analysis and statistics, statistical work. So that's what statisticians and data scientists are doing in epidemiology. Something that's interesting. If you look at statisticians, they like to develop fancy methods for doing things and then you have epidemiologists having their issue. An important point that will really make statisticians make a difference in epidemiology is when they actually publish their work as a software, as something that epidemiology can use. So I think an important part of the work of data science in epidemiology is providing software tools for epidemiologists to then use.
Yeah. So that would involve not just publishing a result about some convergence property in a statistical paper with one use case, but actually getting open source code out there in the real world and hopefully getting a bunch of Users trying it on a variety of projects, right?
Yeah, exactly. And actually, when you're writing such a paper, like a methods paper, you actually write code because you're testing your methods for yourself or on a simulated data set, on a real world data set. So you have code somewhere on a computer. The real effort you need to make is then documenting this code. And for instance, if you think of R putting into a package documenting it and testing it. And this part is crucial, but it's not rewarded a lot in the academic system. But if it doesn't happen, your methods won't be used by real world people and won't make any difference for epidemiology.
So actually, in your thesis you have a great quotation which speaks to this, right?
Oh, yeah. I was actually asked by my supervisor during the last week of my thesis writing to add a quote at the end of my thesis and I actually panicked because I had no idea what to write. I wasn't in a time to be inspired. I was really stressed by writing my thesis. But then I thought of one of my TABOR statisticians who sadly died this year, Hans Rosling. So he's a Swedish statistician, and he said, let my data set change your mindset. So that is cool because he's using a lot of data to show. Well, he was using a lot of data to show people how the world was, which is different from our prejudices when we don't think with data. And what I said is that having this statistical tool was a different version of discord. So I said, let my tool set change your mindset about your data set. Let me show you everything you can do with your data. If we just apply this method, your data is more valuable than you think. If we use these tools.
That's amazing. So you altered let my dataset change your mindset to let my tool set change your mindset about your data set. I love it. It's now time for a segment called Blog Post of the Week with Data Camp curriculum lead Spencer Boucher. So, Spencer, you're here today to talk about a blog post that you read this week and loved.
Yes, this week I've got a blog post called Project Oriented Workflow by Jenny Bryant. Jenny's a software engineer at RStudio and a professor at the University of British Columbia. We'll include a link to this in the show notes.
What's the post about?
Well, so when Jenny gave a talk at an R conference in New Zealand on the topic of using R efficiently, two of her slides in particular Generated a lot of heated discussion. So much so, in fact, that today's blog post of the week was born. The crux of Jenny's post is essentially a call for analysts to clearly delineate workflow from product in their analyses.
So how does Jenny draw the distinction between workflow and product?
Okay, your workflow incorporates all of your personal preferences when doing data science. So that's your text editor, home directory, any convenience functions that you like to use in your interactive console, etc. The product, on the other hand, is the data and analysis itself, including everything necessary for anyone else to run your analysis and get the same result.
So how can workflow and product get mixed up?
Okay, so Jenny works in R, so I'll use her R examples. But the same ideas apply to Python and any other language that you use for data analysis. One really common example is changing your working directory explicitly in your scripts. This may work fine on your computer, but it will single handedly cause your script to fail anywhere else.
And what's another example?
Sure, although code in your R profile is a great way to customize your working environment, you shouldn't put things there that affect the behavior of the code in your script. So, for example, changing the number of rows of output when you print a data frame in your interactive console, that's fine. But changing the way R handles NAS or factor variables by default in your R profile will cause errors or even worse, inconsistent results.
So why is this a big deal and why should we care?
Well, ultimately, it all boils down to reproducibility. Most of us have experienced the pain of receiving an analysis from a data scientist that didn't properly separate workflow from product. And if you haven't, you will someday. Don't be that person. If you follow the golden rule of separating workflow and product, your analyses will be more accessible to others, meaning better feedback from co workers for you and more exposure for whatever your awesome side project is.
So how, when doing analyses, can our listeners out there make sure that they've properly separated workflow and product?
Here's a couple of Jenny's recommendations. Don't use a single R process across all of your analyses. Keep each analysis as a separate project with its own R process. Also, periodically run your script in a fresh R process from scratch just to make sure it's in a fully runnable state. So definitely go check out Jenny's blog post in the show notes. You'll be able to implement her suggestions in probably just a few minutes. Your life will get easier overnight and your analyses will Be more shareable for the rest of your career.
Thanks Spencer, for sharing your blog post of the week.
Thanks for listening everybody.
Time to get straight back into our chat with Mael. And so I want to jump back into talking about epidemiology, but actually before that, because I know you're so passionate about tools and software development for practical statistical data science epidemiology projects, I thought maybe you could speak to your role in Ropensci for example.
Oh yes. So Ropensci is a community of researchers and developers that provide tools for open science and reproducibility. And I got involved in that committee when I so. Well, like I think two years ago. Now some part of the tools that OPENSI has are developed by staff, but another part of these tools, a big part of them are developed by community that submit their packages to our OpenSight. And our OpenSight ensure a good quality of software by having an onboarding process. So when you want your package to become part of our OpenSite, you need to have it onboarded. And what happens is an open and transparent review of your code and documentation by two independent reviewers. So all of this happens on GitHub using guidelines. So what I did two years ago was submitting my package and I wasn't too sure what to expect and what happened was a very friendly and helpful review of my package and I got more and more involved and I'm now a co editor for onboarding. Yeah. And so I help ensuring this process goes well and where we really ensure the quality of software in our OpenSai suite of tools.
That's incredible. And I think it actually feels. Well, clearly it fills such a huge gap that's left open, you know, by the world of scientific publishing and scientific journals. Right. I mean, essentially one way of viewing some of the work at our OpenSCI is it's a peer review process. Right. Similarly, for scientific results that come out in journals, this is a peer review process for software to help scientists do their job.
Yeah, exactly. And it really increase the focus on your software quality. So when you publish a paper as a statistician, no one is going to look at your code, I mean, most often. So maybe you have a huge mistake in there and no one is ever going to find it. And having software review is a way to prevent this problem from happening. So our OpenSight is part of the solution to the problem. But of course there should be more software review in general. And interestingly, at our Open Sci, we have partnership with two scientific journals, because when you submit your package to our Open Sci, you're not actually publishing it as an academic, but because of this partnership with The Journal of OpenC Software, a method in Ecology and Evolution, you can actually have your software reviewed and get like a doi, something that you can put on your academic CV and that's more valued in the current system.
And you recently wrote a blog post about writing R packages.
Yeah. So I was invited at a Nekology hackathon to give my top tips for developing software packages that are high quality and user friendly, which is a bit daunting and there are a lot of good resources for doing that out there. So my blog post is a summary of all these tools that I know that I've used all these resources like books and blog posts that one can read to improve their software writing and I think it's important to have such summaries. But also I was asked to give my top tips, which surprised me because I don't feel like an expert. Like two years ago I submitted my first package and I really hope that adding such things like my blog post hardware help people finding resources to build their skills because I think that if I was able to learn all these things or part of these things in two years, then a lot of people wouldn't think they're able to actually able to learn more about software quality.
And this speaks to a more general notion of knowledge organization as well, which I know you're passionate about. When thinking about the role of statistics and data science in, in epidemiology, ecology, air pollution, insurance, maths, whatever it is. I know that the idea of organizing knowledge is something you think a lot about, so maybe you can tell us a bit about that.
Yeah, so as a data scientist, often as a statistician, you will be the person that will formulate the issue. Someone has like an applied person in mathematical terms so that like you will make it more abstract. And look, you will get a formula, a model, whatever, which is a way you will find resources from other fields from I know pure mathematic, pure statistics to solve the issue. For instance, what happened to Me during my PhD thesis, I was seeing something in my data with the distributions I was using and my use case was reporting delays. So the fact that when someone gets sick with say salmonella, the National Public Health Institute doesn't know of it right away. So there is a time, like there is delay between this person getting sick and their case being reported. So this is one use case and I had this distributional issue, this statistical issue. I was seeing something I needed a theorem and a proof of A theorem. And I needed to Google a long time because I was using the keywords from my epidemiology field. And then after a while I found exactly the solution to my issue, but in insurance, mathematics and in actually a German book. So I was really lucky to find that. And I guess that's why I mean by knowledge organizations, because sometimes different fields use different keywords. People might be doing exactly the same thing, the same statistical thing, and not knowing that this issue has been solved elsewhere. So as a statistician, you need to formulate the question in statistical terms. And also you need to be able to branch out a bit and look in other fields to see what has been done.
Yeah. And so as a community, how can we, a community of data scientists, statisticians, work towards better knowledge organization?
I guess an important thing is that we have this community, as you say, and there is a single data science community. Like there is not an epidemiology data science community or insurance mathematic data science community. So people, because people talk to each other and they should do a lot of that, then they can see this power of things. So we really need to think of data scientists as a role and to talk to each other in this global community, no matter the field where we apply data science.
I'm actually really glad that you mentioned keywords and search engines and this type of stuff because this is another piece of advice I always give to people starting out in data sciences. Search engines will be your best friends.
Oh yeah.
And in fact I did a, I did a live coding session recently. It was on Facebook Live actually, where there was a pandas function I just couldn't, couldn't figure out. And I spent. It was actually relatively awkward in the end because it took me like six or seven minutes to get there and I wasn't sure I'd be able to finish the project. And in the end the response was Hugo, that was some of the most valuable stuff. Seeing you really like freak out in a search engine because that's the type of stuff we'll need to do when we work as data scientists.
Oh yeah. I was actually certified as a data capentry instructor this year. So I followed this training as part of the carpentry instructor training. They tell you that it's actually great if you do a mistake in front of the students. You shouldn't hide it. You should really embrace it and show them how you solve mistakes when you do one, how you solve a bug.
So speaking of how the ins and outs and inner workings of data science in Your work, what type of data science or statistical tools did you find interesting in your bike paths project?
So what happened with this bike paths project? So that's what not my main project. What happened is that I had this colleague who was working on cities infrastructure and she had data from six cities in Europe and she has a length of cycle path in these six cities. And she was a bit unsure how to use them because cities define cycle infrastructure in different ways. Like you could have one city saying, oh, this road is safe, so this is cycle infrastructure, but it's not dedicated cycle infrastructure. So she asked me, do you think we could use OpenStreetMap data to solve this issue? And I said, oh, sure. So it was a fun challenge. So there are tools for getting OpenStreetMap data and OpenStreetMap as labels for the dedicated cycle path. So this happened for six cities. And once you've written the code for six cities, as you know you can scale these codes for any number of cities you want. You just need to change name of the cities. So what started as this question for six cities ended up by our getting data for more than 100 cities in Europe. So really increasing the quality of the modeling in that project. So I guess the technique in that work was mostly data wrangling and Data downloading from OpenStreetMap.
Yeah, and this speaks to a point that has come up a couple of times in our conversation now. So it's worth focusing on for a second this idea of open data and how relevant and important and useful it is. What's your take on open data?
Well, so for instance, in that project we loved open data. Without open data, we wouldn't have got all this cycle path data. And we also got a database that exists of the percentage of people in a lot of cities in Europe that go that commute, that do their trips on a bike or in public transport. So these data exist. And without this data, it would have been much more difficult to do health impact assessment of cycle infrastructure using of air quality, which was so important to me when working on CHAI and which felt very important to me. We need to air quality data to assess the effect that it has on health and the effect of different measures. But it's actually very hard to get air quality data in many parts of the world. And it's more complicated and we might think so if a city has a website with the current value of ozone. So it happens sometimes that you have such a website, so you get the current value, but you never get the past value. So values disappear over time. What I discovered when working on Chai is a very cool initiative by Christa Azenkopf and Joe flasher. So these two people developed a platform called OpenAQ that saves all this data from many websites in the world and make them available for everyone to use so these values don't disappear over time anymore, for instance.
That's awesome. And OpenAQ has all its data available, but my understanding is even on top of that they've got software, right? They've got an R package.
Yeah. So that's my contribution. My small contribution to wearmoq was writing an R package to get the data. So they have an API, so they make the data really easy to access after writing all the adapters from official website and data website. And so I wrote this R package so that anyone can get this data in R without knowing anything about API queries.
What type of techniques are most important when thinking about this type of data? I mean, you've got geospatial data, time series. Are you interested in prediction? What type of techniques do you use when working on this?
You mean on air quality?
Yeah, air quality, epidemiology, the type of stuff you've been working on.
My impression is that often I've not been using fancy techniques. But what is taking the most time is thinking of our. To communicate uncertainty to people, to colleagues in papers. Because it's such a complex notion, important notion to communicate, not giving a single number when you're estimating something, but also giving continuous intervals or prediction intervals. And how do you explain them? So that's a really important thing.
Yeah, absolutely. And we see that in the media, when presented with job reports or polling and this type of stuff, it's commonly a lot of these numbers are reported as concrete numbers that are taken at face value as opposed to the news being reported. This is a number, but this is how certain or uncertain we are about it. Which would be great to see that type of stuff more and more, I think.
Yeah. And I'm thinking of an example that's not related to epidemiology, but I've seen recently, I don't remember where they said that when you get a review on Amazon, you should trust a review, but have the most that have been written by more people in total than the reviews that have only like, I don't know, five opinions.
That is a great example. I mean, that's. In essence, we're talking about sample size there. Right. So if you've got a few reviews, you can't really be certain of how good the product is. Whereas if you've got 5,000 to 10,000 reviews, you can. Very cool. So we've touched on this idea of data management, which of course is becoming increasingly important as we get more and more data, data from the world. Maybe you can speak about some of the work you've done in data management, particularly on chai.
Yeah, so one thing that was important was of course data cleaning and building an SQL database. But one thing that was important was documenting the database. Like now I've left this project and people will use the data and in a few years from now most of the experts from the project will have left. So our people are going to be able to use this database. You need to document that. Because it was the first time I was documenting such a big database, I had to look for ways to do that. The best way to document database nowadays is to use metadata, which is data about data following a standard. And what I used for CHAI was eml, the ecological metadata language, but actually also applicable to other fields. So it's a set of XML standards. So this sounds very. Well, this sounded very scary to me in any case, but when you use such a standard because it's matching readable, you can compare it to the standard and validate it. So say this standard needs units, so you will need to document units. And this standard needs this thing, you will need to add it. For me it was very good to find such a solution to document data because I was really afraid to forget something because it was the first time I wasn't sure what to put in the documentation. And using a standard you're completely sure, well or mostly sure that you've documented everything that should be documented and in a good way because it's machine readable. We can hope that in the figures, if someone has data from another epidemiology project somewhere else, it will be easier for a researcher to merge the data sets and to use them in a meta analysis because the documentation is machine readable and similar in both projects.
What type of problems would occur if you hadn't done this?
Well, I imagine that I could have forgotten some important things. Like if you don't document units, your numbers become useless a few years from now. And I guess that's one of the most important issue. And if I think of the first database I ever documented, like a long time ago I remember writing a Word notebook, so I hope I think I had saved as PDF, but maybe, maybe I could have forgotten to do that. So if your documentation is in such a proprietary format, you could think that Maybe sometime like a long time from now, people won't be able to open it. Whereas with an xml, this won't happen. It will. It's like a text file. You can still open it and read it.
Yeah. The idea of units is really interesting. I'm going to get this story completely wrong, so I'll just mention it very briefly. Greg Wilson, a colleague of mine, who, who, who, you know, who created the. The. The carpentry software. Software Carpentry. Originally, he has a story of a data analysis project where there was one feature called temperature, and it wasn't marked whether it was in Celsius or Fahrenheit and it was from the Antarctic or something like that. So it was around the range in which Celsius and Fahrenheit coexist, or they're the same. And what they had to do in the end was trace back where the ship where the results were taken had left from, because the port where the ship leaves will tell you what units were actually used, what scale was actually used, something incredible like that. So I think that example speaks to exactly what we're talking about.
Yeah, that's funny that you should mention that, because we had a monitor that output whose output was also a temperature, like in shy, but without units. But there was another variable that you got that was units. So we have such a table with numbers that are temperature and another column if you wish, in this data set is our units, because units are not the same for every line.
Yeah. And the other thing that you hinted at was data management being essential to having reproducible workflows and reproducible results downstream as well.
Yeah. And I also think data management itself can be reproducible. So everything I've done, things data, was done with an R script. So I did nothing by hand. Even at some point I corrected typos. And I have a lot of rdsub comments for correcting all the typos because I really didn't want to open the file and correct the typos myself. So this way even the data management is reproducible. So we got from the raw data to the corrected data that we use for further analysis is reproducible, which is great, because if at one point we're surprised by one value, we can probably trace the mistake back or trace the origin of the problem back to where we came from.
Now it's time for a segment called Stack Overflow Diaries with datacamp curriculum lead Cara Wu. Hey, Kara.
Hey, Hugo. I've got a really fun installment of Stack Overflow Diaries. For you today.
I am pumped for this. What question are you going to tell us about?
The question comes from the Statistics Stack Exchange site and user Kevin Kim wants to know how to understand the drawbacks of K means clustering. I'll post a link in the show notes and definitely encourage people to read the answers to this one.
Can you tell us a bit about K means clustering just to set the scene?
Absolutely. K means clustering is a way to divide up data into a given number of groups so that each data point belongs to the group with the nearest mean value. So for an example, say you had a data set of the weights and heights of some babies and adults, but the data isn't labeled, so you don't know which are babies and which are adults. If you plotted this data on a scatter plot, there would be two fairly distinct clusters of data points. And K means is a way to automatically group data into these clusters.
That's a great example. So what was Kevin Kim's question?
I'm going to paraphrase it a little bit. Kevin Kim says that the drawbacks they've read about K means clustering are that it essentially assumes that clusters are spherical and roughly the same size. However, Kevin's understanding of K means is that no matter what, it will produce clusters that minimize the sum of squared errors. So they don't understand the link between this and the assumptions described.
That is a great question, and I'm looking forward to the answer.
Part of the reason I chose this question is that it features a truly stellar answer from Dave Robinson. By generating and plotting some data, he demonstrates how minimizing the sum of squared error does not necessarily yield the most natural clusters. In the first case, he shows a scatter plot of data with two clusters. One cluster is concentrated in the center of the plot, and then there's a ring of data points around it. To the human eye, these are clearly two concentric clusters of data. But as Dave demonstrates, K means clustering splits them right down the middle of the plot instead. In another example, he shows data that to the human eye, clearly form three clusters with different numbers of points. But K means ends up splitting the largest cluster into two. And another user ananimous expanded on Dave's answer and pointed out that K means will also create clusters, even on data points that are totally uniform.
I'm a huge fan of showing these types of principles at work via example. So to reiterate, K means will always minimize the sum of squared errors. But the point is that there are data sets in which you don't want to do this in order to cluster them, right?
Exactly Hugo. Although Dave shows cases where K means quote unquote fails. As he points out, these failures reflect the assumptions of the algorithm that allow it to succeed in the kinds of cases it's designed for. For I'm going to quote Dave because he says it so well. Assumptions are where your power comes from. When Netflix recommends movies to you, it's assuming that if you like one movie, you'll like similar ones and vice versa. You can't make a recommendation algorithm without making some assumptions about users tastes. Just like you can't make a clustering algorithm without making some assumptions about the nature of those clusters.
Thanks Kara. If you enjoyed that listener, be sure to check in for the next episode of Data Framed. Our guest will be none other than Dave Robinson himself, here to talk about Citizen Data Science. Thanks Kara, once again for reading us a page from your Stack Overflow diary.
Of course, Hugo, and chat next time.
Let's now jump back into our interview with Mael Salmon. Something we've mentioned in passing is the idea of community in data science and you're part of the RSTATS community, which seems like a really wonderfully welcoming open community for the most part. Can you speak to the idea of community and how you felt your work has developed?
Yeah, so I've always felt very welcome in the right community. So I think I got on Twitter roughly at the same time that I started doing data management and reading things on Twitter, asking questions. So before when I was working on my PhD, I was on my own. But then I started discovering this old community. So it's welcoming, but I think we could do better. So if so right now the community is not as diverse as it could be. So we're probably missing talents from some parts of the world. We're probably missing talents from women. So there are currently some initiatives in our community helping to increase diversity and to not miss these talents and also to make the community welcoming for everyone, even the people that had bad experiences before so they feel they can take part in this, in this community.
What types of initiatives are you talking about?
Yeah, so there is one from the R Foundation called Forward. So Forward started out as being a task force from the R Foundation for women, and then it branched out and it's now an initiative for women, but also for people, for instance, for parts of the world that are often not represented in their community and they have a lot of actions, one of them being surveying people after user conferences to get a better idea of our experience and of the characteristics of people taking part in user conferences. And they also gave scholarships for user this year. So some people that probably couldn't have come to Brussels could come. And when they did come, thanks to their scholarship, they could also take advantage of a conference buddy system. So think like you can be at a conference and not meet anyone because it's very hard to start speaking to people if you don't know any person. So the conference Betty idea was to have a first even for the scholarship holders to meet people the conference that were the conference buddies. And then during the rest of the conference they had some people to talk to and then could meet many other people. Otherwise the conference experience can be less cool if you feel shy and isolated all the time. So that's the kind of thing forward styles. So this is one initiative. Another one is Our Ladies, which is a grassroots organization. So it doesn't come from the AL Foundation. It was created locally in San Francisco by Gabriela de Carrous a few years ago and there was another chapter in London. And these chapters got together and created Alidis Global which has helped creating many local chapters since I think 2016. For instance, I co created the Barcelona chapter in Spain. And these chapters aim that have meetups and they provide a safe and friendly environment for women and actually any person that does not identify as men. So it provides a good experience for all these people.
Yeah, that's fantastic. So that's diversity of data scientists. What about diversity of users?
When you're a data scientist, your user can be. I mean, it depends on your perspective. Let's say even if you're not a data scientist, you're an epidemiologist and you create a map of incidence of salmonella in a region and you decide that the counties with the most incidence of salmonella will be red and the one with the least incidence of salmonella will be green. You have what you think is a very intuitive color scale. So because red is bad and green is good. But actually this is the kind of visualization that cannot be seen by colorblind people. One might think that because the majority of people are not cloudblind, it's not an issue. But first, this is quite unfair to not think of all your users. You should try to accommodate for everyone that might want to use your visualization. And also it's interesting to see that there are tools currently for instance in R that help making colorblind friendly graphics with not much effort. So you have a package for seeing how your visualization would look like if you are colorblind so it's called Colorblinder. And if you use it, you really see that red green is not a good idea. And then you have other packages providing color scales that are colorblind friendly. So various are called color space, for instance. This means that it's very easy for you to make your graphic friendly to colorblind people. You just need to be aware of the issue. And this is one issue that I know of. But I guess that sometimes when I produce something, I'm not thinking of all users and I'd like to know more about how to serve the diversity of users of Data Science products.
That's cool. And I actually appreciate that as I myself am red green, colorblind. So yeah, I definitely appreciate that. Are there any other types of users?
Yeah, so you might have noticed by now I'm not native English speaker. And I guess that's okay for a lot of people in say the ARC community. And most of the materials in Data Science or are in English. And we need efforts to accommodate for all kinds of users, even the non native English speakers. So now I'm an R user, I have experience with R, so I'm not afraid of reading R error messages. But say when you start using R, R is a foreign language for you. And if English is a foreign language for you, it's even more difficult. So our error messages are translated, which is great. If you start looking at videos to learn about our say on Datacomp, it's great to see that Datacomp now has subtitles to help people really be able to grasp all the content without too much effort.
Absolutely.
We should not forget that not everyone speak English to begin with.
We're very fortunate at datacamp in that we've actually had members from different communities reach out to us and translate some of our courses into, into their, their native language. So I think in the early days, even our first introduction to our course and Intermediate were translated into, into Mandarin. So that that existed in the community, which was. Was beautiful to have that type of, type of outreach. It's fantastic that error messages can be translated into, into different languages. How many languages do you know are supported in in R, for example?
I actually have no idea, but I would say a dozen. I've actually looked at it recently because I was at an Ecology hackathon where a group was working on translating error messages not into another language, but into simple English, the Wikipedia simple English. So we're making error messages understandable for the students and that's why I looked at this page that you have of all the translation teams of error messages, I think a good dozen of languages were supported. I was saying on Twitter, most of the conversation happened in English on the Airstats hashtag. But recently two new hashtags have emerged, one of them in Spanish, which is airstats, the same hashtag with es at the end. And another one is airstatsfr for French. So I really hope that this conversation conversations will happen in as many languages as our aromatages, for instance.
So a lot of people, I think there's a perceived barrier to entry for data science, thinking that it's something that only experts can do, which we're trying to break apart in a number of ways. My question for you is what are the roles of education and outreach in making data science and statistics as accessible as possible for everyone?
When you start in data science, you will need to learn things. So I guess that's why education is so important. But what's important is to really empower people with the belief that they're able to learn these things. So not tell them, hey, go and go and educate yourself. So helping them to get educated in a really friendly way. And one example I have is I said I submitted my first package to our OpenSight two years ago, and really there were things that I didn't know anything about. I think I didn't even know continuous integration, which is part of the guidelines of packages. And the reason why I stayed in that community and learned so much is because people were so friendly and helpful and there really had no trouble helping me. And that's something we keep doing in our OpenSite. So if you were not too sure about some things about package development, we can help you with that before you submit your package. So this means people feel they can learn about package development and of course after that they learn about that.
And what about the role of community in general in helping people get started?
I guess, for instance, if I think of the Alidis community, we tend to support each other a lot. Like for the Barcelona local chapter, we had these meetups where we could talk about R, but we also had a local slack to discuss and we had an R help channel, so where people could ask a question. And I guess the community part of it is that these people in this community are sort of friends, so you're not afraid to ask them questions. So you really learn together and in this safe environment.
So it's really about being as opening and welcoming and I suppose have as much empathy as possible for beginners.
Yeah. So this idea of being Empathetic with beginners is something that was made popular by Jenny Bryant, for instance. So she really made this popular and I think it's an interesting idea. So not. Not to think as beginners, as stupid people, for instance, or as people who don't make enough E for. I'm not sure that a lot of people think that anyway, but really think of how from this perspective and how you can document, for instance, your tools so that they can understand that. Because we were all beginners to start with.
So we've discussed a lot of different aspects of data science. Techniques, methodologies, applications. What's one of your favorite things, techniques or methodologies for data science? Something you enjoy doing?
So that's something you've mentioned previously. You said that you tell newcomers in data science that their best friends will be search engines. So that's my favorite techniques. When I have an issue, I will first look scientific literature and I will google the issue to find what exists. Not because I like plagiarism or something, but because I'm quite sure that I can be inspired at least by what already exists. And I don't like reinventing the wheel. So I like, I like being creative, but I don't like being uselessly creative. So I think that's my favorite methodology, looking at what already exists.
I love that answer because, you know, a lot of people come in and say extreme gradient boosting or random whatever, or data visualization. But thinking about this practice of using search engines as an actual data science technique, I love and I totally agree. So we've discussed a lot about modern data science, about what it looks like on the ground today. What does the future of data science look like to you?
So I guess my answer will be influenced by what I see as problems nowadays in data science, because I'm interested in diversity with my reference, my involvement in rhs. I really hope that future data science will be more diverse with a real diversity of data scientists and also an awareness of the diversity of the users. And I hope, for instance, that all more code will be open about. More code will have been reviewed by someone like by someone's colleague or by a formal thing such as our open science. So I hope it will be more diverse and more with you.
As one last question, do you have a final call to action for people who want to break in on data science in general?
Yeah. So if you want to get involved in data science or even in a p Data science. So your role as a data scientist will be to bring data science to your team. So that's what you should learn about in priority and I think it's important to get involved in the community and that's also what will make it fun and enjoyable for you. And there are a lot of ways to get involved in your data science community. So I will speak up the R community because that's the one I know the best. So you can for instance submit interesting things that you've read to the our weekly newsletter so that other people can read about that you can blog about what you learn. So even as a beginner and especially as a beginner and even as a non native English speaker and especially like if you want to write in Spanish, so you should blog and report what you've learned and how you've learned about it to help people on their learning journey as well. You should also meet people like not only online but also in the real world by getting involved in your local Hauser group or at least chapter you could start from. So I co founded on Ali this chapter and I promise it's a very cool experience and it's really worth all the efforts that you will have to do. And if you want to learn more about code quality, which will be important in your data scientist career because you will be writing a lot of code, you can volunteer to become a R package Reviewer for r OpenSCI or for general science software, which will make you better acquainted with best practices in writing software and writing science.
Right? That's a wonderful amount of useful and practical on the ground advice. Mael, it's been an absolute pleasure having you on the show.
Thank you. Thank you for having me. And it was a pleasure for me too.
Thanks for joining everybody. In this episode of Data Framed, Mael told us about some of the most pressing challenges of modern public health in epidemiology and air pollution, along with how data science, statistics and open source software tools can help us to solve them. Be sure to tune in for our next episode in which I talk with Dave Robinson, data scientist at Stack Overflow, about citizen data science and a future in which data literacy is a skill possessed by everybody.
Sam.
More from Richie

#359 My Best Friend is AI with Valerie Tiberius, Professor of Philosophy at University of Minnesota

How AI Agents Will Work While You Sleep | Ruslan Salakhutdinov, Professor at Carnegie Mellon

#358 How AI Agents Will Work While You Sleep | Ruslan Salakhutdinov, Professor at Carnegie Mellon







