<?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:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Nick Ball on Medium]]></title>
        <description><![CDATA[Stories by Nick Ball on Medium]]></description>
        <link>https://medium.com/@nickballdatascience?source=rss-a09a29dd82cb------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*S8gTK1fkqHWGToQqLBbeCw.jpeg</url>
            <title>Stories by Nick Ball on Medium</title>
            <link>https://medium.com/@nickballdatascience?source=rss-a09a29dd82cb------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 10:13:26 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@nickballdatascience/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How to make sure your model is fair, accountable, and transparent (FAT)]]></title>
            <link>https://medium.com/mlops-community/how-to-make-sure-your-model-is-fair-accountable-and-transparent-fat-b8004be344ed?source=rss-a09a29dd82cb------2</link>
            <guid isPermaLink="false">https://medium.com/p/b8004be344ed</guid>
            <category><![CDATA[transparency]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[fairness]]></category>
            <category><![CDATA[mlops]]></category>
            <category><![CDATA[accountability]]></category>
            <dc:creator><![CDATA[Nick Ball]]></dc:creator>
            <pubDate>Mon, 16 Nov 2020 10:07:37 GMT</pubDate>
            <atom:updated>2020-12-07T22:14:13.152Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to make sure your model is fair, accountable, and transparent (FAccT), Part 2</h3><p><em>Part 2 of 2</em></p><p>In the first part, we introduced the topic, and covered fairness and accountability. In this second part, we cover transparency, tools, conclusions, and next steps.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*sYFqdnjNmggZY52f" /></figure><h3>Transparency</h3><p>Transparency means that the decision making process of the model is understandable by humans. This doesn’t just mean the people who built the model, but anyone to whom such an understanding might be necessary. Full transparency of course means different things to different people, but a good starting point is to realize that most people see things causally. If we are wanting to know “why” a model did something, then there needs to be a clearly identified “reason”, or set of reasons, that can be proven to be the cause of the outputs. Various measures may be acceptable.</p><p>Achieving good transparency can be helped by having an adequate and agreed upon statement of the business problem to be solved, and knowing who is responsible for ensuring the solution is transparent (ideally a specialist in compliance, not the data scientist).</p><p>In some cases, a model might be part of a system where no explanation is needed, such as an internal company process, or something that has no ethical implications in the model outputs (say, turn down the office heating when no one is there). In these cases, the model could be a true black box with transparency only needed in the I/O and wider pipeline. In other cases, such as a medical diagnosis or prisoner parole, explanations should obviously be more accessible.</p><p>Some considerations for transparency include:</p><ul><li>Do you need machine learning?</li><li>Do you need nonlinear ML, and in particular, do you need deep learning?</li><li>Is a model-agnostic explanation acceptable?</li><li>Do you need human-interpretable features?</li><li>What are the regulatory requirements?</li><li>Do you need reason codes?</li><li>Do you need to visualize your model?</li><li>Is the setup that you have thus come up with in fact OK?</li></ul><h3>Do you need machine learning?</h3><p>A classical or parametric model may be able to directly describe the data and fully solve the business problem without needing to use machine learning. In such cases, models are often fully interpretable as-is, and do not need extra work beyond explaining to relevant audiences in terms they can understand what the model represents.</p><h3>Do you need nonlinear ML, and in particular, do you need deep learning?</h3><p>If a linear model is adequate, use it. If not, then methods such as well-tuned gradient boosted decision trees can solve most business problems, and do so in terms of features that remain human-readable throughout. These can translate directly into measures such as variable importance (not perfect but often useful), partial dependence plots, and, if the trees are <a href="https://towardsdatascience.com/how-does-the-popular-xgboost-and-lightgbm-algorithms-enforce-monotonic-constraint-cf8fce797acb">monotonic</a>, into reason codes. If the trees are in an ensemble, the model size may have to be limited.</p><p>The interpretation of deep learning, however, remains a topic of research. Various methods such as <a href="https://www.fiddler.ai/explainable-ai">integrated gradients</a> exist, but anything that requires delving into the internal structure of the model could be tricky. Your TensorFlow keras.layers. … , or equivalent in PyTorch, etc., may not be so easy to dissect as it was to create and train.</p><h3>Is a model-agnostic explanation acceptable?</h3><p>Deep learning is, however, well-known to be the best solution to some problems (images, speech, etc.), so is a setup that leaves the model unprobed but looks at the input and output data OK in your particular situation? If it is, then model-agnostic methods such as LIME, or the more recent <a href="https://towardsdatascience.com/shap-explained-the-way-i-wish-someone-explained-it-to-me-ab81cc69ef30">SHAP</a> and its <a href="https://towardsdatascience.com/introducing-shap-decision-plots-52ed3b4a1cba">visualizations</a>, might be acceptable. They assign a significance to the inputs for each data point, which can in turn, by either ranking or direct quoting of the values, be said to be the reasons why a model made a given decision. This can incorporate deep learning by running the explainer on the inputs and outputs of the deep learning model.</p><h3>Do you need human-interpretable features?</h3><p>A set of significances from SHAP might be acceptable, but it means in turn that the features on which they are based must be human-readable if one needs the causal story. This rules out some otherwise productive dimension reduction techniques like SVD or PCA, and probably even things like polynomial expansions. So your feature engineering step needs to be cognizant of creating features that are sufficient to establish that your model is fair and transparent. This is more difficult if the data are unstructured, like images.</p><h3>What are the regulatory requirements?</h3><p>These are subject to the same issue as mentioned in the fairness section above about data rules being both industry-dependent, and international. A well-known example is in finance in the US, where the denial of credit requires the reasons to be given. If a model can’t produce these reasons, then it can’t be used, which has limited which ML models can be used for this application.</p><p>The solution? Unfortunately, the same as above — there is likely no easy solution to this other than the work of being aware of which jurisdictions your product, models, and data will be subject to, and as with everything else, clearly documenting it.</p><h3>Do you need reason codes?</h3><p>Reason codes are directly saying that your model made its decision or prediction <em>because</em> of some specific condition. There could be a single reason, or there might be several, which could be weighted or ranked. Ideally the reason will want to be with regard to a given data point, i.e., a local explanation, as opposed to the overall significance in the model of each variable over all the data points it was trained on, which is a global explanation.</p><p>There is another subtlety, however, which is that while “reasons” can simply be in direct proportion to how significant the variables are in the model for that data point, you may also need them to have directionality, or thresholds. As in, your loan application is less favorable <em>because</em> your income is <em>less than</em> $50,000 per year. If the model has ascribed significance to income, but when you look more closely you see it has said something like if income is below $28,734 don’t approve, between $28,734 and $44,329 do approve, $44,329 to $48,715 don’t approve, and so on, then it is clear that saying your income was greater than or less than some number, or even “high” or “low” is not what the model is actually doing. In other words, the model should not be jumping around like this, but should be monotonic. This can be done with simple decision trees, but those may not be performant, and for more complex models such as ensembles or <a href="https://www.oreilly.com/radar/ideas-on-interpreting-machine-learning/">neural networks</a>, it can be done but it is less obvious how to do it. So the question reverts to whether directional reasons are needed for a given situation, and if performance can be traded off for a simpler model.</p><h3>Do you need to visualize your model?</h3><p>A final consideration is that it can often be easier to understand your model if it is somehow visualized. Any detailed visual of the actual model, such as those given by TensorBoard, or things like visualizing a whole random forest, are likely only of interest to the advanced technical user, and will need to be translated for other audiences. So while such diagrams can be important, visualizing the explanation is probably simpler. An example might be the various SHAP plots that can be made. As with many of the concepts in F, Acc, T, the tools are still evolving and improving to do such visualizations well.</p><h3>Is the setup that you have thus come up with in fact OK?</h3><p>Once answered, circle back the transparency proposal as part of the wider conversation about what is an acceptable solution to the business problem. As with many things, others outside the technical team may raise points not thought of by that team.</p><h3>Tools</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*erHdmOB_QEV0KHCz" /></figure><p>Having now reviewed F, Acc, and T, what about tools to implement it? Unfortunately, the possible stack of tools to use is too large to examine in any detail in an article like this one. The field is still maturing and there is a plethora of competing and rapidly developing open source and proprietary products for either one part of the dataflow or end-to-end. There are arguments both for creating your own stack of best-of-breed tools for different areas, or unifying things in a platform that aids collaboration between data scientists, engineers, and others.</p><p>So the choice of tools depends on where you land on this continuum of desired setups, and your available time, resources, and expertise.</p><p>Some examples of possible setups are given in the article <a href="https://a16z.com/2020/10/15/the-emerging-architectures-for-modern-data-infrastructure">Emerging Architectures for Modern Data Infrastructure</a> in their 3 <em>Blueprint</em> diagrams. These encompass the end-to-end data science stack and not just MLOps or FAccT, but they give a flavor of the many tool names and interconnections that are possible. You could take a setup like one of these, and apply the FAccT concepts to it. Diagram 1 is for business intelligence, diagram 2 is for a large enterprise where MLOps is coming from a platform, and diagram 3 is using best-of-breed tools including many that have been discussed in the MLOps community. There are probably as many ideal stacks as there are people in the field, but these show setups that could be built, forming a useful basis for further work in your own company.</p><h3>Conclusions</h3><p>This 2-part blog entry has skimmed the surface of making a model F, Acc, and T. Entire books could be written about each, and there are more topics (e.g., privacy, security, metrics) that could have been included here.</p><p>I have not gone into detailed technical recommendations for tools to solve each, because the topic is too wide-ranging and the entry would be many times the length it already is. Nevertheless, I have tried to include some pointers for next steps for anyone tasked with producing a FAccT model. These are mostly in the form of links to other articles that expand on key themes, rather than original research literature or other sites.</p><p>The next step for the interested reader would be to relate all of this to their own business problem, and perhaps follow some of the links.</p><p>The main points from this article to take away have substantial overlap with many general points about doing good data science in the enterprise setting, but they can be summarized as:</p><ul><li>Just as a trained model is not useful without production (MLOps), a model in production that is not F, Acc, and T, is not useful either</li><li>FAccT must therefore be a primary part of any modeling setup</li><li>For fairness, main points include be OK with your ethics, monitor your deployed models, be robust to changing data, and embrace diversity to minimize bias</li><li>For accountability, version everything, ensure provenance, log as needed, and make sure the dataflow and models are auditable</li><li>For transparency, determine to what degree black-box versus explanation is needed, and be sure all parties agree your setup is sufficiently transparent</li><li>As with all data science in the enterprise, keep the primary focus on the problem to be solved, and continuously make sure all parties are on the same page with regard to it</li></ul><p>A final point is that, as you will have seen, there are a lot of issues to be resolved to make your model F, Acc, and T. This is just part of solving the wider issues of MLOps and data science. It is likely apparent that no one person could address all of this in a company, and at minimum you need a data scientist, a data/ML engineer, and for the parts linking technical execution to the wider business context, a team lead. The author will likely return to this theme in a future blog entry.</p><h3><em>Author Bio</em></h3><p><em>Dr. Nick Ball has been doing data science for 20 years. He began in the year 2000 using neural networks to classify galaxies, and continued working with machine learning on large astronomy datasets via two postdoctoral positions in North America. He wrote the first major published refereed review of Data Mining and Machine learning in Astronomy in 2010, and helped create CANFAR+Skytree, a cloud computing data mining system for astronomy. He then joined Skytree in 2013, working on several dozen customer projects, and continued at Infosys after Skytree was acquired. He then moved on to Oracle and their Data Science Platform, and then to Dotscience as Principal Data Scientist to lead the product roadmap on their MLOps platform.</em></p><p><em>This gives him experience as a generalist / full-stack data scientist across all areas of the field. He lives in the San Francisco Bay Area.</em></p><p><em>LinkedIn: </em><a href="https://www.linkedin.com/in/nickballdatascientist"><em>https://www.linkedin.com/in/nickballdatascientist</em></a></p><p><em>Website: </em><a href="https://nickballdatascience.com/"><em>https://nickballdatascience.com</em></a></p><h3><em>Image Credits</em></h3><p><em>Fat cat: </em><a href="https://commons.wikimedia.org/wiki/File:Cat_on_its_back.jpg"><em>User:Jami430 / Wikimedia Commons</em></a><em>, </em><a href="https://creativecommons.org/licenses/by-sa/4.0/"><em>CC BY-SA 4.0</em></a></p><p><em>Neurons: </em><a href="https://commons.wikimedia.org/wiki/File:Forest_of_synthetic_pyramidal_dendrites_grown_using_Cajal%27s_laws_of_neuronal_branching.png"><em>User:Mietchen / Wikipedia Commons</em></a><em>, </em><a href="https://creativecommons.org/licenses/by/2.5/"><em>CC BY 2.5</em></a></p><p><em>Tool use: </em><a href="https://commons.wikimedia.org/wiki/File:A_Bonobo_at_the_San_Diego_Zoo_%22fishing%22_for_termites.jpg"><em>User:Mike R / Wikipedia Commons</em></a><em>, </em><a href="https://creativecommons.org/licenses/by-sa/3.0/"><em>CC BY-SA 3.0</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b8004be344ed" width="1" height="1" alt=""><hr><p><a href="https://medium.com/mlops-community/how-to-make-sure-your-model-is-fair-accountable-and-transparent-fat-b8004be344ed">How to make sure your model is fair, accountable, and transparent (FAT)</a> was originally published in <a href="https://medium.com/mlops-community">MLOps.community</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to make sure your model is fair, accountable, and transparent (FAT)]]></title>
            <link>https://medium.com/mlops-community/how-to-make-sure-your-model-is-fair-accountable-and-transparent-fat-690a8541743e?source=rss-a09a29dd82cb------2</link>
            <guid isPermaLink="false">https://medium.com/p/690a8541743e</guid>
            <category><![CDATA[accountability]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[fairness]]></category>
            <category><![CDATA[transparency]]></category>
            <category><![CDATA[mlops]]></category>
            <dc:creator><![CDATA[Nick Ball]]></dc:creator>
            <pubDate>Mon, 02 Nov 2020 14:21:38 GMT</pubDate>
            <atom:updated>2020-12-07T22:17:41.719Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to make sure your model is fair, accountable, and transparent (FAccT), Part 1</h3><p>Part 1 of 2</p><p><em>In this first part, we introduce the topic and cover fairness and accountability. In the second part, we will cover transparency, tools, conclusions, and next steps.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*chsd9Yi_-gMlJteL" /></figure><p>Everybody wants their machine learning model to be fair, accountable, and transparent (“FAccT”), but how is this achieved? By necessity, the content here is somewhat wide-ranging and high-level. We will add some specifics, but detailed reviews or comparisons of particular tools would merit their own articles. Our aim here is to provide a baseline on which to build.</p><p>As people in the <a href="https://mlops.community/">online community</a> know, MLOps is about going from a nice machine learning (ML) model that is probably in a data scientist’s Jupyter notebook to something that actually works in the actual real world to solve some actual business problem, and gets actually used. Perhaps one might write it more elegantly, but this is the essence of it.</p><p>So let’s take a step back and view the business and data science context that this is in:</p><ol><li>Business problem</li><li>Obtain and prepare the data</li><li>Build the model</li><li>Put it into production</li><li>Generate business value</li></ol><p>We said “business”, but the same ideas can be applied to any data science problem. A lot of the emphasis, especially in the front lines of the MLOps community, will be on the technical aspects of item 4, and perhaps the interactions of steps 2 – 4, leaving others to worry about the wider context of items 1 and 5. But focusing on the technology in isolation is a <a href="https://www.datasciencecentral.com/profiles/blogs/data-scientists-think-data-is-their-1-problem-here-s-why-they-re">mistake</a>. All parts of all the steps above are relevant to MLOps, and should be considered in a successful project. It may not necessarily be that the practitioners here have to do all that — linking together all 5 steps is the job of senior technical leaders — but things being built that work which senior management then doesn’t agree to, understand, or see the value of, are a large factor in the now-cliche statistic of 85% of AI projects failing.</p><p>We do not attempt to solve all of the context issues here, but bring them up because the same point applies to model fairness, accountability, and transparency: achieving each of these requires consideration of the whole end-to-end context in which the model is operating, from all points of view: engineering, data science, business, IT, customer, and so on.</p><p>Let’s take a look at each of F, Acc, and T in turn. We will then briefly consider contemporary tools that may help, followed by some conclusions and next steps.</p><h3>Fairness</h3><p>Fairness means ensuring that the results of your model are not biased, and, just as importantly, not perceived to be biased. Any bias is likely unintentional, but it doesn’t matter if the outcome is the same.</p><p>Some items to consider for fairness are:</p><ul><li>Ethics</li><li>Drift</li><li>Robustness &amp; sensitivity</li><li>Diversity &amp; biased data</li><li>Internationality</li></ul><h3>Ethics</h3><p>AI is a powerful tool. Which uses of it, and which data, are ethical? The topic is significant enough that sometimes it is added separately to FAccT, making <a href="https://www.microsoft.com/en-us/research/theme/fate/">FATE</a>.</p><p>There are no easy answers of course, but for many use cases in the US a good starting point are the laws around protected characteristics that one is not allowed to discriminate upon in the workplace. These include gender, race, age, and others. The list forms a specific set of features that one can show is not part of the input that is being used by your model. In other countries, analogous laws should be used, or if none exist, a feature set can be drawn up and agreed upon by a company team.</p><p>Unfortunately, even excluding all explicit reference to these characteristics does not completely solve the problem, because they may still enter implicitly via correlations to features that are used.</p><p>However, at some level, data must contain a signal that enables a model to perform its function. The reality is that some people may indeed be better or worse qualified for some service, be at lower or higher risk for some adverse outcome, or whatever we are trying to model. Unless we want all model outputs to be identical, differences in the outputs based upon differences in input data could be claimed to be fair or unfair.</p><p>The key is to document everything clearly, so that while not everyone may agree exactly where all the lines are on what is OK and not OK — ethics is, after all, an entire branch of philosophy — at least everyone can objectively see what a particular model did use as its data. Combine this with accountability and transparency below, and it is much easier to be satisfied that a model is ethical, or to make a case that it is not.</p><p>On an individual level as a practitioner attempting to be ethical, most common forms of advice for living a good life involve some form of being true to oneself. In the case of AI ethics, this may mean having to be quite clear about what is a use of AI that is compatible with your values, and what is not. It is usually not worth going against long-term values for short-term gain, but difficult choices may have to be made. Are you OK that your model is used to deny people health insurance based on its outputs, or do you see it as offset by others being granted who may not have been under simpler rules? Or whatever other questions come up.</p><h3>Drift</h3><p>A deployed model that is fair could become unfair if there is drift, either in incoming data (data drift), the underlying ground truth (concept drift), or the model outputs (model drift) as a result of the first two. Many deployment teams do not have direct control of the data that is coming to their model, and so, for example, a data schema might change so that a protected characteristic is introduced into the dataset, the model is retrained, and data that should not be being used is now present.</p><p>The best way to spot and deal with drift is to have good model monitoring, alerting, outlier detection, logging, retraining, and redeployment. This includes the ability to not just be able to handle single models, but to use a system that can deal with complex inference graph setups. Such arrangements are often desired in practice because of data pre-processing including business logic, model stacking &amp; ensembling, shadow and other deployments for A/B testing, or statistical tests that are better passed to their own module within the deployment rather than done with, say, a <a href="https://prometheus.io/docs/prometheus/latest/querying/basics/">time series database query</a>.</p><p>Examples of more complex tests would be outlier detection other than simple thresholding (perhaps an outlying interpretation of a decision), determining if a detected drift is statistically significant, or even using ML on the drift: if the <a href="http://blog.bigml.com/2014/01/03/simple-machine-learning-to-detect-covariate-shift">performance</a> of a special ML model trained to classify whether data is from the training set or your production test data degrades, then your production data has probably drifted.</p><p>The perfect manifestation of such a system does not yet exist, but products such as Seldon show somewhat complex inference graph <a href="https://docs.seldon.io/projects/seldon-core/en/latest/workflow/github-readme.html">arrangements</a> in their documentation, so we are on our way.</p><h3>Robustness &amp; sensitivity</h3><p>Model robustness means that its result is not changed by small changes to the input data. Machine learning models, however, are in general nonlinear, which means that in principle arbitrarily small changes to the inputs could result in arbitrarily large changes to the outputs. Think of a single nearest neighbor model in a continuous space of arbitrarily high numerical precision: the tiniest movement could change the classification of a data point. For most models it is not this bad because they smooth things out to a lesser or greater extent (think of the bias-variance tradeoff for supervised models: high bias is too smooth but high variance is too rough and has fitted the noise), but such volatility often cannot be guaranteed to be eliminated. Large changes in outputs from a small change in inputs can obviously be bad in many situations.</p><p>There is not really a good answer to unexpected behavior, except to try to minimize the probability of the model doing something weird or unwanted. And if it did, at least to have the F, Acc, T aspects of its end-to-end dataflow enable diagnosis of what happened, along with timely alerting and followup actions if needed. Part of the risk minimization can be to include sensitivity analysis in model building and training to get an idea in a statistical sense of how robust a model is.</p><h3>Diversity &amp; biased data</h3><p>If you are not part of the most common or powerful group in a population, then you are often described not as who you actually are, but lumped together as being part of the “diversity” that is outside of the main group. Readers can think of their own examples. But when data is being modeled, for a model to be fair, it should be using the best sampling of the population to represent all of its members.</p><p>The problem is that often there is not the available data to represent the full diversity of a population. Popular sentiment may say that AI is biased, but it is usually the <a href="https://www.datasciencecentral.com/profiles/blogs/23-types-of-bias-in-data-for-machinelearning-and-deeplearning">data or methods</a> that are biased, not the models per se. The solution is to put more emphasis than most teams do on good data.</p><p>A related issue is that people are often not even aware that they are biased. And those who have been subject to bias against them don’t need the author to provide examples. As with several areas of making models F, Acc, and T, there is no easy answer, but one thing that can help a lot is to simply gather a variety of viewpoints from a diverse group of people. The author is aware of several biases he himself had when younger that have been lessened by living in more than one country, and being in different communities. This awareness and addressing of bias would not have been possible without the input of this variety of people and viewpoints.</p><p>Finally on diversity, there is the question of accessibility. What if your potential user is blind, or doesn’t speak English, or cannot type, and so on? Again, these people should not be in the “diversity” outside your normal group and be left as an afterthought, but treated as equal users. This is a difficult ideal to live up to — will this article be translated, for example? I doubt it, and the author doesn’t plan to do it. So it may be impossible for a team to fully realize making the value of their results as widely available as it should be. But what can be done is to try to push more on incorporating diversity and reducing bias than most teams would do just as a default or comfort zone state.</p><h3>Internationality</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*6NwZBQb8K-8ZD1nS" /></figure><p>Many industries are subject to regulatory compliance, data protection, and other laws that must be followed by enterprises when deploying AI models. A good example is the GDPR, which applies not just to companies in Europe, but to any company that is dealing with data that includes information about people in Europe.</p><p>Now take the spread of rules across different industries, the fact that they are <a href="https://www.datanami.com/2020/10/09/patchwork-of-data-privacy-laws-sows-confusion">rapidly evolving</a>, and multiply it by <a href="https://www.gartner.com/smarterwithgartner/gartner-predicts-for-the-future-of-privacy-2020">200 countries</a> + regions within countries, and the large extent of the issue is clear.</p><p>There is likely no simple solution to this other than doing the work of being aware of which jurisdictions your product, models, and data will be subject to, and as with everything else, clearly documenting it. If your jurisdiction doesn’t have a particular law yet, following the best practices of places that do is probably wise.</p><h3>Accountability</h3><p>Accountability means that the way a result from a model was arrived at through an end-to-end system can be understood, is auditable, and <a href="https://ai.facebook.com/blog/how-the-ai-community-can-get-serious-about-reproducibility">reproducible</a>.</p><p>Considerations for accountability include:</p><ul><li>Version everything</li><li>Provenance</li><li>Logging</li><li>Auditability</li></ul><h3>Version everything</h3><p>A good maxim for accountability is <em>version everything</em>. One cannot reproduce a dataflow if which data went to which model on which API endpoint, etc., is uncertain.</p><p>Dotscience (before it <a href="https://dotscience.com/blog/2020-05-19-dotscience-is-shutting-down/">shut down</a> in May 2020) had a <a href="https://dotscience.com/technology/">good approach</a> to this, because it was built upon the underlying open source project Dotmesh, which in turn was built upon the ZFS filesystem. Dotmesh allowed snapshots to be taken of the application state, and ZFS allowed filesystems to be synced without having to copy all the data every time. This meant that projects involving large datasets undergoing many changes as part of the data preparation and modeling, could still be tracked. Other products such as <a href="https://dvc.org/">DVC</a> have similar cognizance of the importance of versioning. (Incidentally, Dotmesh is still available. Another product could be built using it.)</p><p>A key to good versioning is to treat as first-class items the things in data science that should be so treated. This includes code, datasets, models, runs (executions of a dataflow and/or analysis), deployments, model decisions, and ideally compute environment, including hardware, software, and libraries.</p><p>Some of these items are easier to version than others. Datasets can be done via appropriate metadata. Models and deployments can also, although it needs to be kept in mind that they have stateful components like hyperparameters before and after training, and possibly even when deployed (e.g., online learning). Models also likely include pre-processing steps to convert raw incoming data into a form suitable to pass to the model, and possibly post-processing too.</p><p>A computational environment can be containerized, but we still need to be sure the containers are portable. Model decisions could be recorded, but the volume may be high. And finally, runs of an analysis should be versioned so that the user can say “run this again” in a way that is guaranteed reproducible. The code, datasets, models and other objects must be related to each other in a guaranteed-correct way.</p><p>Another issue with runs that can manifest is that data scientists often prefer to use notebooks instead of the scripts+IDE more common in software engineering. This creates tension with versioning tools such as GitHub, because notebooks are hard to version. Data scientists have good reasons for preferring the notebook way of working, so this will not disappear any time soon. Some tools and platforms are attempting to make notebook versioning easier, but there is still room for improvement in integrating notebook versioning with the MLOps stack.</p><p>Other subtle problems can also occur that need to be spotted to ensure your model is correct. For example, Tecton has a <a href="https://tecton.ai/blog/devops-ml-data/"><em>Time travel</em></a> capability in their feature store product to prevent training set leakage into the testing set by calculating the feature from the correct time. The temporal relationship between data rows may be relevant, even if the data are batched and not a pure stream.</p><h3>Provenance</h3><p>If everything is versioned, and all the relations between the versioned objects are known, then provenance follows. Lack of proper provenance for data has been a criticism of several tools that the author has seen, although this is improving.</p><p>A diagrammatic representation of provenance such as a graph (DAG) can be very helpful, and has been used in the past by the author to understand others’ data science projects that he has then worked on.</p><p>Provenance also needs a fixed point from which to start. The location that the data originally came from like the file path or machine may not need to be known, but something fixed that can be started from to reproduce the dataflow does, for example the MD5 sum of the initial dataset.</p><h3>Logging</h3><p>Modern data are often too large to be kept (“volume, variety, velocity” in the well-known big data parlance), especially when they are real-time streaming. So it may be impossible to keep a log of all data that went into a model to give all of the resulting decisions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*92XErX7GZNBQUtpN" /></figure><p>The solution is some combination of downsampling or dimension-reducing the original input, enabling recording of the model input and output even if the raw data are not kept, recording metadata, or only recording data instances that were flagged in some way. What must be recorded is problem- and domain-dependent, but many datastreams already exist where it is not possible to keep them. For example, the CERN Large Hadron Collider raw data rate was <a href="https://home.cern/news/news/computing/cern-data-centre-passes-200-petabyte-milestone">1 petabyte per second</a> from the detectors.</p><h3>Auditability</h3><p>The motivation for versioning, provenance, and logging (and transparency below) is so that a decision made by a model is auditable. Auditing is a way of proving that a model is indeed fair, accountable, and transparent.</p><p>A good criterion for a model being auditable might be that it is sufficient to perform a root cause analysis for a given event, say an unexpected model decision. A root cause is defined as a precursor event that without which the event being investigated would not have occurred, or would not recur. Other causes may influence an event, but the root cause is the crucial first step in the chain without which the event cannot occur.</p><p>Auditing is another area where there isn’t yet a single great solution, because what will come out of all the data preparation + featurization + modeling + deployment steps will be some kind of large log file or files that then need to be dissected. Probably only the data engineer can understand the log, and only the auditor knows what is needed for the audit, so the usual cross-functional collaboration is needed. There is room here to make this easier for most data science problems by producing more convenient audit trails, most likely domain-specific, and having model tools expose auditable interfaces. Ideally these should be accessible by both the model users, and <a href="https://www.wired.com/story/ai-needs-to-be-audited">by neutral third parties</a>.</p><p>See part 2 for transparency, tools, conclusions, and next steps.</p><h3>Author Bio</h3><p><em>Dr. Nick Ball has been doing data science for 20 years. He began in the year 2000 using neural networks to classify galaxies, and continued working with machine learning on large astronomy datasets via two postdoctoral positions in North America. He wrote the first major published refereed review of Data Mining and Machine learning in Astronomy in 2010, and helped create CANFAR+Skytree, a cloud computing data mining system for astronomy. He then joined Skytree in 2013, working on several dozen customer projects, and continued at Infosys after Skytree was acquired. He then moved on to Oracle and their Data Science Platform, and then to Dotscience as Principal Data Scientist to lead the product roadmap on their MLOps platform.</em></p><p><em>This gives him experience as a generalist / full-stack data scientist across all areas of the field. He lives in the San Francisco Bay Area.</em></p><p><em>LinkedIn: </em><a href="https://www.linkedin.com/in/nickballdatascientist"><em>https://www.linkedin.com/in/nickballdatascientist</em></a></p><p><em>Website: </em><a href="https://nickballdatascience.com/"><em>https://nickballdatascience.com</em></a></p><h3>Image Credits</h3><p><em>Fat cat: </em><a href="https://commons.wikimedia.org/wiki/File:Cat_on_its_back.jpg"><em>User:Jami430 / Wikimedia Commons</em></a><em>, </em><a href="https://creativecommons.org/licenses/by-sa/4.0/"><em>CC BY-SA 4.0</em></a></p><p><em>World: </em><a href="https://commons.wikimedia.org/wiki/File:2016_UN_Human_Development_Report.svg"><em>User:BiggestSataniaFangirl89 / Wikipedia Commons</em></a><em>, </em><a href="https://creativecommons.org/licenses/by-sa/4.0/"><em>CC BY-SA 4.0</em></a></p><p><em>Large Hadron Collider: </em><a href="https://commons.wikimedia.org/wiki/File:View_inside_detector_at_the_CMS_cavern_LHC_CERN.jpg"><em>User:Tighef / Wikipedia Commons</em></a><em>, </em><a href="https://creativecommons.org/licenses/by-sa/3.0/"><em>CC BY-SA 3.0</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=690a8541743e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/mlops-community/how-to-make-sure-your-model-is-fair-accountable-and-transparent-fat-690a8541743e">How to make sure your model is fair, accountable, and transparent (FAT)</a> was originally published in <a href="https://medium.com/mlops-community">MLOps.community</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>