Tableau Conference TC17 Sneak Peek: Integrating Julia for Advanced Analytics

Demo: using Julia within calculations in Tableau (click to enlarge)
Demo: using Julia calculations within Tableau (click to enlarge)

We have already seen some love from Tableau for R and Python, boosting Tableau’s Advanced Analytics capabilities.

So what is the next big thing for our Data Science Rockstars? Julia!

Who is Julia?

JuliaJulia logo 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:

Will there be an online tutorial?

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.

Further reading: Mastering Julia

A German translation of this post is published on the official Tableau blog: Tableau Conference On Tour Sneak Peek: Julia-Integration für Advanced Analytics

Update 11 Oct 2017: The Julia+Tableau tutorial blog post is now published.

Take the Survey: The Stage of Digital Transformation

This survey is part of my thesis that examines the topology, structure, and evolution of the digital transformation within organizations. Your contribution to this survey helps to better understand the perception regarding the current stage of digital transformation.

Follow this link to take the survey:
https://goo.gl/forms/Yi2OUYaQfIBP9t3x2

Spread the word and share this article! Thanks!

Digitale Banken: Die Chancen von Blockchain, Künstlicher Intelligenz und Machine Learning

Commerzbank Tower
Commerzbank Tower: Zahlt sich für Banken die Kooperation mit Fintechs aus? (Foto: Flickr)

Die Zukunft im Finanzwesen bleibt vielversprechend und spannend. Haben uns kürzlich noch Innovationen in der Erschließung neuer Märkte und in der Vermögensverwaltung beschäftigt, so sind es heute mehr denn je die raffinierten datengetriebenen Technologien, die in den Vordergrund gerückt sind.

Anfang dieses Jahres startete Futura Analytics, ein Fintech, das enorme Datenmengen und maschinelle Lernmodelle nutzt, um Regeln zur Risikobewertung in Echtzeit umzuschreiben. Futura Analytics verwandelt Daten aus Twitter und anderen öffentlichen Quellen in nutzbare Signale und identifiziert die relevantesten Informationen in Echtzeit für Kunden im Finanzsektor (Beispiel: Bitcoin/Sentiment-Analyse).

Künstliche Intelligenz ist Teil der Zukunft

Banken und Fintechs nutzen die künstliche Intelligenz und die immer besser werdende Verarbeitung von natürlicher Sprache, um Kunden einen besseren Zugang zu Finanzdienstleistungen zu ermöglichen. Produktempfehlungen basierend auf Mustererkennung hilft die passende Dienstleistung anzubieten. Natürliche Sprache wird zu einer Vereinfachung von Zahlungsinteraktionen führen.

M2M-Lösungen rationalisieren Cloud-basierte Authentifizierung

Zwillingstürme der Deutschen Bank
Deutsche Bank (Foto: Flickr)

Allerdings müssen Zahlungsinteraktionen direkt von Gerät zu Gerät immer noch Barrieren überwinden, wie z.B. das Gewährleisten einer nahtlose Authentifizierung zwischen den Endgeräten. Bis solche M2M-Lösungen (Machine-to-Machine) mit nahtloser Authentifizierung herstellerübergreifend verfügbar ist, werden sich Geräte weiterhin über Services in der Cloud authentifizieren, bevor Transaktionen ausgeführt werden.

Gamification schafft Anreize für mobile Bezahlung

Mobiles Bezahlen am Point-of-Sale haben sich noch immer nicht flächendeckend durchgesetzt. Obwohl Unternehmen in Zahlungsterminals bereitstellen, fehlt es an Anreizen, um die Nutzer dazu zu ermutigen, mit ihren mobilen Geräten zu bezahlen. Banken haben schon damit begonnen die kostenlose Bargeldversorgung einzuschränken. Fintechs können dem Handel mit Gamification helfen das mobile Zahlen für Kunden attraktiver machen.

Blockchain ermöglicht kostengünstige Transaktionsüberprüfung

Die Rolle der Blockchain-Technologie bei der Bereitstellung einer verteilten Transaktionshistorie weckt großes Interesse im Zahlungs- und Handelsökosystem. Die Technologie macht Transaktionsgebühren, die Anbieter wie PayPal für das Sicherstellen von Transaktionen erhoben haben, hinfällig. Die Nutzung der Blockchain zur kostengünstigen Überprüfung von Transaktionen wird bei Banken oben auf der Agenda stehen.

Maschinelles Lernen verbessert die Zahlungssicherheit

Durch die Digitalisierung von Zahlungen muss die Zahlungssicherheit über eine breite Palette an Endgeräten gewährleistet werden. Geräte können ein erhöhtes Risiko gegenüber fortgeschrittenen Angriffen aufweisen. Bei der Gestaltung von sicheren Zahlungsmethoden erkennt maschinelles Lernen das Verhalten und greift ein, wenn ein solches Verhalten auf ungewöhnliche Verhaltensweisen oder Transaktionsaktivitäten hindeutet.

Price and Sentiment Analysis: Why is Bitcoin Going Down?

Bitcoin Price and Sentiment Analysis with variable Moving Average: click to open interactive Tableau dashboard with annotations
Bitcoin Price and Sentiment Analysis with variable Moving Average: click to open interactive Tableau dashboard with annotations

Bitcoin has become one of the trendy investment assets in the recent years. Whenever bitcoin prices approach historical highs, every investor should watch the currency closely. Bitcoin rallied by more than 20% in the first days of 2017, crossing the $1000 mark for the first time since November 2013.

As many experienced bitcoin traders will remember, the first $1000 peak was a case of obvious over exuberance. Bitcoin was hot, plenty of money was pouring into it. Bitcoin investors got too excited, causing a price surge. Prices then rebounded and suffered a long-term collapse shortly after.

Moving Average Convergence/Divergence Indicator

Many traders rely on a Moving Average Convergence/Divergence (MACD) indicator. The MACD is a measure of the convergence and divergence between two EMAs (usually 12 and 26 days) and is calculated by subtracting the two of them. The signal line is constructed by creating an EMA (usually 10 days) of the signal line.

The signal line crossing the MACD from above is a buy signal. The signal line crossing the MACD from below is a sell signal. Relying only on momentum-based indicators (such as the MACD) and optimization-based models, however, will most certainly fail to indicate heavy price drops, as the drop in late 2016.

Predicting Fear with Sentiment Analysis

In late 2016 a lot of people began to pour money into bitcoin again. This time because they were worried that stock markets and other assets were due for a drop. For investors, it is essential to figure out whether or not these fears are actually founded. However, such „safe assets“ are prone to suffering from bubbles. People get scared, get invested into gold, or bitcoin, then realize that their fears were unfounded. As a result bitcoin prices could plummet.

So how to catch emotions such as fear in advance? Twitter is a valuable source of information and emotion. It certainly influences the stock market and can help to predict the market. Sentiment analysis can lead price movements by up to two days. Negative sentiment, however, is reflected in the market much more than positive sentiment. This is probably because most people tweet positive things about bitcoins most of the time. Even more positive news occurred after breaking the $1000 barrier.

This content is part of the session “Price and Sentiment Analysis: Why is Bitcoin Going Down?” that I deliver at the Frankfurt Bitcoin Colloquium. Have a look on my upcoming sessions!

[Update 14 Jun 2017]: Axis for Moving Average adjusted. Relative Date selector added with last 6 month as default. Screenshot updated.

Feel free to share the Bitcoin Price and Sentiment Analysis dashboard, which is also featured as Viz of the Day on Tableau Public:

TabPy Tutorial: How to Integrate Python with Tableau for Advanced Analytics

Python in Tableau: TabPy allows Tableau to execute Python code on the fly
Python in Tableau: TabPy allows Tableau to execute Python code on the fly

In 2013, Tableau introduced 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 in Tableau: The Perfect Blend

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 are 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.

Step by Step: Integrating Python in Tableau

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.

TabPy download via GitHub web page

Protip: If you are familiar with Git, you can download TabPy directly from the repository:

> git clone git://github.com/tableau/TabPy

TabPy download via Git command line interface

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 (and later versions), a connection to TabPy can be added in Help > Settings and Performance > Manage External Service Connection:

Tableau main menu
Tableau main menu

Set port to 9004:

External Service Connection dialogue
External Service Connection dialogue

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:

SCRIPT_REAL('
import numpy as np
return np.corrcoef(_arg1,_arg2)[0,1]
',
SUM([Sales]), SUM([Profit]))
Python script within Tableau
Python script within Tableau

4. Use Calculated Field in Tableau

Now you can use your Python calculation as Calculated Field in your Tableau worksheet:

Tableau workbook featuring a Python calculation
Tableau workbook featuring a Python calculation

Feel free to download the Tableau Packaged Workbook (twbx) here.

Further Reading: Visual Analytics with Tableau

Join the data science conversation and follow me on Twitter and LinkedIn for more tips, tricks, and tutorials on Python in Tableau and other data analytics topics. If you’re looking to master Tableau, don’t forget to preorder your copy of my upcoming book, Visual Analytics with Tableau (Amazon). It offers an in-depth exploration of data visualization techniques and best practices.

Also, feel free to comment and share my TabPy Tutorial tweet:

Blog post updates: