Posts by Learning Machines
Author: Learning Machines
R Coding Challenge: How many Lockers are Open?
Feed: R-bloggers. Author: Learning Machines. The German news magazine DER SPIEGEL has a regular puzzle section in its online version, called “Rätsel der Woche” (“Riddle of the Week”). Some of those puzzles are quite interesting but I am often too lazy to solve them analytically. So I often kill two birds with one stone: having fun solving the puzzle with R and creating some new teaching material for my R classes! This is what we will do with one of those more interesting riddles, which is quite hard to solve analytically but relatively easy to solve with R, so read ... Read More
ELIZA Chatbot in R: Build Yourself a Shrink
Feed: R-bloggers. Author: Learning Machines. More and more companies use chatbots for engaging with their customers. Often the underlying technology is not too sophisticated, yet many people are stunned at how human-like those bots can appear. The earliest example of this was an early natural language processing (NLP) computer program called Eliza created 1966 at the MIT Artificial Intelligence Laboratory by Professor Joseph Weizenbaum. Eliza was supposed to simulate a psychotherapist and was mainly created as a method to show the superficiality of communication between man and machine. Weizenbaum was surprised by the number of individuals who attributed human-like feelings ... Read More
Create Return Triangle Plots with R
Feed: R-bloggers. Author: Learning Machines. How lucrative stocks are in the long run is not only dependent on the length of the investment period but even more on the actual date the investment starts and ends! Return Triangle Plots are a great way to visualize this phenomenon. If you want to learn more about them and how to create them with R read on! If you had invested in the Standard & Poors 500 index beginning of 2000 you would have had to wait 14 years until you were in the plus! The reason was, of course, the so-called dot-com ... Read More
Why Gradient Descent Works (and How To Animate 3D-Functions in R)
Feed: R-bloggers. Author: Learning Machines. The workhorse of Machine Learning is Gradient Descent. If you want to understand how and why it works and, along the way, want to learn how to plot and animate 3D-functions in R read on! Gradient Descent is a mathematical algorithm to optimize functions, i.e. finding their minima or maxima. In Machine Learning it is used to minimize the cost function of many learning algorithms, e.g. artificial neural networks a.k.a. deep learning. The cost function simply is the function that measures how good a set of predictions is compared to the actual values (e.g. in ... Read More
Learning R: Christmas Coding Challenge
Feed: R-bloggers. Author: Learning Machines. In this year’s end post I will give you a little programming challenge! Everybody knows the Christmas song “The Twelve Days of Christmas”! Your task is to write an R script that creates the lyrics! The lyrics are the following: On the first day of ChristmasMy true love gave to me:A partridge in a pear tree. On the second day of ChristmasMy true love gave to me:Two turtle doves andA partridge in a pear tree. On the third day of ChristmasMy true love gave to me:Three french hensTwo turtle doves andA partridge in a pear ... Read More
OneR in Medical Research: Finding Leading Symptoms, Main Predictors and Cut-Off Points
Feed: R-bloggers. Author: Learning Machines. We already had a lot of examples that make use of the OneR package (on CRAN), which can be found in the respective Category: OneR. Here we will give you some concrete examples in the area of research on Type 2 Diabetes Mellitus (DM) to show that the package is especially well suited in the field of medical research, so read on! One of the big advantages of the package is that the resulting models are often not only highly accurate but very easy to interpret: the predictors are ordered from best to worst (based ... Read More
Logistic Regression as the Smallest Possible Neural Network
Feed: R-bloggers. Author: Learning Machines. We already covered Neural Networks and Logistic Regression in this blog. If you want to gain an even deeper understanding of the fascinating connection between those two popular machine learning techniques read on! Let us recap what an artificial neuron looks like: Mathematically it is some kind of non-linear activation function of the scalar product of the input vector and the weight vector. One of the inputs the so-called bias (neuron), is fixed at 1. The activation function can e.g. be (and often is) the logistic function (which is an example of a sigmoid function): ... Read More
xkcd Comics as a Minimal Example for Calling APIs, Downloading Files and Displaying PNG Images with R
Feed: R-bloggers. Author: Learning Machines. xkcd webcomics is one of the institutions of the internet, especially for the nerd community. If you want to learn how to fetch JSON data from a REST API, download a file from the internet and display a PNG file in a ultra-simple example, read on! Many services on the internet provide a web service so that it is easier for machines to get access to their data. The access point is called an Application Programming Interface (API) and there are different types of APIs. One especially widespread type is known under the name REST ... Read More
How to Catch a Thief: Unmasking Madoff’s Ponzi Scheme with Benford’s Law
Feed: R-bloggers. Author: Learning Machines. One of my starting points into quantitive finance was Bernie Madoff’s fund. Back then because Bernie was in desperate need of money to keep his Ponzi scheme running there existed several so-called feeder funds. One of them happened to approach me to offer me a once in a lifetime investment opportunity. Or so it seemed. Now, there is this old saying that when something seems too good to be true it probably is. If you want to learn what Benford’s law is and how to apply it to uncover fraud, read on! Here are Bernie’s ... Read More
Create Bart Simpson Blackboard Memes with R
Feed: R-bloggers. Author: Learning Machines. Everybody knows the Simpsons, everybody loves the Simpsons and everybody can laugh about Bart Simpson writing funny lines on the blackboard! If you want to create your own Bart Simpson Blackboard Meme Generator with R read on! Conveniently enough there is a package for creating memes already (who would have thought otherwise, because there is a package for everything!), the meme package by my colleague Professor Guangchuang Yu from the University of Hong Kong. After installing it from CRAN we load it, assuming that you work on a Windows machine load the Comic Sans font ... Read More
Recent Comments