You are on page 1of 4

As domestic air travel is getting more and more popular these days in India with various air ticket

booking channels coming up online, travellers are trying to understand how these airline companies
make decisions regarding ticket prices over time. Nowadays, airline corporations are using complex
strategies and methods to assign airfare prices in a dynamic fashion. These strategies are taking into
consideration several financial, marketing, commercial and social factors are closely connected with
the ultimate airfare prices. Due to the high complexity of the pricing models applied by the airlines, it
is very difficult for a customer to purchase an air ticket at the lowest price, since the price changes
dynamically. For this reason, several techniques ready to provide the proper time to the customer to
buy an air ticket by predicting the airfare price, are proposed recently. The majority of those methods
are making use of sophisticated prediction models from the computational intelligence research field
known as Machine Learning (ML). In this machine learning in python project there is only one
module namely, User. User can login with valid credentials in order to access the web application. A
traveller can access this module to get the future price prediction of individual airlines. The
prediction will help a traveller to decide a specific airline as per his/her budget. Single entries of
current or previous data can be made. This training set is used to train the algorithm for accurate
predictions.

Advantages

 Traveler get the fare prediction handy using which it’s easy to decide the airlines.

 Saves time in searching / deciding for airlines.

Disadvantages

LSTM (Long short term Memory ) is a type of RNN(Recurrent neural network), which is a famous
deep learning algorithm that is well suited for making predictions and classification with a flavour of
the time. In this article, we will derive the algorithm backpropagation through time and find the
gradient value for all the weights at a particular timestamp. 
As the name suggests backpropagation through time is similar to backpropagation in DNN(deep
neural network) but due to the dependency of time in RNN and LSTM, we will have to apply the
chain rule with time dependency. 
Let the input at time t in the LSTM cell be x t, the cell state from time t-1 and t be ct-1  and ct and the
output for time t-1 and t be ht-1 and ht . The initial value of ct and ht at t = 0 will be zero. 

Step 1 : Initialization of the weights . 

Weights for different gates are :

Input gate : wxi, wxg, bi, whj, wg , bg

Forget gate : wxf, bf, whf

Output gate : wxo, bo, who

Step 2 : Passing through different gates . 

Inputs: xt and ht-i , ct-1 are given to the LSTM cell

Passing through input gate:

Zg = wxg *x + whg * ht-1 + bg

g = tanh(Zg)

Zj = wxi * x + whi * ht-1 + bi

i = sigmoid(Zi)
Input_gate_out = g*i

Passing through forget gate:

Zf = wxf * x + whf *ht-1 + bf

f = sigmoid(Zf)

Forget_gate_out = f

Passing through the output gate:

Zo = wxo*x + who * ht-1 + bo

o = sigmoid(zO)

Out_gate_out = o

Step 3 : Calculating the output ht and current cell state ct. 

Calculating the current cell state ct :

ct = (ct-1 * forget_gate_out) + input_gate_out

Calculating the output gate ht:

ht=out_gate_out * tanh(ct)

Step 4 : Calculating the gradient through back propagation through time at time stamp t using the
chain rule. 

You might also like