<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:googleplay="http://www.google.com/schemas/play-podcasts/1.0"><channel><title><![CDATA[Data Science Research Notebook]]></title><description><![CDATA[Sign up with your email to receive the latest notebook notes.]]></description><link>https://en.offcomputer.org</link><image><url>https://substackcdn.com/image/fetch/$s_!cyzD!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7b43673c-0bf2-4200-8ecb-91b5a4ceda7e_408x408.png</url><title>Data Science Research Notebook</title><link>https://en.offcomputer.org</link></image><generator>Substack</generator><lastBuildDate>Wed, 24 Jun 2026 20:19:25 GMT</lastBuildDate><atom:link href="https://en.offcomputer.org/feed" rel="self" type="application/rss+xml"/><copyright><![CDATA[OffComputer]]></copyright><language><![CDATA[en]]></language><webMaster><![CDATA[pablo@offcomputer.com]]></webMaster><itunes:owner><itunes:email><![CDATA[pablo@offcomputer.com]]></itunes:email><itunes:name><![CDATA[OffComputer by Pablo]]></itunes:name></itunes:owner><itunes:author><![CDATA[OffComputer by Pablo]]></itunes:author><googleplay:owner><![CDATA[pablo@offcomputer.com]]></googleplay:owner><googleplay:email><![CDATA[pablo@offcomputer.com]]></googleplay:email><googleplay:author><![CDATA[OffComputer by Pablo]]></googleplay:author><itunes:block><![CDATA[Yes]]></itunes:block><item><title><![CDATA[Literature Review: Causal Inference as an MLOps Concern]]></title><description><![CDATA[Understanding how software systems can move from prediction to reliable decision-making]]></description><link>https://en.offcomputer.org/p/literature-review-causal-inference</link><guid isPermaLink="false">https://en.offcomputer.org/p/literature-review-causal-inference</guid><dc:creator><![CDATA[OffComputer by Pablo]]></dc:creator><pubDate>Sun, 07 Jun 2026 14:34:37 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!kpZI!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77f755e3-7608-410b-8524-cf695a6f94b4_897x678.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-1" href="#footnote-1" target="_self">1</a>This review is based on Ronir Raggio Luiz and Claudio Jos&#233; Struchiner&#8217;s book Causal Inference in Epidemiology: The Potential Outcomes Model, published by Editora Fiocruz in 2002 and available through SciELO Books.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!kpZI!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77f755e3-7608-410b-8524-cf695a6f94b4_897x678.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!kpZI!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77f755e3-7608-410b-8524-cf695a6f94b4_897x678.png 424w, https://substackcdn.com/image/fetch/$s_!kpZI!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77f755e3-7608-410b-8524-cf695a6f94b4_897x678.png 848w, https://substackcdn.com/image/fetch/$s_!kpZI!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77f755e3-7608-410b-8524-cf695a6f94b4_897x678.png 1272w, https://substackcdn.com/image/fetch/$s_!kpZI!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77f755e3-7608-410b-8524-cf695a6f94b4_897x678.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!kpZI!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77f755e3-7608-410b-8524-cf695a6f94b4_897x678.png" width="897" height="678" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/77f755e3-7608-410b-8524-cf695a6f94b4_897x678.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:678,&quot;width&quot;:897,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1064301,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://en.offcomputer.org/i/200942309?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77f755e3-7608-410b-8524-cf695a6f94b4_897x678.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!kpZI!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77f755e3-7608-410b-8524-cf695a6f94b4_897x678.png 424w, https://substackcdn.com/image/fetch/$s_!kpZI!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77f755e3-7608-410b-8524-cf695a6f94b4_897x678.png 848w, https://substackcdn.com/image/fetch/$s_!kpZI!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77f755e3-7608-410b-8524-cf695a6f94b4_897x678.png 1272w, https://substackcdn.com/image/fetch/$s_!kpZI!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77f755e3-7608-410b-8524-cf695a6f94b4_897x678.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Create a black-and-white realistic photograph in a documentary photojournalism style that visually represents the idea of causal inference through a real-world scene. Show a busy urban street intersection with multiple people and events connected in a believable cause-and-effect chain: for example, a pedestrian accidentally drops a stack of papers, wind carries them into the street, a cyclist swerves to avoid them, nearby pedestrians react, and a driver brakes at the crosswalk. The image should feel like a single candid moment captured in the real world, not a staged conceptual illustration. Emphasize realism, natural human behavior, rich textures, high contrast lighting, detailed faces and clothing, and the layered complexity of everyday life where causes and effects interact. Make it evocative, intelligent, and visually suitable as a cover image for the subject of causal inference. No text, no diagrams, no symbols, just a strong black-and-white realistic photographic scene.</figcaption></figure></div><h2>Introduction</h2><p>Causal inference is often introduced as a statistical topic, but it is also highly relevant to software engineering and MLOps. Modern machine learning systems are not only used to predict what is likely to happen; they are increasingly used to decide what action should be taken. Examples include deciding which recommendation to show, which user experience to deploy, which alert to trigger, which customer intervention to apply, or which operational change to make in a production system.</p><p>Traditional machine learning focuses mainly on prediction. It asks questions such as: &#8220;Given the available data, what outcome is most likely?&#8221; Causal inference asks a different question: &#8220;What would happen if we changed something?&#8221; This difference matters because a model can be highly accurate at prediction while still being unreliable for decision-making. A predictive model may learn patterns from historical data, but those patterns do not automatically tell us whether changing one variable will cause a change in another.</p><p>From an MLOps perspective, causal inference can be understood as a discipline for making machine learning systems safer, more interpretable, and more useful for decisions. It provides a framework for thinking about interventions, experiments, observational data, bias, monitoring, and assumptions.</p><h2>From Prediction to Intervention</h2><p>Most machine learning pipelines are designed around prediction tasks. Data is collected, features are engineered, models are trained, and predictions are served. This workflow works well when the goal is to estimate an unknown label or forecast a future event.</p><p>However, many production systems go further than prediction. They trigger actions. For example, a recommendation system does not only predict what a user may like; it changes what the user sees. A pricing model does not only estimate demand; it may change the price shown to customers. A fraud detection model does not only estimate risk; it may block a transaction or request verification.</p><p>This creates a causal problem. Once a system acts on the world, the data it observes later is affected by its own previous decisions. The system becomes part of the data-generating process. In this setting, engineers need to distinguish between correlation and causation. A correlation may be useful for prediction, but it may fail when used to guide interventions.</p><p>A causal approach encourages engineers to define the action being evaluated, the alternative action, the expected outcome, and the assumptions needed to compare them fairly.</p><h2>Counterfactual Thinking in Software Systems</h2><p>A central idea in causal inference is counterfactual reasoning. In simple terms, this means asking what would have happened under a different decision.</p><p>For software engineers, this idea appears naturally in product experimentation and MLOps. Suppose a team deploys a new ranking algorithm and observes that user engagement increases. The causal question is not simply whether engagement increased. The causal question is whether engagement increased because of the new ranking algorithm, compared with what would have happened if the old algorithm had remained in place.</p><p>The challenge is that we cannot observe both realities for the same user at the same time. A user either saw the old ranking or the new ranking. A transaction was either blocked or allowed. A customer either received an intervention or did not. The unobserved alternative is the counterfactual.</p><p>This is the core difficulty of causal inference. Since the alternative outcome is missing, causal conclusions require careful design, assumptions, or both.</p><h2>Randomized Experiments as the Engineering Gold Standard</h2><p>In software systems, randomized experiments are often implemented as A/B tests. They are powerful because they create comparable groups by design. If users are randomly assigned to version A or version B, then differences in outcomes are more plausibly attributed to the product change rather than to pre-existing differences between users.</p><p>From an MLOps perspective, randomized experiments are valuable because they provide a clean assignment mechanism. The system knows why a user received one version rather than another: the assignment was random. This reduces the risk that hidden factors are responsible for the observed difference.</p><p>However, randomized experiments are not always easy or appropriate. They may be expensive, slow, risky, or ethically questionable. Some interventions cannot be randomized in production. Other times, randomization may interfere with user experience, business rules, legal constraints, or platform stability.</p><p>Therefore, while A/B testing is a strong tool, causal inference cannot rely only on randomized experiments. MLOps teams also need methods for reasoning with observational data.</p><h2>Observational Data and the Problem of Confounding</h2><p>Most production data is observational. It is generated by systems, users, business rules, previous models, and operational constraints. In observational data, actions are usually not assigned randomly.</p><p>This creates confounding. Confounding occurs when the group that received an action differs from the group that did not receive it in ways that also affect the outcome.</p><p>For example, suppose a platform sends retention emails to users who appear likely to churn. Later, the team observes that users who received emails churn more often than users who did not. A naive analysis might conclude that emails increase churn. But this may be wrong: the email group was already at higher risk before the email was sent.</p><p>In software systems, confounding can come from many sources: user behavior, geography, device type, account age, traffic source, prior model scores, manual business rules, seasonality, or platform constraints. A causal analysis must account for these differences before interpreting an observed association as an effect.</p><p>This is one reason causal inference should be integrated into MLOps metadata and data lineage. Engineers need to know not only what happened, but also why an action was assigned.</p><h2>Treatment Assignment as a First-Class MLOps Component</h2><p>One of the most useful ideas for software engineering is to treat assignment logic as part of the system architecture.</p><p>In causal inference, the assignment mechanism describes how a unit receives an action, treatment, exposure, or intervention. In software terms, this could mean how users are assigned to an experiment group, how recommendations are selected, how customers are targeted for a campaign, how alerts are triggered, how transactions are flagged, or how models choose automated actions.</p><p>For causal analysis, this assignment process is critical. If engineers do not record how and why an action was assigned, later analysis may be unreliable.</p><p>This suggests an important MLOps principle: decision logs should include enough information to reconstruct the assignment process. This may include model version, policy version, feature values at decision time, eligibility rules, randomization seed, experiment ID, fallback logic, and manual overrides.</p><p>Without this information, causal evaluation becomes much harder. The team may know what action occurred and what outcome followed, but not whether the comparison group is valid.</p><h2>Propensity and Balancing in Observational Systems</h2><p>When randomization is unavailable, one practical approach is to make treated and untreated groups more comparable using observed data. In software systems, this often means comparing users, transactions, or entities with similar characteristics before the action occurred.</p><p>The general idea is simple: if two users looked similar before an intervention, but one received the intervention and the other did not, then comparing their later outcomes may be more informative than comparing all treated users against all untreated users.</p><p>This type of approach is related to propensity-based methods. A propensity score can be understood as an estimated likelihood that a unit would receive a given action based on observed features. Engineers can then use this score to match, group, or adjust comparisons.</p><p>For MLOps, the important lesson is not the mathematical detail. The important lesson is that causal analysis requires pre-action features. Features collected after the action may already be affected by the action and can create misleading conclusions.</p><p>Therefore, feature stores and event logs should preserve time-aware data. Engineers need to know what was known before the decision, not only what is known now.</p><h2>Validity, Bias, and Monitoring</h2><p>Causal inference depends heavily on validity. In software engineering terms, validity means that the evaluation actually measures the effect it claims to measure.</p><p>Several threats to validity are common in MLOps environments.</p><p>Selection bias occurs when the analyzed population is not representative of the population where the decision will be applied. For example, evaluating a model only on users who completed a workflow may ignore users who dropped out earlier.</p><p>Measurement bias occurs when the outcome or features are recorded inaccurately. For example, a click may not always represent satisfaction, and a logged conversion may depend on tracking quality.</p><p>Specification problems occur when the analysis model does not represent the real decision process well enough. For example, the analysis may ignore eligibility rules, delayed outcomes, or interaction between multiple running experiments.</p><p>Interference occurs when one unit&#8217;s treatment affects another unit&#8217;s outcome. This is common in networked software systems. For example, changing recommendations for one user may affect content popularity, which then affects recommendations for other users.</p><p>These issues show that causal inference is not only a modeling problem. It is also a systems problem. Good causal analysis requires reliable logging, stable identifiers, versioned interventions, clear exposure definitions, and monitoring of assumptions.</p><h2>Causal Inference and the MLOps Lifecycle</h2><p>Causal inference can be mapped directly into the MLOps lifecycle.</p><p>During problem framing, teams should define the decision, the alternative, and the outcome of interest. The question should be written as an intervention question, not only as a prediction question.</p><p>During data collection, teams should capture decision-time context. This includes features, assignment rules, model versions, experiment identifiers, and eligibility criteria.</p><p>During model development, teams should separate predictive goals from causal goals. A model that predicts an outcome well is not automatically a model that estimates the effect of an action.</p><p>During deployment, teams should consider whether the system allows randomized evaluation, phased rollout, or other designs that support causal learning.</p><p>During monitoring, teams should track not only model performance but also policy effects. A model may remain accurate while the effect of its recommended action changes over time.</p><p>During governance, teams should document assumptions. Causal conclusions often depend on assumptions that cannot be fully tested from the data. Making these assumptions explicit improves review, auditability, and responsible deployment.</p><h2>Practical Implications for Software Engineers</h2><p>For software engineers, causal inference encourages a shift in mindset.</p><p>Instead of asking only, &#8220;Can we predict this outcome?&#8221; teams should also ask, &#8220;What action are we evaluating?&#8221; and &#8220;Compared with what alternative?&#8221;</p><p>Instead of logging only predictions and outcomes, systems should log decisions, assignment rules, model versions, and the state of relevant features at decision time.</p><p>Instead of assuming that historical data directly answers intervention questions, teams should examine how the data was generated.</p><p>Instead of treating A/B testing as separate from machine learning, experimentation should be seen as part of the MLOps feedback loop.</p><p>Instead of relying only on dashboards of associations, teams should build evaluation workflows that distinguish prediction quality from decision impact.</p><h2>Conclusion</h2><p>Causal inference provides a useful foundation for building machine learning systems that support decisions, not just predictions. Its central contribution is the discipline of comparing what happened with what would have happened under an alternative action.</p><p>For MLOps, this means causal thinking should be embedded in system design. Assignment mechanisms, decision logs, feature timing, experiment infrastructure, monitoring, and governance all matter. Without these components, teams may confuse correlation with causation and deploy systems that optimize misleading signals.</p><p>A software-engineering view of causal inference does not require starting with complex mathematics. It begins with clear questions, careful logging, explicit assumptions, and disciplined comparison. In this sense, causal inference is not only a statistical framework. It is also an engineering practice for building more reliable decision-making systems.</p><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-1" href="#footnote-anchor-1" class="footnote-number" contenteditable="false" target="_self">1</a><div class="footnote-content"><p>This literature review was fully generated with the assistance of artificial intelligence. The AI system was used to interpret the source material, translate its main ideas into a general software engineering and MLOps context, organize the discussion, and draft the final text. As a result, the review should be read as an AI-generated synthesis rather than as a human-authored academic analysis.</p><p></p></div></div>]]></content:encoded></item></channel></rss>