Using artificial intelligence in Devops

Sumeet More
4 min readNov 22, 2020

--

Facilities and services in any wedding function is driven by no. of guests attending that particular wedding.Everything is arranged based of no. of folks attending that wedding. Same goes with software applications. Have you come across an experience where the site/app doesn’t load? "potential" reason for this unpleasant experience can be because of too much load on servers i.e good number of folks are trying to access the site/app but the server is falling short to serve which is a very similar experience when you expected 500 folks for an event and 1000 was the final count. Hence if we can predict load of software applications , we can provide better end user experience . but how can we predict? The answer is Artificial Intelligence(AI).

Let’s define our problem statement
For this article, let’s take an example of a banking domain and try to predict the load of the withdrawal service i.e we will build a machine learning model for a given date that can predict how many potential customers can use the withdrawal service. Using this prediction, we can setup servers accordingly.Now that servers are all set, we can provide end users a very smooth experience.

Before diving into solution, few merits of the solution
- Cost effectiveness
- Better devops operations
- Better resource utilization
- Better customer experience

Let’s visualise dataset( snippet)

Date column says which day it is and the count column says how many times that service is being used on that particular day . We created our own dataset but one can easily create such datasets for their services using logging tools. Apart from this, we can say that this problem is time series based and we have to forecast future values. So if we need to know what will be the load/ no. of customers using this service for the next 7 days , the machine learning model can help us predict/forecast it.

We will be using LSTM(Long short-term memory) for this problem statement.

Let's visualise our entire dataset in terms of graph.

Dividing data into training and test set.

Implement core model using keras and use early stopping to avoid overfitting of the data.

Let’s visualise model losses

Careful reader might have a question here that forecasting models are little different as we don’t actually have future value to compare so how will we determine accuracy? yes you are correct. That’s why we divided training data into train and test and understood accuracy based on it. One can use metrics like RMSE(Root mean squared error).

Now let's look how model performed on test data

Blue line is actual data and orange data is predicted one. Seems like the model is doing a pretty decent job.

Now let us stitch predicted and learned output and see in a single frame

We can see the model learnt from blue colored data and predicted data is in orange color.

This way we can see model predicted count of customers which will use withdrawal service/load of withdrawal service for the next 60 days. Now the bank has some good idea on how many potential customers are going to use their withdrawal service, they can prepare better and give their customers a great experience.

Hope you guys enjoyed reading this one. Any feedback you guys have or anything we can improve , do drop them in the comment section.

For this article , I collaborated with a very good friend of mine - Rohan Ghodke.

--

--

Sumeet More
Sumeet More

Written by Sumeet More

Software Engineer 2 at Microsoft | Backend Engineer and Architect| Blockchain & ML enthusiast | C#,.NET Core, Rust, Javascript and Go

No responses yet