These days, I have been reading and playing a lot with R, and I really come to love it…of course, I don’t have a clue on those weird statistics formulas, but it doesn’t mean I can’t use R and try do some awesome stuff with it.
So, yesterday I was thinking about doing another integration between HANA and R, my new adopted kids, so I came with the idea of building a prediction model for a flight company. I followed this steps.
1.- First, I need to choose a table, so I picked SNVOICE:
This table offers us, the carrier id, the date and book id, meaning the amount of tickets sold in a particular day. And from here when can do some calculation and determine how many tickets were sold in each month of a particular year.
2.- I needed a table to store my new information, so I created the table TICKETS_BY_YEAR:
3.- I needed a Procedure script to analyse the table, determine the total amount per day of the month and then gave a grand total per month.
4.- Of course…I needed to call my Procedure…
5.- Once finished, I checked my table to see if everything worked as expected…
6.- After realizing that my data was nice and clean, I exported to an .CSV file (Sorry…no pics this time…I already post it in a previous blog)
7.- I went to my R Studio and start coding…
8.- I watch my generated graphic showing the real tickets sale vs. the predicted tickets sale. The real is for every month of 2011 and the predicted for every month of 2012.
9.- Nothing to do here…it’s done -:)
10.- See you next time with more HANA, R or another nice technology.