How you can use a GraphQL API for database administration

A recent discussion at graphql-europe made me realize that GraphQL would make for an amazing API for database administration. You know that plethora of functions and options to control details from…

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




OYO Data Science

Forecasting of the #Users through different channels(Time Series)

Forecasting is a wide topic. It is a process of making predictions based on previous data. This was one of the projects I was working on my job as a member of Data Science.

Now the problem statement was predicting the number of users that are coming through SEO(Search Engine Optimization) and SEM (Search Engine Marketing) and also through the website(Mobile and Desktop)

So, I have datewise data of the users coming through SEO and SEM(after applying proper filters in my data). I have data with two columns -Date and Users.

Tips:

First I tried the ARIMA(‘Auto Regressive Integrated Moving Average’) model. It consists of two models of AR and MA . We have to select p,d and q values where

P- values to regress forward,

d- difference,

Q- lag we are taking for Moving Average.

Also, the stationarity of data has to be check where a series is said to be stationary if the mean, variance and covariance are constant over a period of time or time-invariant.

**Only works if the time-series are stationary.

There are few tests to check stationarity like — Rolling Statistics, ADCF test.

So I put my data in ARIMA Model and iterate for various (p,d,q) and the one which is giving the smallest AIC (Akaike Information Criteria).Minimum the AIC better the model.

###You can make the whole model but we get everything in a statsmodel library which makes it a few lines code.

Here X is my data with two columns

Data for forecasting

These are some libraries you need to import.

Checked for random p,d,q(0,1,0)

This is for the case if you want to check for some (p,d,q) value. Clearly, we can see that the predicted and test are not fitting good. We have to check for different p,d,q.

You can change the range and check for AIC values and choose your values and suitable p,d,q value will give you the required model.

Now the previous model had so many manual checks you have to do like stationarity and check for AIC Values. I have to manually check and see the fitting of model. I got to know about SARIMA(Seasonal ARIMA).

This is a model that will automatically check all the stuff and apply the appropriate ARIMA model considering the seasonality of the data. Like my data is of the users visiting, so it had seasonality of 7 days(On a particular day of the week it will reach maximum for that week).

Also in this model, you have to enter the min-max values of p, d, q, P, Q and it will automatically do the calculations. It is also called the Auto-ARIMA model.

There are lots of parameters, fill them by checking the documentation of each term. These are actually the different tests that it will do for checking stationarity and accuracy.

Well after applying these models still I was not satisfied, so I looked up for more forecasting methods. In these methods yesterday and 60 days old data is given equal importance for predicting but it might be there that previous days data is playing more role in predicting tomorrow users. There is also one thing the trend here is considered a regression model.

It was given by Peter Winter student of Holt.

The Forecast equation consists of the Level equation and the Trend equation . These equations also have damping parameters and there is an option for taking to be additive(seasonal variations are roughly constant through the series) or multiplicative(seasonal variations are changing proportionality to the level of the series).

The idea behind triple exponential smoothing(Holt’s Winter) is to apply exponential smoothing to the seasonal components in addition to level and trend.

You can easily apply it easily by statsmodel library

For Damped and Not Damped

It gives me result that was pretty good. It exponentially decreases the dependency as the data gets older for predicting that’s why it is also one of the exponential smoothening methods.

Red is test data and rest are predictions(see the fitting)

Forecasting is a vast topic and a lot of research is going on in this field. Lots of ‘Research and Ripping algorithms’ are there and also with the help of neural networks like RNN(Recurring Neural Networks), there are LTSM(Long Short Term Memory) networks that are more optimal.

Here is the link , it can also be applied through the library which they have provided.

Cheers,

Thanks for reading! Stay tuned for more as I continue on my path to becoming a data scientist! ✌️

Add a comment

Related posts:

7 Big Mistakes Guys Make When They Try to Be Dominant in Bed

That makes a lot of guys nervous because they’re not sure how to approach it. They have a vague idea of what it means to be dominant but they don’t know how to have sex in a way that makes her feel…

Those are the three factors

Critics anticipate board would be hard-pressed to acquisition a acumen as to why they shouldn't be covered.argued that boodle boxes already accommodated the analogue of bank in every accompaniment in…

15 Fun and Creative Ways to Make Money With Handwriting

Handwriting is a beautiful way to express yourself and have fun. If you're looking for a creative side hustle, here are 15 ways to make money with your handwriting.