Thursday, April 19, 2018

Machine Learning for Predictions

This past week I have been working on trying to predict the future based on historical data with the help of machine learning. This is one of those areas where you have to be careful because if it was easy then everyone would be doing it to cash in on the stock market or for bets on who will win the next sporting event. However there are certain variables that can be used to increase the probability of an event happening. For instance, if you have clouds in the sky, there is more likely a chance of rain than on a sunny day. The trick is figuring out what those variables are and this is what is know as feature selection.

If you think about your favorite sporting event, think about all of the variables that go into a game. Who are the players and what are their various statistics? Does the weather impact those statistics or are the games played indoors? You can eventually see that complexity spirals out of control if you are trying to predict the winner of a game.

The problem I have been trying to solve is something akin to when someone will go out to dinner next based on historical information. An overly simplistic algorithm might look at the average time between restaurant visits. For someone that dines out on a regular basis, this will work. Someone else might only go out on special occasions and that won't work unless those special occasions are evenly distributed on the calendar. Think about variables that contribute to when you eat out. Some might include:
  • Day of the week - Perhaps you eat out only on Friday or Saturday evenings and never on Sunday.
  • Holidays - It is always more difficult to get a restaurant reservation on a holiday.
  • Proximity to Payday - While it is tough to generalize when everyone's payday is, if you have that information, it might be a factor in some people's choice to go out.
  • Weather - A snowstorm has the potential to greatly reduce people's desire to go out.
With a bit more time and thought, I'm sure you could come up with a number other factors that could be used to predict if you are eating out or at home. In machine learning terms, these variables are called features and can be used to accurately predict a person's behavior.

When I look at my own restaurant habits, I know that I generally eat at the airport on Thursday evenings as I catch a flight from San Francisco to Salt Lake. Unfortunately that won't be the case this evening as I decided to buy a big lunch and only eat half of it, saving the other half for this evening. Therefore it is important to remember that predictions are no guarantee that an event will happen.


No comments:

Post a Comment