Tableau Feature Important Toolbox as Tableau Prep flow

Feature Selection in Tableau

When trying to fit a machine learning model on a very wide data set, i.e. a data set with a large number of variables or features, it is advisable for a number of reasons to try to reduce the number of features:

  • The models become easier understandable, and their output as a result better interpretable, which leads ultimately to results that can be trusted rather than those of a complex black box model.
  • The exclusion of strongly correlated features can prevent model bias, as the effect of multiple variables could otherwise gain greater influence on the model as they actually do.
  • Similarly, it can help to avoid the curse of dimensionality, in the case of very sparse data.
  • Ultimately, the performance of the model can be optimized, as training times are shorter and the models are less computationally intensive.

While developing my talk “Machine Learning, Explainable AI, and Tableau”, that I presented together with Richard Tibbets at Tableau Conference in November 2019 in Las Vegas, I wrote a number of R scripts to perform feature selection and its preliminary tasks in Tableau. Due to the large number of questions I received about those scripts after the presentation, I decided to put together this article explaining what precisely I did there, in an attempt to make the “Tableau Feature Importance Toolbox” – as I’m calling the collection of scripts – available to the interested public. At a later point I will also summarize the contents of our talk in an article here on the blog, but for now you can find details about the scripts in the following, as well as the actual code files on my GitHub repository.

Continue reading →
Schema of the External Services Proxy

Why Decide? Using Both R and Python in Tableau – at the Same Time!

With the integration of external services such as R, Python, and MatLab into Tableau you can significantly broaden the circle of possible users for your organization’s data science models and workflows, by embedding them into easy-to-use dashboards that are appealing to all types of consumers. That said, if you have ever worked with the integration of external services in Tableau, you will be aware that you can only define one service connection per workbook at a time – either to RServe or to TabPy. The first time this fact became painfully apparent to me was during a workshop where I was showing the integration with both services. Every single time I switched from a worksheet that employed some R code to one embedding Python code, I had to set the connection to RServe. Whenever I moved back over to another worksheet with some embedded Python code, I first ran into an error (since Tableau sent the Python code to RServe, which obviously made the R session choke) and then had to manually reset the connection to TabPy. The same was true for the session “R … You Ready for Python?” me and my colleague Lennart Heuckendorf delivered at Tableau Conference Europe 2018 and 2019. Even worse, I am more and more working with customers whose data science stack is very diverse, so they are using models in all kinds of languages. For them it is imperative to be able to run both R and Python models within the same dashboard, possibly even on one single worksheet. So I was wondering: can this be done?

tl;dr: It’s absolutely possible! This article outlines the process we suggest and guides you from zero to a working environment to do exactly this. It builds heavily on an idea proposed by my colleague Timo Tautenhahn and one of his customers here and here, so I can’t take all the credit. It also makes use of a number of external and open source software packages, so this is neither officially supported by Tableau (don’t try logging a ticket with Technical Support if this doesn’t work for you) nor is this an official Tableau tutorial. If all these caveats didn’t discourage you to try it out yourself, read on! All the code required or referenced here is available on my GitHub repository. Also, you’ll find a video at the end of this blog post to walk you through the full process.

Continue reading →

Scraping the IMDb for Use in Tableau

In the last quarter of 2016 the German marketing team came up with a great way to follow the immense success of last year’s Tableau Stadium Tour: the Tableau Cinema Tour! After visiting ten cities all over Germany, Austria, and Switzerland, we are now considering rolling it out all over Europe. Stay tuned for that! Since we often got requests for the data used in the main demo, I decided to produce this write-up of how to extract the data from the Internet Movie Database (IMDb). Unfortunately copyright reasons make it impossible for us to just provide you the ready-made data. That said, with this walk-through everybody should be able to get the data!

Continue reading →

Tableau Kino Tour: Budget vs. Einspielergebnis

Hinter den Kulissen der Tableau Kino Tour – Teil 1: Die IMDb

Im letzten Quartal 2016 haben wir als würdigen Nachfolger der Tableau Stadion Tour 2015/16 die Tableau Kino Tour 2016/17 aus der Taufe gehoben. Nach vier bisher sehr erfolgreichen Stationen (Frankfurt, Hamburg, Berlin und Düsseldorf) warten jetzt im zweiten Teil der Tour in 2017 noch Wien, München, Zürich und Stuttgart auf uns. Da immer wieder die Frage nach den Daten kam, die hinter der Kino Tour stecken, und auch weil es tatsächlich ein sehr interessantes und spaßiges Projekt war, diese Daten zu generieren, habe ich im Folgenden mal die einzelnen Schritte zusammengefasst, vom Download der Quelldaten bis zum fertigen Produkt. Aus Copyright-Gründen dürfen wir die fertigen Daten leider nicht einfach so zum Download anbieten, aber mit der Schritt-für-Schritt-Anleitung sollte es nicht allzu schwierig sein, das zuhause selbst nachzustellen.

Continue reading →

Visuelle Datenanalyse macht Sinn

Schon wieder ist mehr als ein Jahr vergangen, in dem dieses Blog mehr oder weniger komplett brach lag. Und in der Zwischenzeit ist so viel passiert!

Im Rahmen meines Jobs beim Institut für Verkehrsforschung am Deutschen Zentrum für Luft- und Raumfahrt (DLR) in Berlin habe ich nicht nur an der theoretischen und praktischen (Weiter-)Entwicklung von großmaßstäblichen Verkehrsnachfragemodellen gearbeitet, sondern habe daneben natürlich auch die daraus und auch aus anderen Projekten resultierenden Erkenntnisse (mit-)publiziert. Bei dieser Forschung habe ich hauptächlich mit R, Shiny, PostgreSQL/PostGIS, QGIS und vereinzelt ein paar Zeilen Python gearbeitet. Und ich liebe sie alle, wann immer ich mit ihnen arbeiten darf. Aber ich fand es zunehmend schwierig und anstrengend, Daten einfach, schnell, und trotzdem optisch ansprechend zu visualisieren. Natürlich lassen sich mit R und ggplot druckreife Plots erstellen, und Shiny und Leaflet erlauben die Generierung von interaktiven Grafiken und Karten. Aber manchmal ist es einfach nicht zielführend, sich mit den Feinheiten der jeweiligen Einstellungen und dem Schreiben des notwendigen Codes zu beschäftigen. Ich empfand es insbesondere in der höchst spannenden Phase der explorativen Datenanalyse (quasi dem ersten Date mit neuen Daten im Rahmen des Analyseprozesses…) als sehr störend, dass ich mich so viel mit Code und anderen technischen Aspekten beschäftigen musste, was mich von der eigentlichen Arbeit mit den Daten abgelenkt hat, nämlich dem Verstehen der Daten. Um nochmals die Dating-Analogie zu bemühen wäre das so, als würde man sich mehr damit beschäftigen, was man zum Essen bestellt oder worüber der nächste Small-Talk gehen soll, als sich mit dem (Gesprächs-)Partner zu beschäftigen und sich nur auf ihn/sie zu fokussieren. Wahrlich kein Erfolgsrezept… Continue reading →