Last call for the course on Advanced R programming

Last call for the course on Advanced R programming scheduled in Leuven, Belgium on Febuary 20-21 2018. Register at: You’ll learn during that course: The apply family of functions, basic parallel programming for these functions and commonly needed data manipulation skills Making a basic reproducible report using Sweave and knitr including tables, graphs and literate programming How to create an R package Understand how S3 programming works, generics, environments, namespaces. Basic tips on how to organise and develop R code and test it. Need other training: visit
Original Post: Last call for the course on Advanced R programming

Where do you run to? Map your Strava activities on static and Leaflet maps.

So, Strava’s heatmap made quite a stir the last few weeks. I decided to give it a try myself. I wanted to create some kind of “personal heatmap” of my runs, using Strava’s API. Also, combining the data with Leaflet maps allows us to make use of the beautiful map tiles supported by Leaflet and to zoom and move the maps around – with the runs on it, of course. So, let’s get started. First, you will need an access token for Strava’s API. I found all the necessary information for this in this helpful “Getting started” post. As soon as you have the token, you have access to your own data. Now, let’s load some packages and define functions for getting and handling the data. For the get.activities() function, I adapted code from here. library(httr)library(rjson)library(OpenStreetMap)library(leaflet)library(scales)library(dplyr)token <- “” <- function…
Original Post: Where do you run to? Map your Strava activities on static and Leaflet maps.

Fair communication requires mutual consent

I was pleased to read Shirish Agarwal’s blog in reply to the blog I posted last week Do the little things matter? Given the militaristic theme used in my own post, I was also somewhat amused to see news this week of the Strava app leaking locations and layouts of secret US military facilities like Area 51. What a way to mark International Data Privacy Day. Maybe rather than inadvertently misleading people to wonder if I was suggesting that Gmail users don’t make their beds, I should have emphasized that Admiral McRaven’s boot camp regime for Navy SEALS needs to incorporate some of my suggestions about data privacy? A highlight of Agarwal’s blog is his comment I usually wait for a day or more when I feel myself getting inflamed/heated and I wish this had occurred in some of the…
Original Post: Fair communication requires mutual consent

Create your Machine Learning library from scratch with R ! (1/3)

When dealing with Machine Learning problems in R, most of the time you rely on already existing libraries. This fastens the analysis process, but do you really understand what is behind the algorithms? Could you implement a logistic regression from scratch with R?The goal of this post is to create our own basic machine learning library from scratch with R. We will only use the linear algebra tools available in R. There will be three posts: Linear and logistic regression (this one) PCA and k-nearest neighbors classifiers and regressors Tree-based methods and SVM Linear Regression (Least-Square) The goal of liner regression is to estimate a continuous variable given a matrix of observations . Before dealing with the code, we need to derive the solution of the linear regression. Solution derivation of linear regression Given a matrix of observations and the…
Original Post: Create your Machine Learning library from scratch with R ! (1/3)

Deep Learning from first principles in Python, R and Octave – Part 3

“Once upon a time, I, Chuang Tzu, dreamt I was a butterfly, fluttering hither and thither, to all intents and purposes a butterfly. I was conscious only of following my fancies as a butterfly, and was unconscious of my individuality as a man. Suddenly, I awoke, and there I lay, myself again. Now I do not know whether I was then a man dreaming I was a butterfly, or whether I am now a butterfly dreaming that I am a man.”from The Brain: The Story of you – David Eagleman “Thought is a great big vector of neural activity”Prof Geoffrey Hinton This is the third part in my series on Deep Learning from first principles in Python, R and Octave. In the first part Deep Learning from first principles in Python, R and Octave-Part 1, I implemented logistic regression as a…
Original Post: Deep Learning from first principles in Python, R and Octave – Part 3

A smooth transition between chloropleth and cartogram

[…] Related offers daily e-mail updates about R news and tutorials on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more… If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook…
Original Post: A smooth transition between chloropleth and cartogram

Hardwired..for tidy text

Song lyric and sentiment analysis for all So – a while back I did a tidy text analysis on Faith No More lyrics. I had thought about doing this with Metallica album lyrics, as they have had a long career, spanning thier late teens/twenties to their 50’s. However, I found the process of obtaining lyrics and getting them into shape for analysis too painful, so I chose a band with slightly less output. Good news though – things have changed with the release of the geniusr package from Josiah Parry (@JosiahParry). This makes getting song /album lyrics a piece of cake. With my FNM analysis, I obtained individual tracks, organised them into folders by album, and then went through a lot of manual processing ( the site I obtained the lyrics from concatenated each line into a single string). This…
Original Post: Hardwired..for tidy text

JAX 2018 talk announcement: Deep Learning – a Primer

I am happy to announce that on Tuesday, April 24th 2018 Uwe Friedrichsen and I will give a talk about Deep Learning – a Primer at the JAX conference in Mainz, Germany. Deep Learning is one of the “hot” topics in the AI area – a lot of hype, a lot of inflated expectation, but also quite some impressive success stories. As some AI experts already predict that Deep Learning will become “Software 2.0”, it might be a good time to have a closer look at the topic. In this session I will try to give a comprehensive overview of Deep Learning. We will start with a bit of history and some theoretical foundations that we will use to create a little Deep Learning taxonomy. Then we will have a look at current and upcoming application areas: Where can we…
Original Post: JAX 2018 talk announcement: Deep Learning – a Primer

Scraping Wikipedia Tables from Lists for Visualisation

Get WikiTables from Lists Recently I was asked to submit a short take-home challenge and I thought what better excuse for writing a quick blog post! It was on short notice so initially I stayed within the confines of my comfort zone and went for something safe and bland. However, I alleviated that rather fast; I guess you want to stand out a bit in a competitive setting. Note that it was a visualisation task, so the data scraping was just a necessary evil. On that note. I resorted to using Wikipedia as I was asked to visualise change in a certain x going back about 500 hundred years. Not many academic datasets go that far, so Wiki will have to do for our purposes. And once you are there, why only visualise half a millennium, let’s go from 1…
Original Post: Scraping Wikipedia Tables from Lists for Visualisation

PK/PD reserving models

My updated model is not much different to the one presented in the earlier post, apart from the fact that I allow for the correlation between (RLR) and (RRF) and the mean function (tilde{f}) is the integral of the ODEs above.[begin{aligned}y(t) & sim mathcal{N}(tilde{f}(t, Pi, beta_{er}, k_p, RLR_{[i]}, RRF_{[i]}), sigma_{y[delta]}^2) \begin{pmatrix} RLR_{[i]} RRF_{[i]}end{pmatrix} & simmathcal{N} left(begin{pmatrix}mu_{RLR} \mu_{RRF}end{pmatrix},begin{pmatrix}sigma_{RLR}^2 & rho sigma_{RLR} sigma_{RRF}\rho sigma_{RLR} sigma_{RRF} & sigma_{RRF}^2end{pmatrix}right)end{aligned}] Implementation with brms Let’s load the data back into R’s memory: library(data.table) lossData0 <- fread(“”) Jake shows in the appendices of his paper how to implement this model in R with the nlmeODE (Tornoe (2012)) package, together with more flexible models in OpenBUGS (Lunn et al. (2000)). However, I will continue with brms and Stan. Using the ODEs with brms requires a little extra coding, as I have to provide the integration…
Original Post: PK/PD reserving models