1. Homepage
  2. Homework
  3. COMPSCI 367 Assignment 3: Bayes sentiment classifier, PDDL
This question has been solved

COMPSCI 367 Assignment 3: Bayes sentiment classifier, PDDL

Engage in a Conversation
AucklandCOMPSCI 367The practice of Artificial IntelligenceBayes sentiment classifier PDDL

School of Computer Science CourseNana.COM

CourseNana.COM


CourseNana.COM

CourseNana.COM

COMPSCI 367                                          Assignment 3      CourseNana.COM

CourseNana.COM

  CourseNana.COM

Due: by 11:59pm on the due date. This is a hard due date. Late assignments will not be marked. CourseNana.COM

Total marks: 15. CourseNana.COM

Weighting: This assignment counts toward 15% of your final mark. CourseNana.COM

  CourseNana.COM

  CourseNana.COM

Question 1 [4 marks] CourseNana.COM

  CourseNana.COM

Suppose that you are training a very simple naïve Bayes sentiment classifier, with add-one (Laplace) smoothing. You have the following five training documents (one sentence each), two from class – and three from class +. CourseNana.COM

  CourseNana.COM

Class CourseNana.COM

Documents CourseNana.COM

- CourseNana.COM

Sad and bad service CourseNana.COM

- CourseNana.COM

Sad cake service and I will not return at all CourseNana.COM

+ CourseNana.COM

Delicious soup and not at all bad CourseNana.COM

+ CourseNana.COM

Nothing bad about the service CourseNana.COM

+ CourseNana.COM

Sad service but worth it for the soup CourseNana.COM

  CourseNana.COM

(a)  Create a table of counts for each word in the training data above (including a “total” column). Include details for add-one (Laplace) smoothing. (1 mark) CourseNana.COM


CourseNana.COM

(b)  Calculate the probability estimated, by your naïve Bayes estimator, for Class + and Class for the sentence “Bad soup and cake”. Show your working. (2 marks) CourseNana.COM

(c)   What class would your classifier choose for the sentence “Bad soup and cake”. (1 mark) CourseNana.COM


CourseNana.COM

Question 2 [6 marks] CourseNana.COM

  CourseNana.COM

For this question, you are asked to program a game of Mū Tōrere using PDDL. Read the description carefully and create PDDL code to play this game. CourseNana.COM

  CourseNana.COM

Here is the Mū Tōrere playing board in the starting configuration. There are nine positions on the board. For the purposes of this assignment, I have labelled the positions as follows (0 through 8): CourseNana.COM

  CourseNana.COM

CourseNana.COM

Fig 1. Numbering the nine board positions. CourseNana.COM

  CourseNana.COM

There are two players: green and white. The game uses eight playing pieces and each player has four pieces assigned to them (playerpiece). Each of the pieces is at a position on the board. There is one vacant position. Each player takes a turn to move one of their pieces into the vacant position on the board. (No jumping over pieces is allowed!) After one player has moved, it is the next player’s turn. CourseNana.COM

  CourseNana.COM

A validmove represents a path between one position to another position on the board that a piece might travel. The destination position for any move must not have a piece at that position (i.e., the destination position must be vacant). CourseNana.COM

  CourseNana.COM

The list of possible valid moves includes, firstly, the move of a piece to a position on the outer ring of the board from either one of its neighbour positions on the outer ring or else from the centre position and, secondly, a move of a piece from any of the outer positions to the centre. Consequently, there are two action schemas: moveouter and movetocentre. Note that a move from the outer ring position to the centre can only occur if there is one piece in a neighbouring position that belongs to the opponent player (i.e., this is an additional precondition for the movetocentre action schema). CourseNana.COM

  CourseNana.COM

  CourseNana.COM

  CourseNana.COM

CourseNana.COM

Fig 2. Labels for each of the player pieces. The white pieces belong to Tūī. The green pieces are Daniel’s. Green has the first move. CourseNana.COM

  CourseNana.COM

The green player has the first turn. Game play continues with each player taking a turn to move one of their pieces until one player is unable to move. The winner is the person who prevents their opponent from being able to make a move. CourseNana.COM

  CourseNana.COM

For this assignment, you will reenact a game between Tūi (white) and Daniel (green). The initial state is shown in Figure 1. The end state of the game is shown in Figure 3 below. Daniel won this game after moving the g3 piece to position 2 on the board, hence blocking white from being able to move. For your project, the image below is the goal state that you need to reach. (Note: your game reconstruction might have a different winning move but it must reach the goal configuration represented in the picture below.) CourseNana.COM

  CourseNana.COM

CourseNana.COM

Fig 3. The game has ended. Green has won as they have prevented White from being able to move a piece. CourseNana.COM

  CourseNana.COM

Have a play of Mū Tōrere on the following website to get a feel for the gameplay: https://www.heihei.nz/game/165/m%C5%AB-t%C5%8Drere CourseNana.COM

  CourseNana.COM

  CourseNana.COM

  CourseNana.COM

(a)  Write a PDDL domain file muu_toorere_domain.pddl that specifies the two action schemas: moveouter and movecentre. (3 marks) CourseNana.COM

  CourseNana.COM

You need to use the PDDL syntax starting from the following: CourseNana.COM

  CourseNana.COM

(define (domain muutoorere) CourseNana.COM

      (:requirements :strips) CourseNana.COM

      (:predicates CourseNana.COM

         (at ?piece ?position) (position ?pos) (piece ?piece)    CourseNana.COM

         (playerpiece ?piece ?player) (vacant ?v) CourseNana.COM

         (validmove ?position1 ?position2) CourseNana.COM

         (turn ?player) (player ?player) (different ?player1 ?player2) CourseNana.COM

         (outerpos ?pos) (centrepos ?pos) CourseNana.COM

  ) CourseNana.COM

              …//fill in the description here// CourseNana.COM

) CourseNana.COM

  CourseNana.COM

  CourseNana.COM

Tip 1: I would suggest treating vacant as an entity that is at a particular position to indicate an empty position. CourseNana.COM

Tip 2: Configure the predicate different to allow you to check that you are referring to two different players. CourseNana.COM

Tip 3: For position 0, centrepos is true. For all other positions, outerpos is true. CourseNana.COM

  CourseNana.COM

  CourseNana.COM

(b)  Write a PDDL problem file muu_toorere_task.pddl that defines all components of the task, including specifying the initial state and the goal state. (3 marks) CourseNana.COM

  CourseNana.COM

Submit the two files muu_toorere_domain.pddl and muu_toorere_task.pddl. CourseNana.COM

  CourseNana.COM

You may use the PDDL Editor to test your code: http://editor.planning.domains/ CourseNana.COM

   CourseNana.COM

Question 3 [5 marks total] CourseNana.COM

  CourseNana.COM

  CourseNana.COM

We are analysing the expression of various genes and their relationships to one another. CourseNana.COM

The following facts are found: The expression of GeneA and/or GeneB regulates the expression of GeneC. The expression of GeneC regulates the expression of GeneD. CourseNana.COM

  CourseNana.COM

(a)  Draw the Bayesian Network diagram for these facts. (1 mark) CourseNana.COM

(b)  Consider the following facts: CourseNana.COM

  CourseNana.COM

P(GeneA) = 0.5 CourseNana.COM

  CourseNana.COM

P(GeneB) = 0.5 CourseNana.COM

  CourseNana.COM

P(GeneC | GeneA, GeneB) = 0.9 CourseNana.COM

P(GeneC | GeneA, ¬GeneB) = 0.15 CourseNana.COM

P(GeneC | ¬GeneA, GeneB) = 0.25 CourseNana.COM

P(GeneC | ¬GeneA, ¬GeneB) = 0 CourseNana.COM

  CourseNana.COM

P(GeneD | ¬GeneC) = 0.9 CourseNana.COM

P(GeneD | GeneC) = 0.05 CourseNana.COM

  CourseNana.COM

A gene may be in a state of “on” (=1) or “off (=0). Given this information, draw the full conditional probability tables for the following probability distributions: P(GeneA), P(GeneB), P(GeneC), and P(GeneD). (1 mark) CourseNana.COM

(c)   Use the variable elimination algorithm to calculate the probability that gene A is “on” given that we have found that gene D is “on”. I.e., What is P(GeneA | GeneD)? Show all working. (3 marks) CourseNana.COM

  CourseNana.COM

Get in Touch with Our Experts

WeChat WeChat
Whatsapp WhatsApp
Auckland代写,COMPSCI 367代写,The practice of Artificial Intelligence代写,Bayes sentiment classifier代写, PDDL代写,Auckland代编,COMPSCI 367代编,The practice of Artificial Intelligence代编,Bayes sentiment classifier代编, PDDL代编,Auckland代考,COMPSCI 367代考,The practice of Artificial Intelligence代考,Bayes sentiment classifier代考, PDDL代考,Aucklandhelp,COMPSCI 367help,The practice of Artificial Intelligencehelp,Bayes sentiment classifierhelp, PDDLhelp,Auckland作业代写,COMPSCI 367作业代写,The practice of Artificial Intelligence作业代写,Bayes sentiment classifier作业代写, PDDL作业代写,Auckland编程代写,COMPSCI 367编程代写,The practice of Artificial Intelligence编程代写,Bayes sentiment classifier编程代写, PDDL编程代写,Aucklandprogramming help,COMPSCI 367programming help,The practice of Artificial Intelligenceprogramming help,Bayes sentiment classifierprogramming help, PDDLprogramming help,Aucklandassignment help,COMPSCI 367assignment help,The practice of Artificial Intelligenceassignment help,Bayes sentiment classifierassignment help, PDDLassignment help,Aucklandsolution,COMPSCI 367solution,The practice of Artificial Intelligencesolution,Bayes sentiment classifiersolution, PDDLsolution,