Prolog代写 | COMP3411/9814 Artificial Intelligence Assignment


COMP3411/9814 Artificial Intelligence Term 1, 2021

Assignment 2 – Machine Learning (DRAFT ONLY)

Due: Friday 23 April, 10pm
Marks: 20% of final assessment for COMP3411/9814 Artificial Intelligence

Part 1: Decision Trees Question 1.1 (5 marks):

Consider the decision tree learning algorithm of Figure 7.7 and the data of Figure 7.1 from Poole & Mackworth [1], also presented below. Suppose, for this question, the stopping criterion is that all of the examples have the same classification. The tree of Figure 7.6 was built by selecting a feature that gives the maximum information gain. This question considers what happens when a different feature is selected.

Figure 7.1: Examples of a user’s preferences

Question 1.2 (5 marks):

The goal is to take out-of-the-box models and apply them to a given dataset. The task is to analyse the data and build a model to predict whether income exceeds $50K/yr based on census data (also known as “Census Income” dataset).

Use the data set Adult Data Set from the Machine Learning repository [2]. Use the supervised learning methods discussed in the lectures, Decision Trees.

Do not code these methods: instead use the J48 implementation in Weka. Read the Weka documentation on Decision Trees, and the linked pages describing the parameters of the methods. You will need to download Weka, from he link above.

You should submit, as part of your PDF file, the decision tree you obtained, along with an explanation of the process you went through to get it. You can experiment with pruning the tree, including trying different pruning settings. What affect do these setttings have on the size of the tree and the accuracy?

This question will help you master the workflow of model building. For example, you’ll get to practice how to use the critical steps:

Use the Weka documentation pages for instructions how to use J48. See also this WebCMS page.

The data are available here: machine-learning-databases/adult/

Part 2: Inductive Logic Programming

Duce is a program devised by Muggleton [3] to perform learning on a set of propositional clauses. The system includes 6 operators that transform pairs of clauses into a new set of clauses. Your job is to write Prolog programs to implement 5 of the 6 operators. The other one is given as an example to get you started.

Inter-construction. This transformation takes two rules, with different heads, such as x <- [b, c, d, e]

and replaces the with rules

To make processing the rules easier, we represent the body of the clause by a list and we define the operator <- to mean “implied by” or “if’.

A Prolog program to implement inter-construction is given as an example to give you hints about how to write the remaining 5 operators.

First, we define <- as an operator that will allow us to use the notation x <- y. The program uses Prolog built-in predicates to perform set operations on lists and to generate new symbols.

obtaining the desired result.

You will write programs for the other five operators, defined below. All of these programs can be created from the builtin predicates used in the inter-construction code. So all you have to do is work out how to combine them. The only other builtin predicate you may need is to test if one list is a subset of another with subset(X, Y), where X is a subset of Y.

You can assume that the inputs will always be valid clauses and the lists will always be non-empty, i.e. with at least one element.