Implement the value iteration algorithm for mdp

Assignment Help Python Programming
Reference no: EM132109645

Question 1

A convicted criminal who reo ends after release is known as a recidivist. The table below lists a dataset describing prisoners released on parole, and whether they reo ended within two years of release.

This dataset list six instances where prisoners were granted parole. Each of these instances are described in terms of the three binary descriptive features (GOOD BEHAVIOUR, AGE < 30, DRUG DEPENDENT) and a binary target feature, RECIDIVIST. The GOOD BEHAVIOUR feature has a value of TRUE if prisoner had not committed any infringements during incarceration, the AGE < 30 has a value of TRUE if the prisoner is under 30 year sof age when granted parole, and the DRUG DEPENDENT feature is TRUE if the prisoner had a drug addiction at the time of parole. The target feature RECIDIVIST, has TRUE value if the prisoner was arrested within two years of being released; otherwise it has a value of FALSE.

a. Using this dataset, construct the decision tree that would be generated by the ID3 algo- rithm using entropy-based information gain.
b. What prediction will the decision tree generated in part (a) of this question return for the

Table 1: LIST OF PRISONERS RELEASED ON PAROLE following query?

ID

GOOD BEHAVIOUR

AGE < 30

DRUG DEPENDENT

RECIDIVIST

1

FALSE

TRUE

FALSE

TRUE

2

FALSE

FALSE

FALSE

FALSE

3

FALSE

TRUE

FALSE

TRUE

4

TRUE

FALSE

FALSE

FALSE

5

TRUE

FALSE

TRUE

TRUE

6

TRUE

FALSE

FALSE

FALSE

GOOD BEHAVIOUR = FALSE; AGE < 30 = FALSE; DRUG DEPENDENT = TRUE

c. What prediction will the decision tree generated in part (a) of this question return for the following query?

GOOD BEHAVIOUR = TRUE; AGE < 30 = TRUE; DRUG DEPENDENT = FALSE

Question 2

Implement the value iteration algorithm for MDP which computes the solution to the situation shown below in Figure 1. You have been given two sample Python codes from the book by Russell and Norvig (speci cally Chapter 17). Study these codes carefully and use them as basis for your solution. Your submitted code (presumably based on the code provided with this assignment) should not require any additional data les during run-time, and should not expect any user inputs. For each value of k, your program is to print (to the screen) the reward vector J . Your program is to terminate when convergence is observed (use epsilon=0.0001). For each time step k print the optimal policy. Use the discount factor λ = 0.9.

As an additional experiment make a change to the state diagram so that the action A in S1 have the probabilities swapped. Run your program again for this modi ed state diagram. Your name and student number should be in the comment header of the source code le.

What to submit and how.

1. A PDF le containing your solution to Question 1.

2. A text le named question2.ipynb containing your code. Ensure that the comment section or header contains your name and student number.

3. Create a Zip le that contains the two les named above. Name your Zip le as follows: student_name_student_number.zip.
For example: a_good_student_1234568.zip

4. Submit the Zip le in Assignment 2 DropBox in Moodle by the due date.

5. Any assignment submitted via e-mail will be IGNORED and deemed not to have been sub- mitted.

Attachment:- prob.rar

Verified Expert

This assignment is done for finding the queries related questions and also for developing the MDP algorithm using the python id there are codes available in the zip folder with the word file for question 1 and also pdf file for the same there are .ipynb code files and some supporting files are also there which are there for providing basic functionalities.

Reference no: EM132109645

Questions Cloud

Heating and cooling for dave accident : Discuss the possible liability of A1 Heating and Cooling for Dave’s accident.
What was the rate of inflation : Which two categories of goods or services had the greatest price increase for the month?
Efficacy of prevalent laws in ensuring confidentiality : Comment on the efficacy of prevalent laws in ensuring confidentiality of personal information.
Discuss about the affordable care act : Things are changing with the Affordable Care Act (ACA). Many, if not most of the class, work in environments that have been impacted by the ACA.
Implement the value iteration algorithm for mdp : CSCI424 - Reasoning and Learning - University of Wollongong - What prediction will the decision tree generated in part (a) of this question return
Discuss comments on indoor tanning- skin cancer : Some of the carcinogens that people are aware of and still expose themselves to include skin tan. Both indoor and out door tanning exposes individuals.
Economic growth-increased development of global trade flows : What are the essential factors for economic growth and increased development of global trade flows? Why are they so important in today’s global economy?
Review problem related to cancer : A major contributing factor to the incident and mortality rate is diet. According to the national cancer institute, one-third of cancer cases.
E-marketing media blended by competitors : How are traditional marketing and e-marketing media blended by competitors? Does the art support or interfere with the message?

Reviews

inf2109645

12/3/2018 2:35:20 AM

As an additional experiment make a change to the state diagram so that the action A in S1 have the probabilities swapped. Run your program again for this modi ed state diagram. Your name and student number should be in the comment header of the source code ) Plz highlight in question which data set you talking about. Got it , thanks for quick response.  Thanks mates, you are my charm, i will be back with few more assignments soon, please keep the expert free for me, he/she is really perfect for my kind of person who needs accurate work.

inf2109645

12/3/2018 2:33:18 AM

In zip folder two files already attached. There are two questions in assignment, for q1 there are given table , For q2 , there are two python code given to examine and figure 1 is in pdf file , question doesn't say any other files. Question says implement velue iteration algorithm which should he based on given two python files and state diagram given in pdf. (Implement the value iteration algorithm for MDP which computes the solution to the situation shown below in Figure 1. You have been given two sample Python codes from the book by Russell and Norvig (speci cally Chapter 17). Study these codes carefully and use them as basis for your solution. Your submitted code (presumably based on the code provided with this assignment) should not require any additional data les during run-time, and should not expect any user inputs. For each value of k, your program is to print (to the screen) the reward vector J. Your program is to terminate when convergence is observed (use epsilon=0.0001). For each time step k print the optimal policy. Use the discount factor ? =0.9.

Write a Review

Python Programming Questions & Answers

  Write a python program to implement the diff command

Without using the system() function to call any bash commands, write a python program that will implement a simple version of the diff command.

  Write a program for checking a circle

Write a program for checking a circle program must either print "is a circle: YES" or "is a circle: NO", appropriately.

  Prepare a python program

Prepare a Python program which evaluates how many stuck numbers there are in a range of integers. The range will be input as two command-line arguments.

  Python atm program to enter account number

Write a simple Python ATM program. Ask user to enter their account number, and print their initail balance. (Just make one up). Ask them if they wish to make deposit or withdrawal.

  Python function to calculate two roots

Write a Python function main() to calculate two roots. You must input a,b and c from keyboard, and then print two roots. Suppose the discriminant D= b2-4ac is positive.

  Design program that asks user to enter amount in python

IN Python Design a program that asks the user to enter the amount that he or she has budget in a month. A loop should then prompt the user to enter his or her expenses for the month.

  Write python program which imports three dictionaries

Write a Python program called hours.py which imports three dictionaries, and uses the data in them to calculate how many hours each person has spent in the lab.

  Write python program to create factors of numbers

Write down a python program which takes two numbers and creates the factors of both numbers and displays the greatest common factor.

  Email spam filter

Analyze the emails and predict whether the mail is a spam or not a spam - Create a training file and copy the text of several mails and spams in to it And create a test set identical to the training set but with different examples.

  Improve the readability and structural design of the code

Improve the readability and structural design of the code by improving the function names, variables, and loops, as well as whitespace. Move functions close to related functions or blocks of code related to your organised code.

  Create a simple and responsive gui

Please use primarily PHP or Python to solve the exercise and create a simple and responsive GUI, using HTML, CSS and JavaScript.Do not use a database.

  The program is to print the time

The program is to print the time in seconds that the iterative version takes, the time in seconds that the recursive version takes, and the difference between the times.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd