<?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 Xing Han Lu on Medium]]></title>
        <description><![CDATA[Stories by Xing Han Lu on Medium]]></description>
        <link>https://medium.com/@xhluca?source=rss-6dfc94c4709b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*NLAGh6lsJZq9YD1VtZqpyA.jpeg</url>
            <title>Stories by Xing Han Lu on Medium</title>
            <link>https://medium.com/@xhluca?source=rss-6dfc94c4709b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 18:26:35 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@xhluca/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[Exporting Zotero citations to Overleaf for a single private group]]></title>
            <link>https://xhluca.medium.com/exporting-zotero-citations-to-overleaf-for-one-private-group-b36151038171?source=rss-6dfc94c4709b------2</link>
            <guid isPermaLink="false">https://medium.com/p/b36151038171</guid>
            <category><![CDATA[zotero]]></category>
            <category><![CDATA[overleaf]]></category>
            <dc:creator><![CDATA[Xing Han Lu]]></dc:creator>
            <pubDate>Sat, 03 Jul 2021 20:05:16 GMT</pubDate>
            <atom:updated>2021-07-03T20:08:39.621Z</atom:updated>
            <content:encoded><![CDATA[<p><a href="https://www.zotero.org/">Zotero</a> is an incredible free and open-sourced citation manager for research papers. Among its great features, you can <a href="https://www.overleaf.com/learn/how-to/How_to_link_your_Overleaf_account_to_Mendeley_and_Zotero#Link_to_Zotero">link your Zotero account to Overleaf</a> to automatically export your libraries to your new Overleaf project in a bibtex format. Morever, you can also create private or public groups for Zotero that can be shared with other users; this is perfect for collaborative papers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/896/1*oiJ-0ocp_BVOxe9rrmu0bQ.png" /><figcaption>After linking your account, importing from Zotero takes one click</figcaption></figure><p>Unfortunately, after linking your Zotero account with Overleaf, the simple add files “From Zotero” will fetch all libraries, including your personal libraries. At the moment, there’s no easy option to filter to a single group. Fortunately, a community user called Christian shared <a href="https://forums.zotero.org/discussion/77185/how-to-link-zotero-private-group-with-overleaf">how to import a public group to Overleaf</a> through the Zotero API.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/698/1*T_WZ-oNUzVcChnKQ4YEGmw.png" /><figcaption>Retrieved from this <a href="https://forums.zotero.org/discussion/77185">Zotero forum thread</a></figcaption></figure><p>Moreover, this solution will only work for public groups. In order to import from a private group, you will need to use a private key (which <a href="https://forums.zotero.org/discussion/63599/generating-key-for-web-api">can be specified in the URL string</a>).</p><p>First, to find your group number, you can visit <a href="http://zotero.org/groups">zotero.org/groups</a> and click on the group you want:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f-mjDB1ZoesrSN6KPnHU-A.png" /></figure><p>Then, you can find your group number in the address:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FUBfSwda0jufI_YF0Af7jw.png" /></figure><p>Next, to generate a private key, you need to access <a href="https://www.zotero.org/settings/keys">zotero.org/settings/keys</a> and click on “Create new private key”:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wIcIuXBw__4rlYHF_0teNw.png" /></figure><p>Name the key for future reference, e.g. give it the same name as your library. Then, you can check “Per Group Permissions”, and select “Read Only” for the group(s) you want to export to Zotero. For everything else, the permission should be left to “None”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_FEtr3RBVKBu3_n_M7IfhA.png" /></figure><p>Once you pressed “Save Key”, it will generate an API key. Make sure to save that somewhere safe, just like you would do with a password. This is because whoever has access to this key can access the content of your private library.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jeDX7MeQ7SDCdU1-Ns7iKg.png" /></figure><p>In the final step, you use the following URL by replacing &lt;group&gt; with your group number and &lt;key&gt; with your new API key:</p><pre><a href="https://api.zotero.org/groups/2501167/items/top?format=bibtex&amp;style=numeric&amp;limit=100">https://api.zotero.org/groups/&lt;group&gt;/items/?format=bibtex&amp;key=&lt;key&gt;</a></pre><p>Now, inside your overleaf, project, click on the “New File”, select “From External URL” tab and add the URL you formatted above. Give a name to your file, which should end with .bib :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/633/1*tznEOLQAnkBmzeEM2hAZLA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zbp_d0-H8QtoWNzBBPd6jw.png" /></figure><p>If everything worked correctly here, you should see your references from that group, which can be synced when you refresh it:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nZkSISKy9WXU_TveE_qREA.png" /></figure><h3>References</h3><ul><li><a href="https://forums.zotero.org/discussion/63599/generating-key-for-web-api">Generating Key for Web API</a></li><li><a href="https://forums.zotero.org/discussion/77185/how-to-link-zotero-private-group-with-overleaf">How to link Zotero private group with Overleaf</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b36151038171" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building and Deploying Explainable AI Dashboards using Dash and SHAP]]></title>
            <link>https://medium.com/plotly/building-and-deploying-explainable-ai-dashboards-using-dash-and-shap-8e0a0a45beb6?source=rss-6dfc94c4709b------2</link>
            <guid isPermaLink="false">https://medium.com/p/8e0a0a45beb6</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[explainable-ai]]></category>
            <category><![CDATA[dashboard]]></category>
            <dc:creator><![CDATA[Xing Han Lu]]></dc:creator>
            <pubDate>Mon, 03 Aug 2020 18:46:00 GMT</pubDate>
            <atom:updated>2020-08-03T21:29:12.178Z</atom:updated>
            <content:encoded><![CDATA[<p>In recent years, we have seen an explosion in the usage of Machine Learning (ML) algorithms for automating and supporting human decisions. From <a href="https://about.google/stories/seeingpotential/">helping doctors in diagnosing potential diseases</a> that could render diabetic patients blind, to <a href="https://www.pionline.com/article/20180416/PRINT/180419914/race-is-on-to-grab-most-possible-from-machine-learning">supporting financial analysts in equity management</a>, the impact of ML is irrefutable. However, as algorithms become more sophisticated, it becomes harder to understand how it makes decisions. As a result, various harmful biases could arise in critical situations, such as when ML is used to determine <a href="https://www.forbes.com/sites/kimelsesser/2019/11/14/maybe-the-apple-and-goldman-sachs-credit-card-isnt-gender-biased/#1ff57f1d1518">credit limit for credit cards</a> or <a href="https://www.bbc.com/news/technology-52978191">applied to facial recognition</a> by law enforcement agencies. In order to identify and mitigate the effect of such biases before the model is deployed, it is important to leverage explainable AI (xAI) to better understand which features and factors have the most impact on the final output of the model. This <a href="https://medium.com/plotly/data-visualization-for-artificial-intelligence-and-vice-versa-a38869065d88">information can then be utilized</a> to help AI developers understand why a certain model might not be performing well in certain scenarios, or just in general. At the same time, such techniques could help us uncover more insights about a problem than simply using black-box models. Ultimately, such techniques can help both technical and non-technical stakeholders better understand and appreciate AI models.</p><h3>Explaining black-box models with Shapley Values</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*bTWrVHwelMvOn0NO" /><figcaption>Image retrieved from the <a href="https://github.com/slundberg/shap">original author’s repository</a></figcaption></figure><p>Many researchers and software developers have been working on the subject of explainable AI systems for many years. One approach, which is called <a href="https://github.com/slundberg/shap">SHapley Additive exPlanations (SHAP)</a>, has been increasingly popular in the past few years. It has been used to <a href="https://www.nature.com/articles/s42256-019-0138-9">identify chronic kidney disease</a>, to model <a href="https://www.nature.com/articles/s42256-019-0138-9">US mortality factors</a> and to help <a href="https://www.nature.com/articles/s41551-018-0304-0">anaesthesiologists during surgeries</a>. By applying a game theory concept called <a href="https://christophm.github.io/interpretable-ml-book/shapley.html">Shapley values</a>, you can interpret computer vision models, linear models, tree-based models, and more.</p><h3>Building a production-ready xAI app with Dash</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ShVTC8SUaUynYGNFKlDDOA.png" /><figcaption><em>The dashboard was fully built in Python and runs </em><a href="https://github.com/slundberg/shap"><em>SHAP</em></a><em> and </em><a href="https://github.com/microsoft/LightGBM"><em>LightGBM</em></a><em> in real-time. </em><a href="https://dash-gallery.plotly.host/dash-shap-tips/"><em>Try it out</em></a><em>!</em></figcaption></figure><p>Let’s take, as an example, the task of predicting <a href="https://vincentarelbundock.github.io/Rdatasets/doc/reshape2/tips.html">tips received by waiters</a> based on features such as the total bill, the gender of the payer, the day and time, etc. A black-box model that ingests all those features just to predict the tips could be highly biased and might not be useful for business analysts trying to understand the behavior of the customers. However, by applying <a href="https://github.com/slundberg/shap">SHAP</a>, we can gain more insights on the impact of each feature on the final value predicted by the model, which can be useful for understanding how the model perceives factors prone to biases, such as sex, age, race, etc.</p><p>In order to make such xAI methods more accessible and interactive, we used <a href="https://plotly.com/dash/">Dash</a> to build an end-to-end application that runs an ensemble model called <a href="https://github.com/microsoft/LightGBM">LightGBM</a> on custom inputs. The dashboard and the full model are deployed on our <a href="https://plotly.com/dash/kubernetes/">Dash Enterprise Kubernetes</a> servers, and both the black-box model and SHAP are running in real-time.</p><p>In the app, you will find controls that let you control the total bill, sex, day of the week, etc. Each one of those controls defines an input feature, and every time you update them, a new sample is given to the trained LightGBM model.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*N08WU3tQTCfVtwMr" /></figure><p>However, since LightGBM is a type of <a href="https://towardsdatascience.com/understanding-gradient-boosting-machines-9be756fe76ab">gradient boosting method</a>, it is hard to directly interpret it. Therefore, we simulated the controls to allow the app to compute the SHAP values and display them in <a href="https://plotly.com/python/waterfall-charts/">a waterfall chart</a>.</p><p>In addition to specifying custom model inputs, you can also select a random example from the training set. Whenever you do this, you will see the real label appear on the right side (as a scatter point). You can then tweak the feature values to see how the various SHAP values change.</p><p>Moreover, you can also decide to make binary predictions (e.g. the sex of the customer) and interact with the graph using the <a href="https://plotly.com/chart-studio-help/getting-to-know-the-plotly-modebar/">Plotly modebar</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-OQJOEmHVVUFKl0aof0P6g.gif" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JTa3giIhZohthSCjFIxkOw.gif" /></figure><h3>Bridging the gap between Python and advanced analytics</h3><p>The current state-of-the-art ML algorithms (e.g. gradient boosting and neural networks) for modeling continuous and categorical features are usually written in optimized C/C++ codes, but they can be conveniently used through Python. As a result, powerful xAI libraries like SHAP are also interfaced in the same language, which lets us train and explain powerful models in just a few lines of Python code. However, although such models are popular in the ML community, considerable effort needs to be made to port them into traditional BI tools, including having to connect external servers and add third-party extensions. Furthermore, building UIs that lets you train these Python-based ML libraries can quickly become cumbersome if you are using those BI tools.</p><p>With Dash, you can seamlessly integrate popular and up-to-date ML libraries, which enable Dash app users to quickly answer “what if?” questions, and probe what the ML models have learned from the data. Most of the time, all you need to do is to install and freeze such libraries using pip, which is usually done in a few lines:</p><pre>pip install dash shap lightgbm<br>pip freeze &gt; requirements.txt</pre><p>When you are ready to share your dashboard, all the dependencies and deployment are handled by <a href="https://plotly.com/dash/app-manager/">the Dash Enterprise App Manager</a>.</p><h3>Gaining insights beyond black-box predictions</h3><p>A classical argument against the use of more advanced models is that, although they can improve the accuracy, the complexity makes them harder to interpret. With linear regression, you can use the coefficients to judge which features weigh more than others for making a prediction; in the case of decision trees, you can <a href="https://scikit-learn.org/stable/modules/tree.html#classification">visualize how the tree splits and set thresholds</a> for deciding the output. In the case of deep neural networks and ensemble models, you can’t visualize the tree structure nor the coefficients; however, with SHAP, it’s possible to not only explain how features generally affect the model, but also how each feature value influences the output in a specific example. For example, the model might believe that female customers tend to tip more when they are going out with a friend for dinner (on a Saturday) than when they are grabbing lunch alone (on a Thursday).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*EQXqbHPXPUIY8ncn" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ttOgbly-In0dMUTd" /><figcaption>Left: Thursday lunch alone. Right: Saturday Dinner with friends.</figcaption></figure><p>Such insight could either lead to a stronger understanding of customer behavior if it is backed by additional studies, or it could reveal some degree of systematic bias that would not have been otherwise uncovered without SHAP. With Dash, we make it easier to build and deploy custom dashboards that let you interpret all sorts of ML models, whether they are trained on predicting tips, or other <a href="https://community.plotly.com/t/show-tell-interactively-explain-your-ml-models-with-explainerdashboard-shap/41245/7">types of data</a>.</p><h3>Putting the power of Python in the hands of business users</h3><p>At Plotly, we are working on keeping Dash flexible, yet easy-to-use for building ML apps and dashboards. For this reason, we built our app with components from the <a href="https://plotly.com/dash/design-kit/">Dash Enterprise Design Kit</a>, which makes it easy to tailor apps to meet style guidelines without delving into HTML and CSS. For example, if you don’t like the color of the bars in the default waterfall charts, you can easily change it with the Design Kit Theme Editor.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ywXqHx75VQpYfvEQvi7a0g.gif" /></figure><p>Furthermore, new features in Dash like <a href="https://medium.com/plotly/pattern-matching-callbacks-in-dash-9014eee99858">pattern-matching callbacks</a> let you simplify the process of creating callbacks. As a result, you can create very complex callbacks between components with very little effort. As an example, there are six controls in our app (one for each input feature), but we only need to specify one Input and one State to our callback to control all the components at the same time:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*A0Tb0i-_5Jk8NFOM" /></figure><p>Then, in one line, we were able to construct a dictionary where the keys are the feature names and the values are what we will input to the model. From then on, it’s easy to process the dictionary in the input format most suitable to your model.</p><p>Are you interested in creating similar apps using state-of-the-art models and xAI algorithms? <a href="https://plotly.com/contact-us/">Contact us</a> to learn more about how Dash Enterprise can help you build, design, and deploy ML dashboards — with no compromise.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8e0a0a45beb6" width="1" height="1" alt=""><hr><p><a href="https://medium.com/plotly/building-and-deploying-explainable-ai-dashboards-using-dash-and-shap-8e0a0a45beb6">Building and Deploying Explainable AI Dashboards using Dash and SHAP</a> was originally published in <a href="https://medium.com/plotly">Plotly</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>