Author: Arthur Mello

  • Why You’re Struggling to Break into Data Science

    Why You’re Struggling to Break into Data Science

    I see many people having a hard time transitioning from other fields into Data Science, even though there’s more open jobs every day. Many companies end up going for people who already have domain experience or who are fresh out of college, with a degree in Statistics or Computer Science.

    Although it can be hard to make this transition, I did it, and I think you can do it too, as long as you have the right strategy.

    Let’s take a look at some tips to help you land your first job.

    Stop doing MOOCs

    Don’t get me wrong, some online courses are great, but I feel that beginners tend to think that doing ten of those in a year will somehow help landing a job.

    First, if you just do them for the sake of getting a certificate and putting it on LinkedIn, you won’t learn much. Plus, so many people have so many of those that most recruiters don’t care much about it.

    Instead, do a few good ones at first, to have some understanding of the field and to be able to answer interview questions. The one I recommend is the famous Machine Learning specialization by DeepLearning.AI and Stanford, on Coursera. This will keep you busy and give you a good theoretical basis.

    That next book will not help

    The same logic goes for books: many people think that reading hundreds of books will make them magically absorb all that content and become machine learning experts.

    Instead, use books as tools to gather specific knowledge that you need right now. Working on a Time Series project? Reading a book on the subject while you do it might help.

    But again, don’t do it just to cross that item off your list, recruiters don’t care about how many books you read last year.

    Choose the right side projects

    Side projects help you in two ways: building skills and showing off your work. If your first project is doing logistic regression on the Titanic dataset, fine, you are warming up. But that’s not a great project for display.

    Once you know the basics, try working on 2 or 3 projects that will actually display your skills to recruiters, such as deploying a model in production via a WebApp that you can show during an interview, creating a public dashboard or doing a deep analysis on some interesting dataset.

    Some certifications help, others don’t

    There are tons of certifications out there, so choose wisely. Usually, the hard ones also have the better payoffs: GCP, AWS, Azure and IBM certifications can be quite valuable. Tableau and Power BI too. The ones you get from just watching videos on Coursera, not so much.

    If you are doing one of those I mentioned, check what are the most used cloud providers and dashboarding tools in your region, and focus on those.

    Don’t be picky (at first)

    If you are transitioning and haven’t been able to land a great job at first, don’t be picky. If you work in logistics and want to do Machine Learning, maybe a first job as a Data Analyst for a year will get you closer to your goal. Even if you are just doing Excel and dataviz, you are now closer than you were before, so look at it as a transitory move.

    You might need to accept a lower salary at a not-so-great company too.

    Choose a smooth transition

    Let’s say you work in HR and want to transition to Data Science or Data Analysis. Focusing on data jobs related to HR analytics will make the transition smoother to you, and your set of skills will be valuable to your employer. They will be much more likely to accept your lack of data skills if you can make up for it with domain expertise.

    Even if you don’t want to work with HR analytics forever, see this as a transitory move.

    Start with consulting companies

    There are many consulting companies out there who outsource data scientists and data analysts to other companies. They tend to pay less, but the bar might be lower, since they are currently hiring like crazy.

    Do this for a couple of years and you will have enough experience to land a better paying job in the future.

    Focus on your coding skills

    Everyone will say during an interview how awesome they are, and how they have a unique skill set that differentiates them from competition.

    Trust me, you are not the only one who knows how to “approach problems from a business perspective to get insights from data and generate actual value”.

    Instead, build hard skills like Python and SQL, which will likely be tested during interviews, and can actually differentiate you from other candidates.

    If you would like to discuss further, feel free to reach out to me on other platforms, it would be a pleasure (honestly):

  • LLMs Predict Words. LCMs Predict Ideas.

    LLMs Predict Words. LCMs Predict Ideas.

    How Meta made AI even closer to how humans think

    Traditional language models (LLMs) process text one word at a time.

    They predict the next token based on the ones before it.

    That works well, but it’s not how humans think.

    When we write or speak, we don’t just string words together.

    We organize our thoughts into sentences, ideas, and concepts.

    That’s where Large Concept Models (LCMs) come in.

    Instead of predicting the next word, LCMs predict the next sentence.

    Each sentence is treated as a concept — a standalone unit of meaning.

    That’s a big shift.

    Why does this matter?

    LLMs operate at the token level, making them great at text generation but limited in their ability to reason hierarchically. They tend to get lost in long-form content, struggle with consistency, and often fail to keep track of structured ideas.

    LCMs take a different approach. They generate text in sentence embeddings, operating in a high-dimensional space (like SONAR) instead of token sequences. Instead of focusing on words, they predict thoughts in a way that’s language- and modality-agnostic.

    This has big implications:

    • Better context understanding — By modeling entire sentences as units, LCMs improve coherence and logical flow.
    • Multilingual and multimodal — Trained on 200+ languages, LCMs can generalize across text and speech without additional fine-tuning.
    • More efficient generation — Since they work at a higher level, they process fewer steps, making them faster and more scalable than token-based models.
    • Stronger zero-shot performance — LCMs outperform LLMs of the same size in summarization and text expansion tasks, even in languages they weren’t explicitly trained on.

    The technical shift

    LLMs generate text autoregressively, predicting one token at a time. This requires them to process long token sequences and maintain coherence through implicit context modeling.

    LCMs, on the other hand, predict the next sentence embedding in a latent space.

    Instead of raw tokens, they work with sentence representations from SONAR, a multilingual embedding model.

    SONAR is trained to encode and decode sentences across 200+ languages into and out of a single shared representation space. When an LCM needs to handle a new language or modality, only the SONAR encoder/decoder must be updated — leaving the central model untouched.

    The embeddings are processed autoregressively using diffusion models, MSE regression, or quantized representations — allowing LCMs to generalize across languages and modalities without needing explicit tokenization.

    This shift reduces computational complexity, makes it easier to edit long-form text, and allows AI to reason at a higher level of abstraction.

    The results

    When tested on summarization and summary expansion, LCMs outperformed traditional LLMs of the same size.

    They showed strong generalization across multiple languages — without additional fine-tuning.

    They handled long-form text more coherently than token-based models.

    And because they work in a modular embedding space, they can be extended to new languages, speech, or even sign language, without retraining the entire model.

    Challenges

    Sentence splitting

    LCMs rely on robust sentence segmentation. Very long or tricky “sentences” can hurt performance.

    Out-of-distribution embeddings

    With MSE or diffusion, the model could predict vectors that don’t perfectly map back to valid text. Diffusion or well-tuned quantization helps mitigate this.

    Averaging vs. sampling

    A purely MSE-based approach might average all potential continuations into a single “blurry” embedding. Diffusion or discrete codebooks allow multiple plausible completions.

    The Future of Language Modeling?

    LLMs work. But they are word-by-word prediction machines.

    LCMs take a different path — one that focuses on thoughts, not just tokens.

    By modeling language at the concept level, they bring AI closer to how humans structure ideas.

    This isn’t just an optimization. It’s a fundamental shift in how AI understands and generates language.

    And it might just change how we build the next generation of intelligent systems.

    Link to the original paper: https://arxiv.org/abs/2412.08821


    Feel free to reach out to me if you would like to discuss further, it would be a pleasure (honestly):

  • How to Build a Chatbot with Python

    How to Build a Chatbot with Python


    A no-BS guide for complete beginners

    Chatbots are becoming more powerful and accessible than ever. In this tutorial, you’ll learn how to build a simple chatbot using Streamlit and OpenAI’s API in just a few minutes.

    Prerequisites

    Before we start coding, make sure you have the following:

    • Python installed on your computer
    • A code editor (I recommend Cursor, but you can use VS Code, PyCharm, etc.)
    • An OpenAI API key (we’ll generate one shortly)
    • A GitHub account (for deployment)

    Step 1: Setting Up the Project

    We’ll use Poetry for dependency management. It simplifies package installation and versioning.

    Initialize the Project

    Open your terminal and run:

    # Initialize a new Poetry project
    poetry init
    
    # Create a virtual environment and activate it
    poetry shell

    Install Dependencies

    Next, install the required packages:

    poetry add streamlit openai

    Set Up OpenAI API Key

    Go to OpenAI and get your API key. Then, create a .streamlit/secrets.toml file and add:

    OPENAI_API_KEY="your-openai-api-key"
    

    Make sure to never expose this key in public repositories!

    Step 2: Creating the Chat Interface

    Now, let’s build our chatbot’s UI. Create a new folder: streamlit-chatbot, and add a file to it, called app.py with the following code:

    import streamlit as st
    from openai import OpenAI
    
    # Access the API key from Streamlit secrets
    api_key = st.secrets["OPENAI_API_KEY"]
    client = OpenAI(api_key=api_key)
    st.title("Simple Chatbot")
    
    # Initialize chat history
    if "messages" not in st.session_state:
        st.session_state.messages = []
    
    # Display previous chat messages
    for message in st.session_state.messages:
        with st.chat_message(message["role"]):
            st.markdown(message["content"])
    
    # Chat input
    if prompt := st.chat_input("What's on your mind?"):
        st.session_state.messages.append(
           {"role": "user", "content": prompt}
        )
        with st.chat_message("user"):
            st.markdown(prompt)
    

    This creates a simple UI where:

    • The chatbot maintains a conversation history.
    • Users can type their messages into an input field.
    • Messages are displayed dynamically.

    Step 3: Integrating OpenAI API

    Now, let’s add the AI response logic:

    # Get assistant response
        with st.chat_message("assistant"):
            response = client.chat.completions.create(
                model="gpt-3.5-turbo",
                messages=[
                  {"role": m["role"],
                   "content": m["content"]} for m in st.session_state.messages
                ])
            assistant_response = response.choices[0].message.content
            st.markdown(assistant_response)
    
        # Add assistant response to chat history
        st.session_state.messages.append({"role": "assistant", "content": assistant_response})
    

    This code:

    • Sends the conversation history to OpenAI’s GPT-3.5-Turbo model.
    • Retrieves and displays the assistant’s response.
    • Saves the response in the chat history.

    Step 4: Deploying the Chatbot

    Let’s make our chatbot accessible online by deploying it to Streamlit Cloud.

    Initialize Git and Push to GitHub

    Run these commands in your project folder:

    git init
    git add .
    git commit -m "Initial commit"

    Create a new repository on GitHub and do not initialize it with a README. Then, push your code:

    git remote add origin <https://github.com/your-username/your-repo.git>
    
    git push -u origin master

    Deploy on Streamlit Cloud

    1. Go to Streamlit Cloud.
    2. Click New app, connect your GitHub repository, and select app.py.
    3. In Advanced settings, add your OpenAI API key in Secrets.
    4. Click Deploy and your chatbot will be live! 🚀

    Conclusion

    Congratulations, you’ve built and deployed a chatbot using Streamlit and OpenAI. This is just the beginning — here are some ideas to improve it:

    • Add error handling for API failures.
    • Use different GPT models for varied responses.
    • Allow users to clear chat history.
    • Integrate RAG into it

    I hope you enjoyed this tutorial! If you found it helpful, feel free to share it.

    The full code is available here.


    Feel free to reach out to me if you would like to discuss further, it would be a pleasure (honestly):

    LinkedIn

  • How Google Used Causal ML to Optimize Gmail Search (Without A/B Testing)

    How Google Used Causal ML to Optimize Gmail Search (Without A/B Testing)

    Machine learning models typically predict outcomes based on what they’ve seen — but what about what they haven’t?

    Google tackled this issue by integrating causal reasoning into its ML training, optimizing when to show Google Drive results in Gmail search.

    The result?

    A 9.15% increase in click-through rates without costly A/B tests.

    Let’s break it down.

    The problem: biased observational data

    Traditional ML models train on historical user behavior, assuming that past actions predict future outcomes.

    But this approach is inherently biased because it only accounts for what actually happened — not what could have happened under different conditions.

    Example: Gmail sometimes displays Google Drive results in search. If a user clicks, does that mean they needed the result? If they don’t click, would they have clicked if Drive results were presented differently?

    Standard ML models can’t answer these counterfactual questions.

    Google’s approach: Causal ML in action

    Instead of treating all users the same, Google’s model categorized them into four response types based on their likelihood to click:

    1. Compliers — Click only if Drive results are shown.
    2. Always-Takers — Click regardless of whether results are shown.
    3. Never-Takers — Never click Drive results.
    4. Defiers — Click only if Drive results are not shown (a rare edge case).

    The challenge? You can’t directly observe these categories — a user only experiences one version of reality.

    Google solved this by estimating counterfactual probabilities, essentially asking: How likely is a user to click if the result were shown, given that it wasn’t?

    The key insight: optimizing for the right users

    Instead of optimizing blindly for clicks, the model focused on:

    • Prioritizing Compliers (since they benefit the most from Drive results).
    • Accounting for Always-Takers (who don’t need Drive suggestions to click).
    • Avoiding Never-Takers (who won’t click regardless).

    This logic was embedded into the training objective function, ensuring that the model learned from causal relationships rather than just surface-level patterns.

    The Results: Smarter Personalization Without Experiments

    By integrating causal logic into ML training, Google achieved:

    • +9.15% increase in click-through rate (CTR)
    • Only +1.4% increase in resource usage (not statistically significant)
    • No need for costly A/B testing

    This proves that causal modeling can reduce bias in implicit feedback, making machine learning models more adaptive, efficient, and user-friendly — all without disrupting the user experience.

    Why This Matters

    Most companies rely on A/B testing to optimize product features, but sometimes that approach can be expensive, or just not possible at all.

    Causal ML offers a way to refine decisions without running thousands of real-world experiments.

    Google’s work shows that the future of ML isn’t just about better predictions — it’s about understanding why users behave the way they do and making decisions accordingly.

    Source

    Training Machine Learning Models With Causal Logic

  • Read Smarter in 2025

    Read Smarter in 2025

    My top 10 book picks from 2024, to help you build your 2025 reading list

    This year, for some reason, I found myself reading a lot more than usual — 52 books in total — without even pushing myself.

    I think it happened naturally because I bought many books that genuinely interested me (I also tackled some really short ones, to be fair).

    Here are some of the best books I read this year to help you build your reading list for 2025.

    But before we dive in, you might be wondering why bother with this. Why create a reading list or read books at all? Well, reading is one of the best things you can do for yourself. There’s so much knowledge out there from experts in various fields — Nobel laureates, Harvard PhDs, and more. Books are affordable, and most of them are really enjoyable to read.

    And why books? Why not just read blog posts?

    A good book is like a painting: the author invests a lot of time, does extensive research, and works tirelessly to distill their ideas into the pages. That effort really shows.

    Good books have layers and depth. Re-reading them reveals new insights each time.

    This applies to both fiction and non-fiction. These days, self-development books are selling really well, partly because their titles are so straightforward: “How to Win Friends and Influence People,” “How to Talk to Anyone,” “Think and Grow Rich”.

    There’s nothing wrong with that, but remember that many of those lessons can also be found in fiction, presented in a more friendly and subtle way.

    Plus, reading doesn’t have to be just for learning — it can also be purely for fun!

    Personally, I like to mix things up. This year, I read a lot of fiction, economics, and data science books.

    Now, onto the list.

    Less Technical Stuff

    Build

    Tony Fadell’s memoir and practical guide for entrepreneurs offers insights from his experiences designing iconic products like the iPod and Nest.

    It’s a rare book written by someone who has actually built things. It covers everything from HR to marketing to legal issues and walks you through the different stages of building a business — from working on a product with a small team to managing an organization of over 400 people.

    The Capitalist Manifesto

    This book argues in favor of capitalism as the ultimate system for freedom, innovation, and wealth creation.

    Contrary to popular belief, global free-market capitalism has been the main driver of prosperity, reduced inequality, and fostered innovation over the past few centuries.

    While some of the author’s claims come across as naive and heavily biased toward capitalism (for example, suggesting capitalism has a net positive impact on the environment), most arguments are solid and backed by strong data. Absolutely worth reading.

    The Chronicles of Narnia

    A classic fantasy series by C.S. Lewis about children discovering a magical world full of adventure, talking animals, and profound moral lessons.

    The seven books are an allegory of biblical stories, spanning from the creation of Narnia to its end. Remember Aslan, the talking lion from the movies? He symbolizes God, which is made very clear in the books, as he serves as a benevolent and just king/father figure.

    Though I’m not religious, I found it fascinating to see the lessons built into the narrative. Regardless of your beliefs, many of these lessons are universal, and reading these books with your children can be a great way to pass those values on.

    Educated

    Tara Westover’s memoir chronicles her journey from an isolated, fundamentalist upbringing to pursuing education and self-discovery. I couldn’t put it down.

    Tara’s parents were extreme conspiracy theorists who refused to send their kids to school or take them to the hospital, believing these institutions were part of a larger scheme to control people. While their worldview might seem absurd at first, it’s heartbreaking to see its impact on their children.

    Despite this, Tara managed to escape that environment and eventually earned a doctorate from the University of Cambridge. Safe to say, she turned out okay.

    The Power of Creative Destruction

    This book explores how innovation drives economic growth and progress by disrupting and replacing outdated systems.

    For me, the main takeaway is that demonizing either free-market competition or state intervention doesn’t make sense. Both are necessary, and the book does a great job explaining when government intervention is helpful and when it can cause more harm than good.

    Factfulness

    This book illustrates global progress by plotting GDP per capita against life expectancy and categorizing countries into four development levels along this axis.

    Interestingly, most countries fall in the middle, with only a few being extremely poor or very rich. Almost all countries, however, are moving in the right direction.

    It’s remarkable how life has improved globally over the past 100 years. What’s even more surprising is how wrong people often are about the current state of the world. The author surveyed people worldwide, asking specific questions about statistics like vaccination rates, and the results showed widespread pessimism.

    This negativity is partly due to the media’s tendency to focus on bad news. While the world isn’t perfect, things are steadily improving, and this book is a great reminder of that.

    More Technical Stuff

    Fundamentals of Software Architecture

    Especially with the rise of generative AI, we’re often asked to build tools that don’t require much data science — just smartly calling APIs and wrapping them in a Streamlit interface.

    This calls for a better understanding of software architecture.

    All data scientists can benefit from learning software architecture principles. We tend to focus heavily on coding without understanding how our work fits into larger systems. This book offers a comprehensive guide to designing better systems.

    Clean Code

    A practical guide to writing clean, maintainable, and efficient code, this is a classic in the field.

    It’s particularly useful for data scientists like me, who learned coding through Jupyter notebooks and picked up some bad habits along the way. Trust me, clean code matters — it improves readability and reduces bugs.

    While it’s a great book, much of it could be distilled into a list of dos and don’ts (which I might create in a future story). However, keep in mind it’s very Java-specific.

    System Design Interview

    This preparation guide for system design interviews explains frameworks and best practices in a clear, concise way, making it easy to understand.

    It’s a great starting point for learning system design concepts, regardless of whether you actually have an interview coming or not.

    Causal Inference in Python

    This hands-on guide shows how to apply causal inference methods using Python for real-world data science problems.

    It borrows heavily from econometrics, so it’s an excellent resource if you come from that background. If your prior exposure to causality has been through machine-learning-focused sources, this book provides a refreshing new perspective.

  • More Than Words: How AI Agents Are Changing Automation

    More Than Words: How AI Agents Are Changing Automation

    Memory, reasoning, and the future of intelligent systems

    AI is shifting from passive assistants to active problem solvers. Instead of just generating text based on a prompt, AI agents retrieve live information, use external tools, and execute actions.

    Think of the difference between a search engine and a research assistant. One provides a list of links. The other finds, summarizes, and cross-checks relevant sources before presenting a well-formed answer. That’s what AI agents do.

    Let’s break down how they work, why they matter, and how you can build one yourself.

    Why AI Agents?

    Traditional GenAI applications can generate convincing answers but lack:

    • Tools: They can’t fetch real-time data or perform actions.
    • Reasoning structure: They sometimes jump to conclusions without checking their work.

    AI agents solve these issues by integrating tool usage, and structured reasoning.

    Take a financial analyst, for example. Instead of manually searching for Apple’s stock performance, reading reports, and comparing it to recent IPOs, she could use an agent to:

    1. Retrieve live stock data from an API.

    2. Pull market news from a financial database.

    3. Run calculations on trends and generate a summary.

    No wasted clicks. No sifting through search results. Just a concise, actionable report.

    How AI Agents Work

    AI agents combine three essential components:

    1. The model (Language understanding & reasoning)

    This is the core AI system, typically based on an LLM like GPT-4, Gemini, or Llama. It handles natural language understanding, reasoning, and decision-making.

    2. Tools (external data & action execution)

    Unlike standalone models, agents don’t rely solely on their training data.

    They use APIs, databases, and function calls to retrieve real-time information or perform actions.

    Common tools include:

    • Search engines for fetching up-to-date information.
    • Financial APIs for stock prices, economic reports, or currency exchange rates.
    • Weather APIs for real-time forecasts.
    • Company databases for business insights.

    3. The Orchestration Layer (Planning & Execution)

    This is what makes an agent more than just a chatbot. The orchestration layer manages:

    • Memory: Keeping track of previous interactions.
    • Decision-making: Deciding when to retrieve information vs. generating a response.
    • Multi-step execution: Breaking down complex tasks into logical steps.

    It ensures that the agent follows structured reasoning instead of blindly generating an answer.

    Thinking Before Acting: The ReAct Approach

    One of the biggest improvements in AI agent design is ReAct (Reason + Act). Instead of immediately answering a question, the agent first:

    1. Thinks through the problem, breaking it into smaller steps.

    2. Calls a tool (if needed) to gather relevant information.

    3. Refines its answer based on the retrieved data.

    Without this structure, models can confidently hallucinate — generating incorrect information with complete certainty.

    ReAct reduces that risk by enforcing a step-by-step thought process.

    Example

    Without ReAct:

    Q: What’s the tallest building in Paris?

    A: The Eiffel Tower.

    (Sounds reasonable, but wrong. The Montparnasse Tower is taller if you exclude antennas.)

    With ReAct:

    Q: What’s the tallest building in Paris?

    Agent:

    1. “First, let me check the list of tall buildings in Paris.” (Calls search tool)

    2. “The tallest building is Tour Montparnasse at 210 meters.” (Provides correct answer)

    This approach ensures accuracy by retrieving data when necessary rather than relying on training data alone.

    AI Agents in Action: Real-World Examples

    Let’s explore some concrete applications with the smolagents framework, by HuggingFace.

    from smolagents import CodeAgent, DuckDuckGoSearchTool, HfApiModel
    
    model = HfApiModel()
    agent = CodeAgent(tools=[DuckDuckGoSearchTool()], model=model)
    
    query = "Compare Apple's stock performance this week to major tech IPOs."
    response = agent.run(query)
    print(response)
    

    What happens here?

    1. The agent searches for stock performance data using DuckDuckGo’s API.

    2. It retrieves relevant comparisons between Apple and newly public companies.

    3. If needed, it could summarize key financial trends.

    Instead of giving a vague answer like “Apple’s stock is up”, the agent provides a structured comparison, making it more useful.

    This example uses an existing search tool, but the smolagents framework allows you to build your own: it could be calling an API or writing in a database, sending an email.

    Any Python function, really.

    The Future of AI Agents

    AI agents are shifting how we interact with AI.

    Instead of just responding to prompts, they make decisions based on logic, and call external tools.

    Where Are We Headed?

    1. Multi-Agent Systems — Teams of specialized AI agents working together.

    2. Self-Improving Agents — Agents that refine their own strategies based on past interactions.

    3. Embedded AI — Assistants woven into workflows that anticipate problems before they arise.

    AI isn’t just answering questions anymore — it’s solving problems.

    Final Thoughts

    The difference between an AI model and an AI agent is the difference between knowing and doing.

    A model like ChatGPT is an information engine. It predicts words based on patterns.

    An agent is an action engine. It retrieves data, runs calculations, and executes tasks.

    This shift — from static responses to dynamic, tool-enabled intelligence — is where AI is headed.

    The real challenge now isn’t just improving models, but designing intelligent, adaptive systems that can reason, act, and learn over time.

    AI agents will augment human decision-making, making us faster, more informed, and better equipped to navigate an increasingly complex world.

    And that’s a future worth paying attention to.

    Sources

  • AI Is Not Taking Our Jobs

    A quantitative exploration of the relationship between technology, labor and wealth

    I see many people say AI will take our jobs any time now, based on the following narrative: the better AI becomes, the less companies will need us, therefore we will be replaced.

    It’s an interesting chain of thought, but does it have the empirical basis to back it up? In other words, does reality match the story? Well, it doesn’t seem so.

    It’s common to engage in this sort of discussion with well-thought arguments, based purely on conjectures, without looking at the existing body of scientific work nor at the data. I propose we take a tour of those two dimensions, to see if we can learn a thing or two from the empirical evidence.

    Before we start, there is one link we need to establish: technology increases productivity. Here, we are talking from an economics perspective. Don’t think “when I have my cellphone I can’t work as much”. Here we are looking more at “the more technology in the world, the more we can produce with the same amount of work”.

    This phenomenon is explained by the ability of technology to automate tasks, streamline processes, and facilitate the creation of new products and services. The intrinsic connection between technology and productivity is fundamental to understanding everything else you will read here.

    With that out of the way, let’s see what science and data have to say about the impact of AI on our jobs.

    Scientific work

    Will AI take our jobs? This question can be seen as a specific case of the broader, more strucured question “does technology increase unemployment?”.

    Unsurprisingly, this question has been asked by researchers many times before: a meta-analysis from 2022 that looked at 127 studies concluded that there is more evidence suggesting that technology creates net jobs than the other way around [1]. Their analysis specifically focuses on industrialized economies, to capture technological change at the frontier. They have also explored how this effect can be different depending on how we look at technology, but we will talk more about this later.

    Some of the fear of AI comes from the narrative that, since AI makes us more productive, companies will need less of us to do the same job and, therefore, they will hire less of us. So, another study, from the European Central Bank [2], looked at the more general question “does productivity growth threaten employment?”. It turns out the answer is no. Even though some industries with higher productivity have seen fewer jobs, overall, the growth in productivity hasn’t really harmed employment. The study shows that one industry becoming more productive doesn’t automatically mean it will hire more people. However, it suggests that the positive impacts of productivity in one area can still create more jobs in other parts of the economy, offsetting any job losses in sectors with productivity gains. So, in the big picture, productivity growth has actually led to more jobs across various sectors. This study also concluded that current technology advances might bring a positive contribution to net jobs:

    […] the source of productivity growth matters for its aggregate employment consequences. Given that service sector productivity growth appears to have relatively strong employment spillovers, our findings suggest that the productivity growth spurred by the spread of (ultimately) general-purpose technologies such as robotics from heavy industry and into services may prove a boon for employment growth.

    Anothery interesting study, from the OECD [3], spanning 13 countries over two decades, investigates the relationship between productivity, employment, and wages. It found a positive correlation between productivity growth and increased employment and wages, both at the firm and aggregate levels:

    At the more aggregate level, the role of reallocation and links across industries becomes more evident. Yet also here, results confirm that productivity growth is, overall, associated with positive changes in employment and wages. Increasing employment among expanding firms tends to outweigh decreasing employment in shrinking or exiting firms. Furthermore, productivity gains at the industry level contribute to stronger employment growth in downstream industries through value chains.

    Looking at AI more specifically, a panel study from 2023 shows evidence that it decreases the level of unemployment, at least in high-tech developed countries [4]. The study investigated how AI affects unemployment in 24 high-tech developed countries from 2005 to 2021, using Google Trend Index data related to AI and unemployment rates.

    Data

    Now, for some extra context, let’s take the time to explore some of the data ourselves, to answer some broeader questions. If technology is evolving (and I don’t think anyone questions that), and this is not decreasing the number of jobs available, then what is it doing for us?

    We are not necessarily “less employed”

    To contribute to the body of evidence that we are not being replaced by technology, let us look at the employment rates in the world since 1950:

    Image by author

    I put China and India separately because their data was not available for every year and, given their populations, this had a big impact on the variability of the indicator, specially since the 1990s.

    We can see that, despite the impressive technological advances over the last 70 years, employment rates do not seem to be a bigger issue now than they were back then.

    We are working less

    We are, on the other hand, working much less than our ancestors:

    Image by author

    This global trend, however, is not the same everywhere:

    Image by author

    Richer countries are reducing their working hours at higher rate than the rest. I cherry-picked some specific countries that are representative of different trends:

    • Germany is an example of a rich country where people worked much more than the rest of the world, and has drastically decreased since then;
    • The US has become substantially richer since the 1950’s, yet its work load have not decreased significantly;
    • China and India seem to be going in the opposite direction of the rest of the world, working longer hours.

    We are richer than ever

    I hope this does not come as a surprise, but we have never been richer:

    Image by author

    So, even though the world is working less, pretty much every country got richer.

    Of course, the distribution of that wealth was not the same across the globe. Pretty much every country got richer, but some got richer than others (again, no surprise):

    Image by author

    But how can we work less and make more money? What allowed that to happen? Well, we happen to have become more productive over time thanks, in part, to technology.

    We are more productive

    Technology, education and solid institutions contribute to productivity, and we can see the results over the years:

    Image by author

    Unfortunately, I couldn’t find data older from before the 2000s but, given the decrease in number of hours worked and the increase in GDP per capita, we can see the trend is there and is pretty much strong.

    This constant productivity increase over the time is what allows us to work less and make more money.

    Things will still change

    So, everything will stay the same? Well, no. Of course AI will have an impact in the job market. But the change might be more related to jobs migrating from one industry to another, and from one region to another.

    The European Central Bank study [2] suggests that increases in productivity move jobs in two main ways:

    1. less manufacturing jobs, more services jobs
    2. less low-skill jobs, more high-skill jobs

    More specifically, we expect more jobs in health, education, and services, and less jobs in utilities, mining, and construction.

    Also, in the meta-analysis we saw earlier [1], they identify five key categories of technology measures in the literature, with different impacts on job markets:

    1. Information and communication technology: more high-skillnon-routine, and service jobs;
    2. Robots: the negative impact on employment is generally offset by new jobs related to their production, operation, and maintenance;
    3. Innovation: product innovation seems to create jobs, but the evidence for process innovation remains mixed;
    4. Productivity: job gains were mostly favorable for non-productionhigh-skill, and service jobs. Nonetheless, the net employment effects observed in these studies are rather negative than positive;
    5. Other: other/indirect measures of technology indicate net job creation effects, particularly for non-production labour, but also for lowly skilled workers, particularly in service jobs.

    So we could expect either:

    1. relocation of jobs from manufacturing countries towards service-intensive countries;
    2. a change in the sectorial structure within countries, with an increase of service jobs when compared to manufacturing;
    3. a mix of both.

    I imagine these changes could increase inequality due to:

    1. the migration towards high-skill jobs, particularly if education doesn’t keep up;
    2. more money going to capital owners: there is already evidence [2] that the share of labor on national income is decreasing.

    We could be wrong, but how?

    Of course this whole analysis could be wrong. Let’s try and gather some evidence that goes in the opposite direction, or at least understand in what ways the evidence we saw before could be inadequate.

    There are some theoretical attempts to model the Marxist thesis of “labor immiseration”, looking at different axes:

    1. Inter-generational market failure: quick advancements in technology benefit skilled workers and those who own capital in the short term. However, over time, it leads to hardships for people who cannot invest in physical or human capital;
    2. Task encroachment: two opposing economic forces shape how much income goes to labor: technology advancement which replaces ‘old’ tasks, decreasing labor’s share of output, potentially lowering real wages; and internal technological progress that creates new tasks requiring labor. The interaction of these forces may result in a unbalanced growth path;
    3. New tasks might not be created “fast enough”: the number of automated tasks could grow at a higher rate than the new tasks created by automation, leading to a reduction in the number of tasks that can be performed by humans;

    These models are theoretical, though: they are not evidence that the net job losses will happen, they just outline scenarios where it could.

    There is some evidence showing that this time could be different, and that this relationship between productivity and unemployment might be shifting: recent decades have witnessed more negative own-sector effects of productivity growth, especially in manufacturing, and less positive external effects on other-sector employment, possibly due to increased trade openness. However, this pattern has been seen before, in the 1980s, and it’s not new [2].

    Another study, by the National Bureau of Economic Research [5], looks at the impact of increased industrial robot usage in the United States from 1990 to 2007 on local labor markets. The researchers find that the rise in robot usage leads to a significant negative effect on employment and wages across commuting zones. They support their findings by showing that areas most exposed to robots post-1990 did not display different trends before that period. The impact of robots is distinct from other factors like imports from China, decline of routine jobs, offshoring, and various types of IT capital. The conclusion suggests that for every additional robot per thousand workers, the employment to population ratio decreases by about 0.18–0.34 percentage points, and wages decrease by 0.25–0.5 percent. The study focuses specifically on industrial robots in certain local labor markets, which can’t account for the spillover effects on other regions or markets.

    Maybe this time it’s different, and AI is such a disruptive technology that it will behave in a different way. Maybe, its relationship with productivity is different than other technologies.

    Maybe. But the empirical evidence suggests otherwise, so I wouldn’t bet on it.

    References

    1. Somers, M., Theodorakopoulos, A., & Hötte, K. (2022). “The fear of technology-driven unemployment and its empirical base.”
    2. Autor, D., & Salomons, A. (2017, June 19). “Does Productivity Growth Threaten Employment?”
    3. Calligaris, S., Calvino, F., Reinhard, M., & Verlhac, R. (OECD). (2023). “Is there a trade-off between productivity and employment? A cross-country micro-to-macro study.” OECD Science, Technology and Industry Policy Papers, №157.
    4. Guliyev, H. (2023). “Artificial intelligence and unemployment in high-tech developed countries: New insights from dynamic panel data model.” Economic Research Center of Turkish World, Azerbaijan State Economic University.
    5. Acemoglu, Daron and Pascual Restrepo. (2017). “Robots and Jobs: Evidence from U.S. Labor Markets.” NBER Working Paper №23285, March.
  • How to Become an AI Expert in 5 minutes

    How to Become an AI Expert in 5 minutes

    Impress colleagues and dazzle recruiters without actually knowing anything about AI

    Forget years of research, hands-on coding, or grueling math — this guide will teach you everything you need to fake it until you make it in the world of AI.

    1. Say “garbage in, garbage out.” It means nothing, but it sounds cool.
    2. Ask what LLM they’re using. It’s absolutely irrelevant, but it makes you sound like you know what you’re talking about. Bonus points if you tilt your head and say, “Oh, GPT-4? Interesting choice.”
    3. Talk about “the black box problem.” You don’t need to know what it actually means — just sigh heavily and say, “That’s the thing with AI, isn’t it? It’s all a black box.” Everyone will nod solemnly.
    4. Use “fine-tuning” in every other sentence. You don’t need to understand the difference between fine-tuning and prompt engineering. Just say things like, “Well, it’s not performing well because they probably didn’t fine-tune it properly.”
    5. Mention ethical concerns vaguely. Say, “We need to consider ethical issues here too.” But never specify which ethical problems you’re referring to. If pressed, just shake your head and mutter: “Bias, man. It’s everywhere.”
    6. Throw in words like “unstructured data” and “scalability.” For example: “The issue is that most companies can’t handle unstructured data at scale.” People will assume you’re deep into AI architecture, even if you’re just deep into Twitter.
    7. Make wild predictions about AI taking over. Alternate between saying, “AI will replace 80% of jobs in the next five years,” and, “AI is overhyped; it’ll never truly replace humans.” Contradict yourself freely — it’s all part of the mystique.
    8. End every conversation with “We’re still in the early days of AI.” It’s the perfect way to sound both optimistic and profound while giving yourself an exit strategy.

    Congratulations! You are now ready to dazzle coworkers and intimidate LinkedIn connections with your newfound AI “expertise.”

    Just remember: when in doubt, say “It’s all about the data.” No one will argue.

  • Book Summary: Statistics — A Very Short Introduction

    Book Summary: Statistics — A Very Short Introduction

    How can we apply statistical methods to real-world problems?

    Who should read this book?

    You either work with data or want to start to, but come from a tech background or just don’t remember much from Stats 101, and need a refresh on the basics of statistics.

    One-paragraph summary

    It’s a good starting point to understanding statistics: it approaches a broad range of topics, from basic probability to random forests, without going too deep in any of them, so no previous mathematical background is required.

    Full summary

    Introduction

    The author starts by giving a series of possible definitions for statistics, one of them being “the technology of extracting meaning from data”.

    “Statistics is hocupocus with numbers” — Audrey Habera and Richard Runyon

    He then gives a glance of the many different applications that are possible with statistics, from public policy to marketing to spam filtering, and mentions some of the issues that can arise from misusing it. The most notable example is the Sally Clark case: in 1999, a young British lawyer was sentenced for life for killing her two baby children who she claimed had died from cot death. The sentence was based on the testimony of Sir Roy Meadow, the prosecution’s paediatrician, that said that it was nearly impossible that this was the actual cause, since the chances of this happening to two children was of 1 in 73 million. The verdict was then that the mother was guilty. The probability calculated by the doctor was, however, flawed: he did it by multiplying the probability of one cot death two times. This method, however, needs the two events to be independent, which they are not, considering that, given that one of the children died from it might indicate genetic conditions that will also manifest in the second child.

    This, and many other examples, show that statistics has an important role in society: providing evidence. Without it, we cannot subject our opinions to test, and they remain mere speculations.

    Statistics began on the end of the 19th century only as discursive explorations of data. In the first half of the 20th century it evolved and became a more mathematics-oriented field. Only in the second half of the 20th century it faced its latest revolution with the use of computers, which allowed the field to develop its methods and apply heavy-computational algorithms.

    Descriptions

    In statistics, we analyse objects and their attributes usually in the shape of observations and variables. This information can, sometimes, be overwhelming, so we might want to aggregate it by doing simple summary statistics: average, dispersion, skewness and quantiles, for example.

    The concept of average can comprise many formal concepts, but the most used case is the arithmetical mean: the sum of all values, divided by the number of observations. For example, if we wanted to understand the attribute “age” for a given classroom of college students, instead of looking at all the students’ ages, we sum them all, divide by the number of students, and get 22 years. It doesn’t mean all students are 22 years old, but it gives us an overall picture: some are older, some are younger, but we can imagine it is not a classroom full of kids, for example.

    However, let’s take a second example: there’s five people, four of them earn $5,000 a month and one of them earns $100,000 a month. In average, these people make $24,000 a month. However, this does not fully describe their real situation, since it is not a group of people where everyone earns more or less $24,000. From here we can add the concept of dispersion: how far from the average are the values in this group? One measure of dispersion is the variance, calculated by taking the square of the difference between all the numbers and the mean, and then calculating their averages. Wouldn’t it be simpler to just take the mean without the square part? Yes, but then positive and negative values would reduce each other’s effects, cancelling out the whole purpose of measuring dispersion. We can take the square root ofthe variance as another measure, called the standard deviation.

    Ok, so we know the average and whether the dispersion is high or low, but how exactly is the shape of this dispersion? For this, we can look at skewness and quantiles. Skewness measures the lack of symmetry in the population: if it’s very asymmetric, there are many more values higher or lower than the average. Quantiles tell you what value you should take if you want a certain percentage of the population below this value, and there are a few types of quantiles. One of the most common is the percentile: if you are in the 90th percentile of your classroom’s grades, it means you have better grades than 90% of the your classroom.

    Collecting good data

    “Garbage in, garbage out” — Everyone data science article out there

    When collecting data for analysis, it is very important to pay attention to its quality: no matter how sophisticated are your models, if you put bad data in, your outcome will also be poor.

    Pay special attention to missing data: sometimes it’s random but sometimes it can also reveal an underlying pattern. For example, when asking people for their income, people who get really good (or really bad) salaries may prefer not to answer, generating missing data that can actually give you some information. To deal with missing data, you can ignore it, remove those observations/variables or you can try to input it by replacing them by something simple such as the sample mean or by something a lot more complex, using prediction algorithms. It will depend mostly on your data and your goals. When data is incorrect, on the other hand, most of the time there’s not much that can be done a posteriori so avoid making these mistakes when fetching data.

    When it comes to data sources, they can basically be of two types: observational or experimental. The first one comes from real-life observations whereas the latter comes from controlled experiments. Experimental studies are better for isolating variables and causation effects but they are usually harder to do. When conducting experiments, we should plan very well our experiment design: choosing the best groups for measuring the impact of each variable, taking into account the effect of interactions. For example, if we want to test the effect of a new drug, we should have a control group and a test group, sampled randomly from the population, ideally with similar characteristics. If the test group has only men and the control group has only women, we won’t be able to know if the observed results were the effect of the drug or of the subject’s gender.

    For this kind of procedure, we can apply techniques from a statistics domain called survey sampling, which can help us the best methods of sampling individuals within a population.

    Probability

    Another definition of statistics is “the science of handling uncertainty”, which is what the study of probability tries to address. A lot of its utility is based on the Law of Large Numbers, which roughly means that, if when you toss of a coin you have 50% chances of getting heads, then the more you throw the coin, the closer the overall proportion of heads will be to 50%.

    This leads us to the two main approaches when it comes to probability: frequentist and Bayesian. Roughly, frequentists see probabilities as the proportion of times the event would occur if the exact same circumstances were repeated infinitely. The Bayesian approach takes into account the amount of information available: probability is subject to how much we know, and thus it changes as we gather new information.

    Whatever approach you take, you will encounter the idea of independence between events. Basically, two events being independent means that the occurrence of one of them does not affect the probability of the other one occurring. If we throw two coins separately, the fact that we got heads in one does not change the probability of getting heads in the second one.

    To look at dependent events, we often use the Bayes theorem, which is given by the formula below:

    Skymind’s beginner’s guide to the Bayes theorem

    Ok, that’s very useful, but how do we know these probabilities? In basic exercises, usually we have probabilities that are easy to calculate, with things such as coins and dice. But how do we deal with more complicated probabilities? We work with cumulative distribution functions, which give us the probabilities of finding a value smaller (or greater) than another value we set. For example, if we knew the distribution of people’s heights in our town, we could calculate the probability of finding someone shorter (or taller) than 1.80m. From this function, we can derive the probability distribution, that gives us the probability that a value will fall within a certain range (we could know the probability of someone being between 1.70m and 1.80m tall, for example).

    Some distributions are particularly important since they are often found in many real-life phenomena: BernoulliBinomialPoisson and Gaussian, to mention a few. The Gaussian distribution is particularly important because of the Central Limit Theorem that states that, for any given distribution, when we sample the population many times, the means of those samples will follow a Gaussian distribution with the same mean as the original population.

    Gaussian distribution. Source: Wikipedia

    Probability distributions are a huge subject, and there’s a lot of content out there on it. It is out of the scope of the book to go into the details of each of them but it’s an interesting subject to study further.

    Estimation and inference

    Once we have our probability distribution, we want to be able to make estimations from a given sample. For example, let’s say we sample a few students in a school, get their ages and want to estimate the average age in the school. There are mainly two approaches to it: Maximum Likelihood and Least Squares. The first one reasons that our estimation of the average age in the population should be the one that makes the sampled result the most likely. The latter tries to find the estimation that will yield the smaller difference between estimated values and observations. And how do we choose an estimator? Ideally, we want an unbiased estimator, such that it is expected to give us a true result, but also one that doesn’t vary too much depending on the sample we take.

    What if we want to estimate an interval, instead of a single point? It is also possible, due to something called confidence interval. A confidence interval can be calculated from the distribution we have, and will allow us to make a statement more or less like “I’m 95% confident that the average age in this school is between 10 and 12”, which can be quite useful for decision-making.

    Another important statistical method is called hypothesis testing, which is used to test if your parameter takes a specific value or lies within a specific range. Let’s say we want to know if men and women earn the same. We sample a group of men and a group of women, calculate their average wages and find out that men earn in average $35,000 a year and women make $33,000. Ok, can we really say that those populations are essentially different? What if women earned $34,999, could we also reach the same conclusion? How big should this difference be so that we can say its statistically significant? We set a level of confidence we want to have (say 95%) and test our hypothesis. There are many ways of doing it, depending on what we are testing and on the population distribution but, if we do it right, our test will indicate us if our hypothesis holds or not.

    Statistical models

    A statistical model is some simple representation or description of the system we are studying. Since it is a simplification, we’ll necessarily lose information in this process, so we try not to lose the most important bits.

    “All models are wrong, some models are useful” — George Box

    Models can be mechanistic, based in a solid underlying theory (such as gravity) that allows us to predict some behaviour (an object falling, for example) or empirical, more common in the social sciences, where we try to infer the theory from observed data.

    They can also be exploratory, where we try to find relationships and patterns (ex.: looking at demographic data to see if there are characteristics that are correlated) or confirmation models, where we test our conjectures to see if they are supported by data.

    Finally, they can be split into descriptive models, where we try to characterise our data, calculating means, standard deviations, etc., or predictive models, were we try to infer some variable’s behaviour based on the other variables.

    Predictive models are quite useful and they can be very simple or very complicated, usually depending on the number of explanatory variables we use. However, more complicated models do not always yield better predictions. Sometimes, adding more information makes models so specific for our sample that they do not generalise well for the whole population. This phenomenon is called overfitting.

    Statistical models are often based on the idea of correlation: when two variables are correlated, it means that observing a value for one of them gives us a hint on the value of the other. For example, height and weight: tall people tend to be heavier and heavy people tend to be taller. Obviously, tall people can be light and heavy people can be short, but there’s still an overall trend. Correlation can also be negative, for example temperature and hot chocolate sales: the higher the temperature, the less people buy hot chocolate. Correlation is usually represented by a correlation coefficient that goes from -1 (perfect negative correlation) to 0 (no correlation at all) to 1 (perfect positive correlation). It is very important to keep in mind that correlation does not mean causation. For example, ice cream sales and deaths by drowning are correlated, but one does not cause the other, it’s just that in warmer days people buy more ice cream and swim more, so usually when ice cream sales go up it’s because it’s a warm day, meaning more people will swim (and drown).

    In the end, the author briefly goes through some important statistical methods that are worth checking in more detail:

    Regression analysis: it allows us to say “someone who weights 83kg is expected to be 1.83m tall”, based on a sample, even if we haven’t sampled anyone who’s 83kg. The most basic type of regression is linear regression, which supposes a linear relationship between two variables, as per the example below:

    Trying to predict muscle strength based on lean body mass. Taken from http://www.jerrydallal.com

    In the plot above, we can see our sample data (the dots) and the estimated regression line that will allow us to make estimations.

    Analysis of variance (ANOVA): it allows us to compare means from many different populations and test if they are significantly different or not.

    Clustering: used for finding groups of observations that are very similar. We just set the number of groups we want in the end and the algorithm gives us the best partitions.

    Linear Discriminant Analysis (LDA): technique for finding the best linear combination of features in order to characterise different observations. Roughly, it helps us find attributes that are good at differentiating observations.

    K-nearest neighbours (KNN): method used to estimate an attribute of a specific observation, based on the K observations that are the most similar to it.

    Decision tree: it is a very intuitive model used to estimate a certain characteristic (numeric or not) for a given variable, based on decision rules:

    Simple decision tree taken from this article: https://bit.ly/2vwM2fp

    Time series: there is a whole domain in statistics dedicated to studying how certain variables fluctuate on time, based on concepts like trend and seasonality.

    Factor analysis: in summary, it tries to find factors that are responsible for the shared variance between the observed variables.

    Cross-validation: to avoid overfitting, we should not test our models on the same data they were trained on. There are many different methods that allow us to do that, such as splitting our sample data into two groups, one for training and one for testing.

    Bootstrapping: it’s a good technique for getting better models, by sampling observations and replacing them within the actual sample.

    Survival analysis: for example, imagine studying impacts of a disease in people’s lifetimes. After 20 years of study, some people have died, some haven’t. How do you deal with those who didn’t die, since you do not know their total lifetime yet? If you remove them from the study, you remove everyone who survived, and you will estimate a lifetime shorter than it actually is. Survival analysis deals with this sort of specificity.

    Statistical computing

    With the advent of computers, most of the calculations needed for statistical analysis can be done within seconds with softwares such as R, which really helped this field to grow, and made statistician’s work a lot easier and more productive. On the other hand, it made it easier to apply methods without mastering how they actually work, leading sometimes to wrong results.

    Conclusion

    The book really covers a broad range of subjects, so of course it is not possible to go too deep in any of them. However, it’s a very good introductory book, specially for those who come from a non-mathematical background. It is important, though, to pick some subjects that seem more relevant to you and study them in more depth. I’ll give it 7/10.

  • Book Summary: Agile Data Science 2.0

    Book Summary: Agile Data Science 2.0

    Building full-stack data analytics applications with Spark

    Who should read this book?

    You are already a Python experienced user, with some knowledge in Spark, and you want to fill your knowledge gaps while building a full data science application from scratch with a front-end interface.

    One-paragraph summary

    The book is a step-by-step guide on how to build an application for analytics, including downloadable scripts. It will give you an initial overview of the Agile method, and how to apply it to data science, but 80–90% of the book will be hands-on tutorials. In the end, you should have built an HTML page that estimates delays for a given flight, gathering data from different sources.

    Full summary

    This book is basically a big tutorial, and since there is no point summarising a tutorial, the summary will focus only on the more general parts that talk about agile and data science.

    “Agile Data Science is an approach to data science around web application development” — The book

    In addition to what the above quote says, the author starts the book by defining Agile Data Science as “a methodology for analytics products development, mixing the best software development practices, but adapting them to the iterative nature of data science”.

    The Agile Data Science Manifesto

    One of the key steps towards Agile Data Science is constantly shipping intermediate output: no matter if something is still a draft or you are not sure the data is correct, ship it to your internal user for validation. This will avoid wasting time on features people do not need, and will also help you spot issues early on. This also means documenting the whole thinking process and not just the final product.

    That kind of process will also help reducing technical debt, defined as “a concept in programming that reflects the extra work that arises from building code that is easy to implement in the short run, instead of using the best overall solution”.

    Since data science development is a very iterative process, it is impossible to determine deadlines beforehand. Instead, agree beforehand with you stakeholders that you cannot give them a precise final date, but that will you ship constant progress reports. These reports do not have to be actual formal reports, but a front-end interface that shows the current shape of your data, which will also help you get constant feedback.

    People management

    “In Agile, we value generalists over specialists” — Also the book

    In a standard data science project, there can be several roles, one for each step of the process. In Agile, we try to make the team leaner, by getting generalists instead of specialists. In general, this means we want someone to be a business developer, marketer, and product manager at the same time, someone else can be the experience designer, interaction designer, and web developer, then a third person can take over the roles of an engineer, data scientist, and researcher, and finally someone to be both a platform engineer and a DevOps Engineer. This means 4 people doing the job of 11. Although there are less people involved, there is a lot of synergy between these functions, so we compensate in productivity.

    For this setup to work, it is better to use third-party high-level tools and platforms, instead of developing everything in-house. It will save you a lot of overhead time, so you can focus on what really matters.

    If you manage a data science team, focus more on overseeing all the experiments that are happening simultaneously throughout the team, than in handing tasks for each one.

    Finally, make sure your developers share their code with each other for peer-review, or code together. This will help finding errors and making code more readable for future users.

    Agile tools

    The typical data flow comprises at least 5 different types of tools, used in a sequential order.

    Collectors: the tools used to collect and log events (events are the occurrences we want to measure, such as clicks and purchases). Ex.: Kafka

    Bulk storage: filesystem capable of parallel access by many concurrent proceses. Ex.: Amazon S3 and Hadoop (companies are more and more using Amazon S3 instead of Hadoop).

    Distributed document stores: multi-node stores using a document format. Ex.: MongoDB

    Application server: it plumbs JSON files from the distributed document store through to the client, allowing for visualisation. Ex.: Python/FlaskRuby/SinatraNode.js.

    Browser/application: it displays data visualisation and possibly interactive tools. It can be a dedicated app or an ordinary internet browser, to display HTML pages.

    The Data-Value Pyramid

    The Data-Value Pyramid shows all the added-value we can get from data in a shape that highlights the importance of foundations: you cannot optimally get value from your reports, for instance, if you have not yet worked properly on plumbing your records and displaying basic charts. This is valid from a project perspective, but also from a company’s point of view: companies should have solid foundation on how their records are collected, and sound understanding of basic charts before moving on to building reports or trying to implement recommendation systems. This process allows for constant iteration in each step before moving on to the next. The project built in the book is based on these steps, with the author detailing each of them with examples:

    Records

    These are the foundation of your pyramid: make sure you are collecting exactly the events you want and make many tests to check for inconsistencies. Then, display those records in a front-end interface and exchange with your stakeholders. This will help you see if you are working with the right data and avoid wasting time in the future.

    Charts

    Charts are the first and simplest way to have proper visual representation of your data. You probably won’t be able to get your charts right at first, so try different approaches and iterate with the feedback you get. In the end, make sure your chart tells a story.

    Reports

    Reports are a set of charts or tables and other additional information, eventually with interactive features. Make sure you know the kind of information your end users need by exchanging information, and understand how they interact with your report, so you can choose the interactive features. They can be built from the charts you already have.

    Predictions

    “Prediction is very difficult, especially if it’s about the future” — Nils Bohr, Nobel laureate in Physics

    Here is where the value of data starts showing: seeing what happened in the past is good, but being able to predict the future is great. The example used in the book is a model that tries to predict flight delays based on time of departure, airport and even aircraft information. There are essentially two types of prediction models out there: regression and classification. Roughly speaking, regression deals with problems where you will have a quantitative output in the end, such as predicting a house price or someone’s weight, whereas classification deals with categorical outputs: predicting someone’s football team or social class.

    Actions

    Finally, this is the most important part: information is only worth something if you can act on it. The book does not describe this step, but it could have been a good idea to give some examples of direct action originated by data science. Instead, it ends by improving its predictive model. It is very important to know what actions you will take based on your prediction data, ideally before calculating it. This helps you avoid “vanity metrics”: metrics you look at to feel good but don’t help you make any decisions.

    Conclusion

    Since all the code comes with the book, it is very easy to just sit back and follow the script, which won’t help you a lot. Instead, try to not only run the scripts but to understand them and, eventually, change and adapt them for your personal use cases. Without the coding part, there is actually not much content left in the book, so the name can be a bit deceiving: you get this very specific tutorial without much explanation on Agile and/or Data Science. It is a good book to have around in case you need some ideas for a data application setup, but nothing you cannot find online with a bit of effort. I’d give it a 6/10.

    P.S. Make sure you have 16GB of RAM or are willing to pay for a virtual machine in AWS, otherwise you will not be able to follow through.