Originally from KDnuggets https://ift.tt/2BrzImz
Introduction to Optimization and Gradient Descent Algorithm [Part-1].

Optimizers lies at the heart of machine learning.
Gradient descent is one of the most popular algorithms to perform optimization and by far the most common way to optimize neural networks. At the same time, every state-of-the-art Deep Learning library contains implementations of various algorithms to optimize gradient descent. These algorithms, however, are often used as black-box optimizers.

By the end of this blog post, you’ll have a comprehensive understanding of how gradient descent works at its core. We will intuitively by the means of gradient descent accomplish a task of rod balancing problem on our finger. I know, this might sound super obvious and simple but trust me, implementing gradient descent would be a piece of a cake once you understand the underlying concept.
Before that let us get familiar with what do we mean by optimization. Optimization is the act of making the best or most effective use of a situation or resource. In the real world, while running a business or solving any particular problem we are limited with the available resources to work on, that is where the true nature of optimizer comes. Everyone wants to solve a problem in such a manner that the outcome of the solution should be the best of all other possible solutions. For every optimization problem, the goal is provided beforehand either it can be to maximize(increase) or minimize(decrease) something. For example, choosing the optimal location for the warehouse to minimize shipment time, designing a bridge that can carry a maximum load possible for a given cost, designing an airplane wing to minimize weight while maintaining strength, designing load balancer to minimize the server load during heavy traffic, etc.
Since every concept comes with its underlying components, optimizers aren’t exceptional, here are some of them.

Components of Optimizer:
- Objective function: The value you are trying to optimize.
- Decision Variables: The values optimizer are allowed to tune.
- Constraints: The boundaries that optimizer cannot cross or the conditions which are supposed to meet for any solution.
- Gradients: The slope of the Objective function on inputs and Decision variables. (will discuss this later in detail).
From the above examples shipment time, load that bridge can carry, the weight of the airplane wing, load on servers are the Objective functions whereas the location of the warehouse, the structure of the bridge, shape of the wing, number of threads allotted to a server are Decision variables. And given the cost for bridge construction, maintaining the strength of an airplane, etc. are the Constraints.

Note: the decision variables used in optimizing can be continuous, discrete, or binary. But we avoid discrete variables as it results in discrete gradients, more difficult to optimize.
Back to our balancing rod problem, if we break down this into components we would get,
Objective function: maximize the time it stays on the finger.
Decision Variable: the point at which we try to balance the rod. We’ll denote it as ‘x’.
Now we can state this problem as,

where,
f(x): balance the rod at x point and return the time(in seconds) it stayed on a finger.
When we consider the Objective function, always there will be some kind of curve with varying slope at a different value(s) of Decision variable(s). The goal of the optimizer is to converge to the bottom of the curve for a minimization problem OR to climb to the top of the curve for a maximization problem. When the optimizer reaches their desired goal, the value(s) of decision variable(s) at this point is considered as optimal value(s) for the given Machine learning model for further predictions.

In reality, we don’t know what the curve is, for our balancing problem we as a human being with our intellectual we can easily plot the curve(concave in our case) and select optimal value but as the number of decision variables increases curve becomes more complex and there human fails to derive solution and for machine simply the curve doesn’t exist until it starts exploring.
Top 4 Most Popular Ai Articles:
3. Real vs Fake Tweet Detection using a BERT Transformer Model in few lines of code
Types of Optimizers:
- Gradient Free Algorithms.
- Gradient Based Algorithms.
Gradient Free Algorithms don’t require to compute gradients, they are much more dependent on randomness, mutation, and fitness or scoring functions in nature, hence they are slower than gradient-based algorithms. The Decision Variables in these algorithms can be discrete, discontinuous, or noisy. Here is the list of gradient-free algorithms:
- Exhaustive Search
- Genetic Algorithm
- Particle Swarm
- Simulated Annealing
(we’ll not discuss Gradient free algorithms as it is somewhat out of context for this blog post, would recommend going ahead and explore as they’re quite interesting, most of reinforcement learning methods are based on these algorithms.)
If we try to solve our balancing rod problem using ‘Exhaustive search(or Exhaustive exploration)’ which is nothing but trying all possible solutions and pick the best one at the end of the experiment.
Solving Rod Balancing problem using Exhaustive Search
Here in the above video, we try almost all possible points (x) on the rod and plot the time on the y-axis for each test/point on the rod. Eventually, over time we select the best point on the rod for maximum balance time.

In the image above Fig.(A) shows the initial state when we aren’t aware of the curve, Fig.(B) shows some progression and we start to realize how the curve looks like, After testing enough we get the complete curve which is shown by Fig.(C), at this point we select the point on x-axis i.e., the point at which we should balance the rod for maximum success.
Exhaustive Search does provide the solution but it takes a long time to optimize. In Machine Learning the amount of time required to train a model is a critical factor. If the model is not properly designed it may take months to converge, on the other side if the right selection of the algorithm is made, resulting in faster training.
Now that we know why we shouldn’t always go for this brute-force approach, we can try other Gradient-free methods for our problem but it will be overkill. In part-2 of this series, we’ll talk about Gradient-based Algorithm, also we will solve Rod Balancing problem using Gradient descent method. here is the link of the second part.
Introduction to Optimization and Gradient Descent Algorithm [Part-2].
Do leave a clap if you like this post, see you in part-2. cheers!!
Don’t forget to give us your ? !



Introduction to Optimization and Gradient Descent Algorithm [Part-1]. was originally published in Becoming Human: Artificial Intelligence Magazine on Medium, where people are continuing the conversation by highlighting and responding to this story.
How to Test any Deep Learning models on your Data without pain
Learn how to test a lot of models and architecture on your Data without headache
Continue reading on Becoming Human: Artificial Intelligence Magazine »
The Acclimation and Legality of Superior Machines
We live in a world where we are constantly in contact with Artificial Intelligence, perhaps without even being aware.
Continue reading on Becoming Human: Artificial Intelligence Magazine »
What is emotion AI and why should you care?
Originally from KDnuggets https://ift.tt/2BmCmtU
modelStudio and The Grammar of Interactive Explanatory Model Analysis
Originally from KDnuggets https://ift.tt/37MGQq2
What Is an ARIMA Model?

In our previous tutorial, we became familiar with the ARMA model.
But did you know that we can expand the ARMA model to handle non-stationary data?
Well, that’s exactly what we’re going to cover in this post – the intuition behind the ARIMA model, the notation that goes with it, and how it differs from the ARMA model.
Let’s get started, shall we?
What is an ARIMA model?
As usual, we’ll start with the notation. An ARIMA model has three orders – p, d, and q (ARIMA(p,d,q)). The “p” and “q” represent the autoregressive (AR) and moving average (MA) lags just like with the ARMA models. The “d” order is the integration order. It represents the number of times we need to integrate the time series to ensure stationarity, but more on that in just a bit.
Convention dictates that we always enter the three orders in the same way – “p” first, then “d” and finally – “q” (ARIMA(p,d,q)). Of course, that’s because “p” represents the AR components, “d” the Integrated ones and “q” the MA ones.
How is ARIMA related to ARMA?
Any model of the sort ARIMA (p, 0, q) is equivalent to an ARMA (p, q) model since we are not including any degree of changes. Of course, an ARIMA (0, 0, q) and an ARIMA (p, 0, 0) would also be the same as an MA(q) and an AR(p) respectively.
Now that we’re familiar with the notation and how the different types of models are connected, we can continue with the intuition.
How do ARIMA models work?
These integrated models account for the non-seasonal difference between periods to establish stationarity.
Hence, even the AR components in the model should be price differences, (ΔP) rather than prices (P). In a sense, we are “integrating” “d”-many times to construct a new time-series and then fitting said series into an ARMA (p, q) model.
What does a simple ARIMA (1,1,1) look like?
Okay, since now we know this, let’s have a look at the equation of a simple ARIMA model, with all orders equal to 1. Suppose P is the price variable we’re trying to model. Then, the simple ARIMA equation for P would look as follows:
ΔPt =c+ϕ1 ΔPt-1 + θ1 ϵt-1 +ϵt
Just like we did in the other tutorials on time series models, let’s go over all the moving parts of this equation and break it down, so we can understand it better.
For starters, Pt and Pt-1 represent the values in the current period and 1 period ago respectively.
Similarly, ϵ t and ϵ t-1 are the error terms for the same two periods. And, of course, c is just a baseline constant factor. The two parameters, ϕ 1 and θ1, express what parts of the value (Pt-1) and error (ϵ t-1) last period are relevant in estimating the current one.
Finally, we have ΔPt-1 . In math, physics, and science in general, we express the difference between two values as Δ (delta). Therefore, ΔPt-1 is the difference between prices in period “t” and prices in the preceding period (ΔPt = Pt-1-Pt). Therefore, ΔP is an entire time-series, which represents the disparity between prices of consecutive periods.
Here’s an easy way to think about ARIMA models.
Essentially, the entire ARIMA model is nothing more than an ARMA model for a newly generated time-series, which is stationary.
How do we determine the orders of an ARIMA model?
We saw that the ARMA doesn’t have any functions like the ACF or PACF which suggest what the optimal order for the different components is. We can say the same about the ARIMA. After all, it’s a more complex model based on ARMA. So, our best bet is to start simple, check if integrating once grants stationarity. If so, we can fit a simple ARIMA model and examine the ACF of the residual values to get a better feel about what orders to use.
Peculiarities of integrated models
It’s important to note that we lose d-many observations when we deal with integrated values. This comes from the fact that there is no “previous” period, where we wish to integrate the very first day of the dataset. Simply put, we can’t find the difference between the first element and the one preceding it, because it doesn’t exist.
Similarly, if we integrate two times, we lose two observations, one for each integration. Even though we’d have an integrated difference in prices for the second day of the dataset (ΔP2 = P 1 – P2), wouldn’t have one for the first (ΔP 1= P0– P1), to compare it with. Therefore, we’d also have a missing value for the second day of the time-series, after integrating twice (Δ2P2= ΔP1– ΔP2).
Simply put, for any integration we lose a single observation, so we should be aware of this when making our analysis. This is important because having empty values prevents the certain Python functions from compiling.
If you want to learn more about implementing ARIMA models in Python, or how the model selection process works, make sure to check out our step-by-step Python tutorials.
If you’re new to Python, and you’re enthusiastic to learn more, this super comprehensive article on learning Python programming will guide you all the way from the installation, through Python IDEs, Libraries, and frameworks, to the best Python career paths and job outlook.
Ready to take the next step towards a career in data science?
Check out the complete Data Science Program today. Start with the fundamentals with our Statistics, Maths, and Excel courses. Build up a step-by-step experience with SQL, Python, R, Power BI, and Tableau. And upgrade your skillset with Machine Learning, Deep Learning, Credit Risk Modeling, Time Series Analysis, and Customer Analytics in Python. Still not sure you want to turn your interest in data science into a career? You can explore the curriculum or sign up for 15 hours of beginner to advanced video content for free by clicking on the button below.
The post What Is an ARIMA Model? appeared first on 365 Data Science.
from 365 Data Science https://ift.tt/3hGa9Pr
AI and Machine Learning facilitate peoples lives in terms of many aspects

AI and machine learning are very much present in these days and they are facilitating human lives in a lot of ways, whether you may realize it or not.

In the tech domain, there is a huge buzz going around the future abilities of AI and machine learning in terms of how they’ll be impacting our lives. These include high-end things like instant machine translation, self-driving cars, just to name a few.
However, AI and machine learning are very much present in these days and they are facilitating human lives in a lot of ways, whether you may realize it or not.
In this post, we are going to take a closer look at how these technologies have already started impacting the life of the average people.
But before delving deeper, let’s have a quick look at what are AI and machine learning basically.
1- AI and machine learning — What they are
Fundamentally, AI or artificial intelligence refers to the intelligence demonstrated by the machines.
And ML or machine learning is a way using which professionals achieve AI.
Machine learning can be considered as the ability of machines to learn utilizing statistical techniques without being programmed explicitly.
10 Powerful Examples Of AI Applications
2- Ways AI and machine learning are facilitating average people’s lives
The concepts of AI and machine learning aren’t completely foreign to us as they have been heavily explored by popular media. There are lots of movies which have shown us a world where AI-enabled robots and machines hold the dominating power. And these have triggered, to a good extent, lots of negative impressions about AI and machine learning among the average people.
Top 4 Most Popular Ai Articles:
3. Real vs Fake Tweet Detection using a BERT Transformer Model in few lines of code
However, despite how negatively movies demonstrate the power of AI and machine learning, these technologies are truly transforming average human lives into better ones. Let’s explore the most common aspects that are being impacted by AI and machine learning.
2.1- Banking and financial services
It’s hardly possible to count the number of people that have bank accounts. In addition, just consider the number of their associated facilities like credit cards which are in circulation. Now imagine how many hours human employees of these institutions would have to invest to sift through the transactions that are performed every day? And how much time and effort it would take to identify an anomaly? With the help of AI and machine learning, a huge number of banks and financial institutions have become able to review the quality of various applications and to analyze and predict risks, in an effort to make informed decisions.
The so-called traditional industry is implementing AI and machine learning to increase user engagement. High-end technologies like predictive analysis, chatbots, voice recognition etc are helping minimize the gap between potential customers and financial institutions. These days, it’s possible for any customer to contact any of these establishments anytime and from anywhere and receive real-time replies.
2.2- Healthcare services
Both AI and machine learning have already acquired a significant part in our well-being and health. From being utilized for faster patient diagnosis to the prevention of illnesses — these technologies are being used on a regular basis by lots of healthcare service providers.
These days, it’s possible to predict the potential health hazards a person may be susceptible to, depending on his/her genetic history, socio-economic status, age etc — which was simply unimaginable before the emergence of AI and machine learning.
With the help of AI and machine learning-powered programs, healthcare service providers can cross-reference symptoms against databases that contain millions of cases of illnesses to expedite the process of diagnosing disease and illness, saving lives through faster and appropriate treatment. These technologies are also being adapted to expedite research works toward cures of different diseases.
2.3- Email
Almost every person uses email these days for a huge number of purposes. It may sound unlikely but your email inbox is a place where advanced technologies take place on a regular basis. There are two key aspects where email service providers use AI and machine learning. First comes the advanced spam filter. Unlike plain rule-based filters that aren’t much effective against spam as spammers can update their messages quickly to work around them, advanced spam filters continually learn from a wide range of signals like message metadata, words in the message etc to prevent spam.

Another aspect is smart email categorization. You’ve probably seen that Gmail uses an approach to categorize the emails into primary, promotion, social inboxes. This is made possible with the help of AI and machine learning together with manual intervention from users. When some messages are marked in a constant direction by a user, a real-time increment to that threshold is performed by Google in order to achieve appropriate categorization.
2 Immersive Topics: Data Science and Artificial Intelligence
2.4- Transportation industry
There’s a heavy influence of AI and machine learning on the present transportation industry can be found. These technologies have been instrumental in lowering threats triggered by reckless driving via the deployment of automation and sensory management. There are vehicles that can understand their surrounding parameters and thus, can take precautionary measures whenever needed to ensure passenger safety. Apart from vehicles, AI and machine learning technologies are to be deployed soon to prevent traffic congestion on roads and for traffic management.
2.5- Taking over tedious and hazardous jobs
AI and machine learning can seem to be a boon to humanity when we consider the fact that they liberate humans and enable them to focus on tasks in which they excel. These technologies take care of a wide range of tedious tasks that have to be performed in order to attain different results. Machines excel in performing cumbersome tasks, leaving enough time and room for humans to focus on more creative aspects of a business.
In the financial sector, for example, AI and machine learning help financial analysts to get some relief from the monotonous nature of their jobs and concentrate on deeper analysis and research of all-round customer experience.
In the context of hazardous jobs like bomb disposal, welding etc, AI and machine learning are helping the professionals to a great extent. These days, machines are taking over those jobs with the help of human intervention.
2.6- Social networking
Almost everyone has experienced it several times. When a user uploads pictures to Facebook, the faces get highlighted automatically and the service suggests friends to tag. If you wonder how it can find out which of your friends are in the picture, Facebook uses AI and machine learning techniques to recognize faces. It also uses these technologies to personalize their users’ newsfeed and ensure that they are viewing posts that interest them. Apart from Facebook, almost all other social networking platforms including Pinterest, Instagram, Snapchat etc leverage AI and machine learning to maximize user experience.
Invaluable Societal Benefits Of AI
2.7- Online shopping
Online shopping has become almost an inevitable part of life for today’s tech-savvy customers. Have you ever wondered how e-commerce websites quickly return with a collection of the most relevant items related to your search? AI and machine learning are technologies that make it possible. Personalized recommendations on their home page, product pages etc are also examples of their deployment.
Fraud protection is another aspect where these technologies perform a great job. Here, AI and machine learning are deployed to not only avert fraudulent transactions but to lower the number of legitimate transactions that are declined because of being falsely marked as fraudulent.
2.8- Home security and home automation
When it comes to home security, these days, a significant number of homeowners are deploying cutting-edge systems are deploying high-end cameras and security systems powered by AI and machine learning. These systems are capable of building a catalog of the frequent visitors of a home and thus, can detect uninvited guests instantly.
Smart homes also offer a multitude of different types of useful features such as providing notification when the kids come back from school etc.
When combined with appliances, AI and machine learning can make household management and housework seamless.
From allowing the refrigerator to communicate with the oven to replenishment of food and supplies — all have become possible.
Final Thoughts
From the above examples, it can be concluded that a significant number of things, which were simply unimaginable before the emergence of AI and machine learning, have become possible these days. However, similar to other technologies, AI and machine learning also come with a significant number of negative concerns. The biggest one of them is that these technologies will replace humans in performing several tasks, making people jobless eventually. However, if these technologies are looked upon as tools rather than replacements, businesses should be able to attain a huge industrial growth.
According to many experts, AI and machine learning have an opportunity to work together with humans. By nature, humans are good at raising the right questions while AI and machine learning are good at dealing with huge amounts of information. By working together they can leave a huge business impact. The future of these technologies isn’t exactly clear today, but they’ll surely have an impact on society as they are doing right now. We’ll have to wait to see whether that impact turns out to be positive or negative but it can be said that these technologies have a huge potential to make the lives of the people easier to a great extent.
Join our new Slack community: https://bit.ly/AI-ML-DataScience-Lovers-Slack-Channel
Don’t forget to give us your ? !



AI and Machine Learning facilitate people’s lives in terms of many aspects was originally published in Becoming Human: Artificial Intelligence Magazine on Medium, where people are continuing the conversation by highlighting and responding to this story.
AI that Can Do No Wrong
But will the human master allow AI to be programmed with strict and unwavering ethical decisions?
Continue reading on Becoming Human: Artificial Intelligence Magazine »
Via https://becominghuman.ai/ai-that-can-do-no-wrong-aaf2ded113d2?source=rss—-5e5bef33608a—4
source https://365datascience.weebly.com/the-best-data-science-blog-2020/ai-that-can-do-no-wrong
Future in Fintech in 2020: a revolution in financial sectors
The union of financial services and information technology, or for short Fintech, has been breaking the barrier between financial…
Continue reading on Becoming Human: Artificial Intelligence Magazine »




