prateekagr21 / Flight-booking-time-series-analysis

Predicting the curve using FbProphet for Time Series Analysis of Flight booking data.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Flight-booking-time-series-analysis!!

Time Series analysis of Air passangers using FbProphet

Prophet is a forecasting procedure implemented in R and Python. It is fast and provides completely automated forecasts that can be tuned by hand by data scientists and analysts.

plane1

As air travel is considered a relevant area of action to mitigate climate change, it is important to know its determinants.
The present study examines socio-demographic, spatial and attitudinal predictors of air travel for private purposes.

The analyses are based on the Swiss Environmental Survey 2007 and a subsequent computation of the respondents' environmental impact, as well as spatial data.

A lognormal hurdle model indicates that persons with higher environmental concern are less likely to travel by air and if they still do, they travel less. While political orientations do not affect whether a person travels by air, the results indicate that among those who do fly, respondents voting for the Green Party cause lower emissions than those opting for other left or center parties.

Furthermore, higher incomes are associated with more air travel whereas living with children is associated with less air travel.

Airport access is related to air travel in the sense that living closer to airports, in particular to large ones, is correlated to more air travel. The result is robust to alterations of the accessibility measure and also upholds when population density is controlled for.

plane2

For Solving this Usecase, What I have done is :

  • Collected the data and organized it to form a meaningful dataset.
  • Checked for null values and took care of it.
  • Observed the data to form meaningful insights!

  • Did Exploratory Data Analysis on the dataset.
  • Used correlations to form a heatmap.
  • Visualizations were made by using Matplotlib and Seaborn Libraries..!!

Did Data Pre-Processing :

To fit and transform Numerical and Categorical Column values.

  • FbProphet's visualizations were used to make graphs and intutive visuals

And then I made my model for the Prediction :

  • Imported FbProphet.
  • Fitted the model.

And then, Created and added 365 days to the data df !

Trained my Model using :

plane3

FbProphet

  • Fitted the model.
  • predicted the test scores and checked the same.
  • Plotted the prediction.

Also, plotted the projections of yearly trend.

Did Cross Validation

Measuring the Forecast Error by Comparing the Predicted values with Actual values!

Plotted the Performance matrix of the following :

  • Mean Squared Error(MSE)
  • Root Mean Squared Error(RMSE)
  • Mean Absolute Error(MAE)
  • Mean Absolute Percentage Error(MAPE)
  • coverage = yhat_upper - yhat_lower

plane4

And for the conclusion -

From the above trained Model, It can be seen that the FbProphet model performed better and with help of that, we are able to figure out a pattern in the Time Series projection.


The prediction we see through the graph are quite natural, what can i say, using this tool for time series analysis was a fair choice after all !


About

Predicting the curve using FbProphet for Time Series Analysis of Flight booking data.


Languages

Language:Jupyter Notebook 100.0%