Shapefiles in R

I’ve posted before on this and I clearly didn’t know what I was doing. I still don’t really know what I’m doing but I now have some pretty pictures and that’s all anybody really wants. In this post I’m going to import a postcode shapefile from the OS, plot the postcodes in R, find the neighbours of each postcode and convert the data into a network graph. Github repository here.

Read More

Simple machine learning in R - Caret

In the last two posts I created some simple decision trees and tested their accuracy. Now it’s time to try some other models. As before I’m going to continue predicting the variable FiveHundredPlus with a limited set of factors to keep the processing pressures down. Once I’m a bit more confident I’ll move to the larger dataset and a more powerful machine. I’m going to use the package caret and recreate this post from Analytics Vidhya.

Full code saved on my github page here.

Read More

Simple machine learning in R - Decision Trees

Now that the land registry data has been imported and had some initial exploratory work done to it lets have a go at making a price prediction model. I’ll use a small subset of the data and initially only try to predict whether or not the house is worth more or less than £500k, rather than the more complicated process of predicting the price. The code used in this post is largely based upon the DataCamp course “Introduction to Machine Learning”. Code for this project is on my GitHub page here. This post focuses on decision trees using the package rpart. Read More