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.


Friday, April 13, 2018

Video Game Review: XBLAZE Lost : Memories

After a month or so of playing XBLAZE Lost: Memories, I finished the game on my PlayStation Vita this morning while waiting for service to be completed on my car. I mostly finished the game last night on the flight from San Francisco to Salt Lake City but had to watch the credits and final scene after the credits.

This is really the first time I have ever played a Japanese visual novel and I have to say it was kind of strange. It felt like I played 3 different games all nested within each other. The first game consisted of a well-drawn story where you mostly just watched events unfold between a group of teenagers that also fought magical bad guys. Then you had another story of two sisters in a completely different universe trying to unlock the secrets of their mother's death and father's experiments. Once again, you mostly just watch the events unfold similarly to a movie. Then the third game is a clunky 8-bit graphics treasure hunt with quizzes that sort of ties everything together.

While the game kept me entertained over the past month or so of flights, I can't say that I really enjoyed it. At least not to the extent that I have enjoyed some of the Telltale games where it feels like you have more control over the choices you can make. Towards the finale of XBLAZE, you do have to make a number of choices, some of which take you down a dead-end and you have to go back and redo them in order to finish. The fact that it came at the conclusion of the game confused me and I almost stopped playing the game prematurely. The thing that kept me going was knowing I only had two more trophies in order to Platinum the game and it would be a shame to get that close and not complete it.

In addition to the trophies, I continued playing the game because the dialog is entirely in Japanese with English subtitles. I spend a lot of time in Japan and am always trying to improve my language skills. By the end of the game I had a better comprehension of a handful of more Japanese phrases. I wouldn't recommend this as the only tool for learning the language as you won't pick up much unless you have a foundation to build upon.

XBLAZE Lost: Memories has an ESRB rating of M for Maturity because of Violence, Language, and Brief Nudity. The brief nudity isn't anything beyond well-drawn cartoon characters in skimpy swimsuits but I wouldn't recommend this game for anyone under the age of 18. It is available for the PS Vita, PS3, and Windows PC platform. I got the game in a bundle of PS Vita games I purchased for $5 and so I didn't pay much for it.

Unless you love Japanese visual novels or are looking to brush up on your Japanese language skills, I would not buy the game. If someone gives you a copy of the game and you are interested in a cultural lesson then go ahead and play it. Hopefully this has been helpful.

Thursday, April 5, 2018

Research on a New Computer

A friend has asked me to work with him on a new project. This will be outside my normal work and is something completely different from what I do at my regular job. Therefore I don't want to use my work computer for the project as that is not fair to my current employer. This new project needs to run on an iPhone and so I need to invest in a Mac as that is the best place to develop iOS applications. Yes, I know you can develop on Windows, but I have another personal project where I would like to use a Mac and so buying one solves two problems for me.

My natural tendency is to go out and get the best computer on the market. Fortunately I realize that I really don't need that much processing power. Remember that this is a side project and isn't my full-time job. If it was, then I would have no problem spending the extra money.

Today I went through Apple's website and compared the iMac and Mac mini. My second project requires a 4K monitor and so I don't want a laptop. While I could add a 2nd monitor, that just adds to the cost of the machine and I am trying to spend as little money as possible. So I ran through the website and configured 2 comparable machines in each style of computer. I erroneously assumed that the Mac mini would come in at a less expensive price. That is true, but once I add a 4K monitor, even with a highly discounted one, it is about $200 than the iMac. Furthermore, the iMac has a slightly faster processor and I can get it with twice as much memory than the max configuration for Mac mini. For the record, both computers come in at under $2,000 with 16MB of memory, 1TB disk drives, and Intel i7 processors running at or above 3GHz.

I have to say that I am surprised as I expected the Mac mini to be the less expensive choice. There are a number of other things on the project to research before I purchase the computer and so pricing may change in the near future. Apple has a tendency to announce more hardware choices towards the summer and that may influence prices a bit. If that happens, then I will adjust accordingly.