Posts by Louis Keating
Can Machine Learning win the Melbourne Cup?
noah-silliman-fxAo3DiMICI-unsplash.jpg

Whilst building the Melbourne Cup game, we had the chance to assess the variables and build some models to see if we could use our analytical skills to help predict the winner.

Firstly, our game showed as an important truth….predicting the winner is tough! So we settled on modelling a place (1st, 2nd or 3rd).

Important note - We do not encourage gambling and by no means do we believe that this is a robust solution otherwise we would quit our jobs and do this for a living!

What did we learn?

Melb_cup_chaid.JPG

Chaid is a great way of visualising the modelling process through decisions. The nodes help you decide which way to go by showing you the predictive result (the middle decimal) and the percentage of the file this represents (the bottom %).

So firstly, at the top, we see that Price is a key variable, odds/price under $23 is ideal.

Then a crossroads. Do we use the Breeding Sire and Dam options that lead to the bright green in the bottom right or do we use colour to find the green bottom middle node? Both also use horse country (origin) and both have a decent outcome, although bottom right is better.

Either way, we now have some ideas of what is going to be predictive.

For the purposes of our scoring exercise, we used the bottom right node.

Model_importance.JPG

Next we tested a Logistic regression model and a Random Forest. Both showed Price as a significant and crucial variable.

Once our training and testing was complete, we need to score the runners!

 
 

To simplify things, we have ranked the outputs for each horse to gauge a consensus across the models.

Keeping in mind that we’re predicting a place (1st, 2nd or 3rd), Cross Counter feels like the strongest choice.

Melb_cup_predictions.JPG

An important question you should always ask is “how good are these models?”

The answer: The accuracy isn’t great. They suffer from a lack of data. The ideal situation would be using the longer trend race history, for every runner. Maybe next year.

This exercise is purely for fun (we do find this kind of data analysis fun) but keen to see how the models do.

Now we wait and see what happens at 3pm today….


Post 3pm update


So the runners have run and the champagne has been sunk. How did we do?

Melb Cup 2019 results.JPG

If you look down the final column, very near the bottom, you’ll see Vow And Declare, the winner of this years 2019 Melbourne Cup. Not one of our predictions…

However, if you remember from the start of the article, we were looking for a “place” and our intuition told us to ring fence the top 5 predictions for an each-way bet.

So Prince of Arran came to our rescue with a second place.

Our conclusion: Don’t gamble kids, even if you’re a data scientist.

Commentary, EventsLouis Keating
Melbourne Cup Challenge
 

For this years Melbourne Cup, we’ve pulled together the last 20 years of runners and winners and created a game to test your gambling strategy. Most people choose by name or jersey colour, so time to find out how good that method is! Odds are, the bookie will come out on top…

If you have issues viewing on a mobile, click here but we suggest you use a laptop for the best experience.

 
VisualiseLouis Keating
Time-series modelling
Does one trend of sales predict another and if so, which way around and by how much?

This was the problem posed by one of our clients.

 
 

No matter what type of data project you work on, there are some fundamental steps:

  • Firstly, understanding the data available e.g. missing values, low volumes and outliers

  • We addressed missing values like so:

 

Trend with missing data points:

Trend with missing points addressed:

Missing values.JPG
 

We also wanted to remove the major spikes, as we’re more interested in the overall trend. Normalisation helps with this:

 

 

For this project, we used 2 years of data to compare trends (from a total of 5+ years)

  • We created artificial “lags” between the trends so that we could compare different time frames

  • We used polynomial models, which created smoother output trends for comparison

 

Polynomial trend for vehicle sales:

Polynomial trend for property sales

Polynomial_X.jpg
 
 

And we used linear regression models to understand the overall trends e.g. what is the overall direction, going up, down or remaining constant?

 

 

There are many methods for assessing time-series trends.

  • We are looked at the “dissimilarity measure” i.e. how similar/dissimilar are the trends?

 

Some similarities but not the same:

Very similar trends:

Polynomial trends - not the same.JPG
 

Do they increase and decrease at the same time?

Polynomial X rise & fall.JPG
 

 

Once we found our methodology, we then set about creating an automated procedure to process the tens of thousands of cases.

We could then derive the best look-a-like models with confidence indicators for further analysis.

 

Business use.JPG

From here, we then had the job of understanding what the different trends meant in real life terms.

  • Heat maps are great for finding interesting clusters of similar patterns.

  • The models can now be used to make predictions to test in real life.

 

To learn more about this project and others like it, start up a conversation with us.

157 Years of Melbourne Cup Winners
 
 

We all love a good day at the races. But do you think some punters are better at picking the winners than others, or is it all luck? Below we’ve created a visualisation of the winners of the Melbourne Cup over the past 157 years. Can you spot any trends to pick the likely winner next November?

 

If viewing on a mobile device, use this link to view.

 
 
VisualiseLouis Keating
5 lessons from 5 years
 

An article by the White Box founder, Louis Keating

 
 

5 years ago I decided to leave the safe world of salaried employment, structured working hours and guaranteed Friday afternoon drinks. I started up my own business. This had been a dream of mine for at least a decade but as with most things like this, there was always something that stopped me doing it. 

Over the last 5 years, I’ve worked with a wide range of companies and people, who I would have never met if I had stayed on my safe journey. The experience of running a business, the mistakes you make, the lessons learnt are invaluable. Of course, it is a hard journey that I do question more often than I should. So if you’re considering the change, then I hope this article will help, or at least provide some stepping stones for when you do.

1) Think bigger than just ‘you’ 

  • Set financial targets and act like a bigger business

  • This doesn’t mean pretending you have 100 employees and making up titles for them all in your creds and website.

  • It does mean that you need to think bigger than your last role, where you were part of a team, part of the machine that functions as a whole. Yes, there was a reason why you moved away in the first place to become independent but you now have to wear more hats and think with more depth about what you’re delivering for clients.

  • Whatever your skillset is, you’re essentially a consultant now, an expert in your field, but, with experience to know how your part integrates with the rest of the solution and business. Your client will expect this of you.

  • Thinking big also means you need to have a strategy for your business, where it is going, and what you want it to become. I like the organic growth and seeing where opportunities arise from, but every year I still set financial and non-financial targets and goals that I assess.

  • Keep track of your own and employee hours (yes, timesheets) even if you charge at a project level. It’s very easy to spend more time on a project than you wanted to.

I track performance against target and last year:

2) Patience is key

  • The idea of becoming independent fills you with joy as you imagine a lazy Monday morning where everyone else is rushing off to work in the cold (I do enjoy that) and you can slowly get up and after making coffee and breakfast, you then start your day! Hurrah…. or not.

  • You’re either straight into a contract and working exactly the same as before or you’re now trying to figure out how to find work and increasingly panicking about the decreasing bank balance.

  • A key takeaway is that clients will always need time. Just because you’ve had a conversation and the client is desperate to get going, chances are that the project won’t kick off for a few months as other priorities will come up. It’s therefore essential to keep a pipeline of work, even when you’re super busy. Have those conversations and coffee catch ups and keep the plates spinning.

  • Organisation is crucial here. Get a system for prioritising work, replies and meetings. Missing something here is bad news.

  • When you start off, think shoestring budget for your lifestyle. I look back on those days very fondly; I had a few sporadic days of contract work, so spent my free time not spending any money, just surfing and reading by the beach.

3) Enjoy downtime

  • A friend recently made this comment about his own time after having a baby. How to enjoy that time between when she wakes up rather than just waiting?

  • After 5 years, I still don’t believe I’ve cracked this but there are a few tricks. Firstly, see point one. If you’ve set financial goals then you’ll know how you’re tracking and how much backup you have before you need to pull the ripcord (get “proper” job aka back into salaried employment).

  • Secondly, have a list of personal work projects for learning and development. You can then schedule your day into new business development, personal work projects and then non-work related tasks e.g. chores. Then you can also schedule fun into this. One of the main reasons for becoming independent is to have more flexible working. I originally wanted to work less for the same money. My goals have changed but I do try to fit in fun activities to my week and these will only continue to be fun if they’re guilt-free.

I keep track of annual revenue growth:

4) Enjoy your working days

  • Work with people you like. You may not get to do this straight away but it should be a goal. Spending time with people that you respect and enjoy the company of will improve your life quality dramatically. If the current contract involves going to work with people you don’t like, then that doesn’t mean you have to quit but you can learn from it and say no next time or change how you work with them.

  • Employ good staff. It sounds like a no brainer but when you own your own company, it can be tempting to employ the cheapest staff and generate a larger profit. However, this will end up with you doing more of the work or unhappy clients. Unhappy clients rarely come back.

  • Working in an office environment really helps. Remote work is great and can be a healthy part of your routine but an office creates focus and buzz

    • Working on the beach in the sunshine sounds like the dream, but in reality, it isn’t possible. Glare, noise and uncomfortable after a while.

  • Do figure out how you can utilise your new freedom though. I found that if I had a problem to solve, I could go for a walk past Shelley beach (in my Manly days), which would clear my head, distract me enough to break to loop and I usually found the solution. That, or I came back with a coffee and then got on with it.

  • Finally, find out if you’re as good as you believe you are. I’ve been terrible at doing this as I jump from one project to the next, hardly taking time to celebrate the wins. Get feedback / reviews / survey monkeys after each engagement.

Understand natural peaks and troughs:

5) Know when to grow

  • If you’re overstretched, then you either need to say no or you need to employ people.

  • I can remember at least three times when my grey quiff turned a shade whiter and I thought the end was nigh. I said yes to too many things with the belief that evenings and weekends are totally fine to play catch up. Burn out creeps up far too easily. I’ve heard many other consultants talk about this as well.

  • Unless you’re an accountant, then use accounting software and a bookkeeper. I still spend far too much time with my “CFO” hat on.

  • However, don’t ignore the numbers (especially if you want to be my friend). Keeping track of how your company is doing, understanding downtimes, profit margins on projects are all crucial to feeling confident about how your business is performing.

  • The accounting software should be able to do this but I like creating my own. What a surprise eh?

Look for stability through growth and employees / contractors

 
 
 

Final words

This is a very exciting time to be involved in the data space as every company needs to focus on their data strategy. There are fascinating areas like AI and Machine Learning that are beginning to take hold in everyday life.

I’m confident that the data analysis industry will grow and complement the necessity of automation. Over the next 5 to 10 years we will see some exciting changes as we keep up with the extraordinary pace set by technology.

As for White Box, we’ll continue to grow and develop with our clients, learning new skills and innovating as we go.