The Wayback Machine - https://web.archive.org/web/20240927020724/https://www.geeksforgeeks.org/markov-decision-process/
Open In App

Markov Decision Process

Last Updated : 05 Jul, 2024
Summarize
Comments
Improve
Suggest changes
Like Article
Like
Save
Share
Report
News Follow

Reinforcement Learning:

Reinforcement Learning is a type of Machine Learning. It allows machines and software agents to automatically determine the ideal behavior within a specific context, in order to maximize its performance. Simple reward feedback is required for the agent to learn its behavior; this is known as the reinforcement signal. 

There are many different algorithms that tackle this issue. As a matter of fact, Reinforcement Learning is defined by a specific type of problem and all its solutions are classed as Reinforcement Learning algorithms. In the problem, an agent is supposed to decide the best action to select based on his current state. When this step is repeated, the problem is known as a Markov Decision Process. 

A Markov Decision Process (MDP) model contains: 
 

  • A set of possible world states S.
  • A set of Models.
  • A set of possible actions A.
  • A real-valued reward function R(s,a).
  • A policy is a solution to Markov Decision Process.
     

What is a State?

A State is a set of tokens that represent every state that the agent can be in. 

What is a Model?

A Model (sometimes called Transition Model) gives an action’s effect in a state. In particular, T(S, a, S’) defines a transition T where being in state S and taking an action ‘a’ takes us to state S’ (S and S’ may be the same). For stochastic actions (noisy, non-deterministic) we also define a probability P(S’|S,a) which represents the probability of reaching a state S’ if action ‘a’ is taken in state S. Note Markov property states that the effects of an action taken in a state depend only on that state and not on the prior history. 

What are Actions?

Action A is a set of all possible actions. A(s) defines the set of actions that can be taken being in state S. 

What is a Reward?

A Reward is a real-valued reward function. R(s) indicates the reward for simply being in the state S. R(S,a) indicates the reward for being in a state S and taking an action ‘a’. R(S,a,S’) indicates the reward for being in a state S, taking an action ‘a’ and ending up in a state S’. 

What is a Policy?

A Policy is a solution to the Markov Decision Process. A policy is a mapping from S to a. It indicates the action ‘a’ to be taken while in state S. 
Let us take the example of a grid world: 

 

An agent lives in the grid. The above example is a 3*4 grid. The grid has a START state(grid no 1,1). The purpose of the agent is to wander around the grid to finally reach the Blue Diamond (grid no 4,3). Under all circumstances, the agent should avoid the Fire grid (orange color, grid no 4,2). Also, the grid no 2,2 is a blocked grid, it acts as a wall hence the agent cannot enter it. 

The agent can take any one of these actions: UP, DOWN, LEFT, RIGHT 

Walls block the agent’s path, i.e., if there is a wall in the direction the agent would have taken, the agent stays in the same place. So for example, if the agent says LEFT in the START grid he would stay put in the START grid. 

First Aim: To find the shortest sequence getting from START to the Diamond. Two such sequences can be found: 

  • RIGHT RIGHT UP UPRIGHT
  • UP UP RIGHT RIGHT RIGHT

Let us take the second one (UP UP RIGHT RIGHT RIGHT) for the subsequent discussion. 
The move is now noisy. 80% of the time the intended action works correctly. 20% of the time the action agent takes causes it to move at right angles. For example, if the agent says UP the probability of going UP is 0.8 whereas the probability of going LEFT is 0.1, and the probability of going RIGHT is 0.1 (since LEFT and RIGHT are right angles to UP). 

The agent receives rewards for each time step:- 

  • Small reward for each step (can be negative when can also be term as punishment, in the above example entering the Fire can have a reward of -1).
  • Big rewards come at the end (good or bad).
  • The goal is to Maximize the sum of rewards.

Previous Article
Next Article

Similar Reads

What is Markov Decision Process (MDP) and Its relevance to Reinforcement Learning
In artificial intelligence and machine learning, Reinforcement Learning (RL) stands out as a powerful technique for training agents to make sequential decisions. At the heart of RL lies the concept of the Markov Decision Process (MDP). Understanding MDPs is crucial for comprehending how RL algorithms work and why they are effective. This article de
5 min read
How to Extract the Decision Rules from scikit-learn Decision-tree?
You might have already learned how to build a Decision-Tree Classifier, but might be wondering how the scikit-learn actually does that. So, in this article, we will cover this in a step-by-step manner. You can run the code in sequence, for better understanding. Decision-Tree uses tree-splitting criteria for splitting the nodes into sub-nodes until
4 min read
Markov Chain
Markov chains, named after Andrey Markov, a stochastic model that depicts a sequence of possible events where predictions or probabilities for the next state are based solely on its previous event state, not the states before. In simple words, the probability that n+1th steps will be x depends only on the nth steps not the complete sequence of step
6 min read
Markov Chains in NLP
Markov chain is a mathematical model that is utilized to simulate random processes occurring over a duration of time. It consists of a set of states and the transitions between them. These transitions are probabilistic, which implies that the possibility of moving from one state to another solely depends on the current state and not on any past eve
12 min read
Hidden Markov Model in Machine learning
A statistical model called a Hidden Markov Model (HMM) is used to describe systems with changing unobservable states over time. It is predicated on the idea that there is an underlying process with concealed states, each of which has a known result. Probabilities for switching between concealed states and emitting observable symbols are defined by
11 min read
Hidden Markov Models with Scikit-Learn
Hidden Markov Models (HMMs) are statistical models that represent systems that transition between a series of states over time. They are specially used in various fields such as speech recognition, finance, and bioinformatics for tasks that include sequential data. Here, we will explore the Hidden Markov Models and how to implement them using the S
6 min read
Hidden Markov Model in R
Hidden Markov Models (HMMs) are statistical models used to represent systems that transition between hidden states over time, with each state producing observable outputs. HMMs are widely used in various applications such as speech recognition, bioinformatics, and finance. In this article, we'll explore the theory behind Hidden Markov Models and de
4 min read
CatBoost Decision Trees and Boosting Process
CatBoost is a powerful open-source machine-learning library specifically designed to handle categorical features and boost decision trees. Developed by Yandex, CatBoost stands out for its ability to efficiently work with categorical variables without the need for extensive pre-processing. This algorithm has gained popularity due to its robustness,
12 min read
Decision Threshold In Machine Learning
What is Decision Threshold ? sklearn does not let us set the decision threshold directly, but it gives us the access to decision scores ( Decision function o/p ) that is used to make the prediction. We can select the best score from decision function output and set it as Decision Threshold value and consider all those Decision score values which ar
4 min read
Python | Decision Tree Regression using sklearn
Decision Tree is a decision-making tool that uses a flowchart-like tree structure or is a model of decisions and all of their possible results, including outcomes, input costs, and utility.Decision-tree algorithm falls under the category of supervised learning algorithms. It works for both continuous as well as categorical output variables. The bra
4 min read
ML | Logistic Regression v/s Decision Tree Classification
Logistic Regression and Decision Tree classification are two of the most popular and basic classification algorithms being used today. None of the algorithms is better than the other and one's superior performance is often credited to the nature of the data being worked upon. We can compare the two algorithms on different categories - CriteriaLogis
2 min read
Difference between Management Information System (MIS) and Decision Support System (DSS)
Decision Support System (DSS) is an interactive, flexible computer based information system or sub-system intended to help decision makers use communication technologies, data, documents to identify and solve problems, complete decision process tasks and make decision. Management Information System (MIS) consists of following three pillars: Managem
2 min read
Decision Tree in R Programming
Decision Trees are useful supervised Machine learning algorithms that have the ability to perform both regression and classification tasks. It is characterized by nodes and branches, where the tests on each attribute are represented at the nodes, the outcome of this procedure is represented at the branches and the class labels are represented at th
8 min read
Weighted Product Method - Multi Criteria Decision Making
Weighted Product Method is a multi-criterion decision-making method in which there will be multiple alternatives and we have to determine the best alternative based on multiple criteria. There are other methods available including the Weighted Sum Method (WSM), Technique for Order of Preference by Similarity to Ideal Solution (TOPSIS), VIKOR, MOORA
4 min read
Proof that Path Selection Decision problem is NP-Complete
Prerequisite – NP-Completeness The decision problem of path selection problem asks if it is possible to select at least k paths from the given paths of a graph such that no two selected paths share any vertex. To prove that a problem is NP-Complete, we need to show that it is both NP and NP-Hard. We use PSP to denote our path selection decision pro
5 min read
Decision Tree Classifiers in R Programming
Classification is the task in which objects of several categories are categorized into their respective classes using the properties of classes. A classification model is typically used to, Predict the class label for a new unlabeled data objectProvide a descriptive model explaining what features characterize objects in each class There are various
4 min read
Importance of decision making
When we talk about decision making, so you actually don't realize that you are making decisions every day in your day to day life. Right from waking up and leaving at the back of the comfortable mattress in the morning till we retire for the day, the selections we make are what hold us thriving. It is estimated that a common human makes around 35,
4 min read
ML - Decision Function
Decision function is a method present in classifier{ SVC, Logistic Regression } class of sklearn machine learning framework. This method basically returns a Numpy array, In which each element represents whether a predicted sample for x_test by the classifier lies to the right or left side of the Hyperplane and also how far from the HyperPlane. It a
4 min read
Optimal Decision Making in Games
Humans' intellectual capacities have been engaged by games for as long as civilization has existed, sometimes to an alarming degree. Games are an intriguing subject for AI researchers because of their abstract character. A game's state is simple to depict, and actors are usually limited to a small number of actions with predetermined results. Physi
7 min read
Optimal Decision Making in Multiplayer Games
The optimal solution becomes a contingent strategy when specifies MAX(the player on our side)’s move in the initial state, then Max move to the states resulting for every possible response by MIN. Then MAX’s moves in the states resulting from every possible response by MIN to those moves, and so on. From the current state, the minimax method in the
5 min read
Improving Business Decision-Making using Time Series
Time series analysis is mainly used to explain, describe, and predict changes via the time of chosen variables. Many companies use time series forecasting, and analysis to develop business strategies. These techniques help businesses in measuring, tracking, defining, and predicting business trends. Time series analysis provides you with an opportun
6 min read
Analyzing Decision Tree and K-means Clustering using Iris dataset
Iris Dataset is one of best know datasets in pattern recognition literature. This dataset contains 3 classes of 50 instances each, where each class refers to a type of iris plant. One class is linearly separable from the other 2 the latter are NOT linearly separable from each other. Attribute Information:Sepal Length in cmSepal Width in cmPetal Len
5 min read
C5.0 Algorithm of Decision Tree
The C5 algorithm, created by J. Ross Quinlan, is a development of the ID3 decision tree method. By recursively dividing the data according to information gain—a measurement of the entropy reduction achieved by splitting on a certain attribute—it constructs decision trees. For classification problems, the C5.0 method is a decision tree algorithm. It
12 min read
Decision Boundary of Label Propagation Vs SVM on the Iris Dataset
In machine learning, understanding decision boundaries is crucial for classification tasks. The decision boundary separates different classes in a dataset. Here, we'll explore and compare decision boundaries generated by two popular classification algorithms - Label Propagation and Support Vector Machines (SVM) - using the famous Iris dataset in Py
9 min read
Pros and Cons of Decision Tree Regression in Machine Learning
Decision tree regression is a widely used algorithm in machine learning for predictive modeling tasks. It is a powerful tool that can handle both classification and regression problems, making it versatile for various applications. However, like any other algorithm, decision tree regression has its strengths and weaknesses. In this article, we'll e
5 min read
Difference Between Random Forest and Decision Tree
Choosing the appropriate model is crucial when it comes to machine learning. A model that functions properly with one kind of dataset might not function well with another. Both Random Forest and Decision Tree are strong algorithms for applications involving regression and classification. The aim of the article is to cover the distinction between de
3 min read
Solving the Multicollinearity Problem with Decision Tree
Multicollinearity is a common issue in data science, affecting various types of models, including decision trees. This article explores what multicollinearity is, why it's problematic for decision trees, and how to address it. Table of Content Multicollinearity in Decision TreesDetecting Multicollinearity Stepwise Guide of how Decision Trees Handle
6 min read
Passing categorical data to Sklearn Decision Tree
Theoretically, decision trees are capable of handling numerical as well as categorical data, but, while implementing, we need to prepare the data for classification. There are two methods to handle the categorical data before training: one-hot encoding and label encoding. In this article, we understand how each method helps in converting categorica
5 min read
Ensemble Learning with SVM and Decision Trees
Ensemble learning is a machine learning technique that combines multiple individual models to improve predictive performance. Two popular algorithms used in ensemble learning are Support Vector Machines (SVMs) and Decision Trees. What is Ensemble Learning?By merging many models (also referred to as "base learners" or "weak learners"), ensemble lear
5 min read
Feature selection using Decision Tree
Feature selection using decision trees involves identifying the most important features in a dataset based on their contribution to the decision tree's performance. The article aims to explore feature selection using decision trees and how decision trees evaluate feature importance. What is feature selection?Feature selection involves choosing a su
5 min read
Practice Tags :