Recently we had the 19th edition of our Data & AI Meetup. This meetup focused on Chart Choice & Anomaly Detection for Warranty Cases. Let’s have a quick recap!
Intro & announcements: our 5th anniversary
Chart Choice by Dilyana Bossenz, Business Analytics and Enablement Manager at M2.
New Book: Decisively Digital – From Creating a Culture to Designing Strategy by Alexander Loth, author & executive advisor at Microsoft
Anomaly Detection for warranty cases with an example of the automotive industry by Shubham Agarwal, Lead Data Scientist at ATCS and Frank Schlemmbach, Sr. Consultant at ATCS and Sven Sommerfeld, Managing Director at ATCS
Of course, researching LinkedIn profiles for a huge list of people is a very repetitive task. So let’s find a solution to improve this workflow…
1. Python and TabPy
We use Python to build API requests, communicate with Azure Cognitive Services and to verify the returned search results. In order to use Python within Tableau, we need to setup TabPy. If you haven’t done this yet: checkout my TabPy tutorial.
2. Microsoft Azure Cognitive Services
One of many APIs provided by Azure Cognitive Services is the Web Search API. We use this API to search for name + company + “linkedin”. The first three results are then validated by our Python script. One of the results should contain the corresponding LinkedIn profile.
3. Calculated Field in Tableau
Let’s wrap our Python script together and create a Calculated Field in Tableau:
Michael, a data scientist, who is working for a German railway and logistics company, recently told me during an FATUG Meetup that he loves Tableau’s R and Pyhton integration. As he continued, he raised the raised the question for using functions they have written in Julia. Julia, a high-level dynamic programming language for high-performance numerical analysis, is an integral part of newly developed data strategy in the Michael’s organization.
Tableau, however, does not come with native support for Julia. I didn’t want to keep Michael’s team down and was looking for an alternative way to integrate Julia with Tableau.
This solution is working flawless in a production environment since several months. In this tutorial I’m going to walk you through the installation and connecting Tableau with R and Julia. I will also give you an example of calling a Julia statement from Tableau to calculate the sphere volume.
So what is the next big thing for our Data Science Rockstars? Julia!
Who is Julia?
Julia is a high-level dynamic programming language introduced in 2012. Designed to address the needs of high-performance numerical analysis its syntax is very similar to MATLAB. If you are used to MATLAB, you will be very quick to get on track with Julia.
Compared to R and Python, Julia is significantly faster (close to C and FORTRAN, see benchmark). Based on Tableau’s R integration, Julia is a fantastic addition to Tableau’s Advanced Analytics stack and to your data science toolbox.
Where can I learn more?
Do you want to learn more about Advanced Analytics and how to leverage Tableau with R, Python and Julia? Meet me at the 2017 Tableau Conferences in London, Berlin or Las Vegas and join my Advanced Analytics sessions:
Yes, of course! I published tutorials for R and Python on this blog. And I will also publish a Julia tutorial soon. Feel free to follow me on Twitter @xlth, and leave me your feedback/suggestions in the comment section below.
In 2013 Tableau introduced the R Integration, the ability to call R scripts in calculated fields. This opened up possibilities such as K-means clustering, Random Forest models and sentiment analysis. With the release of Tableau 10.2, we can enjoy a new, fancy addition to this feature: the Python Integration through TabPy, the Tableau Python Server.
Python is a widely used general-purpose programming language, popular among academia and industry alike. It provides a wide variety of statistical and machine learning techniques, and is highly extensible. Together, Python and Tableau is the data science dream team to cover any organization’s data analysis needs.
In this tutorial I’m going to walk you through the installation and connecting Tableau with TabPy. I will also give you an example of calling a Python function from Tableau to calculate correlation coefficients for a trellis chart.
1. Install and start Python and TabPy
Start by clicking on the Clone or download button in the upper right corner of the TabPy repository page, downloading the zip file and extracting it.
Protip: If you are familar with Git, you can download TabPy directly from the repository:
> git clone git://github.com/tableau/TabPy
Within the TabPy directory, execute setup.sh (or setup.bat if you are on Windows). This script downloads and installs Python, TabPy and all necessary dependencies. After completion, TabPy is starting up and listens on port 9004.
2. Connecting Tableau to TabPy
In Tableau 10.2, a connection to TabPy can be added in Help > Settings and Performance > Manage External Service Connection:
Set port to 9004:
3. Adding Python code to a Calculated Field
You can invoke Calculated Field functions called SCRIPT_STR, SCRIPT_REAL, SCRIPT_BOOL, and SCRIPT_INT to embed your Python script in Tableau: