Shared Flashcard Set

Details

AI methods
Ai methods revision notes
81
Computer Science
Undergraduate 2
05/23/2017

Additional Computer Science Flashcards

 


 

Cards

Term
Define State
Definition

The way the system is, at a moment in time.

 

nothing about possible changes 

Term
Define Goal Test
Definition
Determines if a given state satisfies the goal of the problem
Term
Solution
Definition
A path from inital state to a state that satifies the goal state
Term
Optimal solution
Definition
In optimal solution is a solution with least cost
Term
General Problem
Definition

- Inital state (definition)

- a set of operators/ actions to go from one state to another 

- states and operators define the state space 

- goal test 

- path and funtions

- solution

Term
Uniformed
Definition

- no knowledge about the distance (cost) from the current state to the goal state

- only detect when a goal state has been found

(brute force/blind search)

 

Term
Heuristic
Definition

- access to extra information (an estimation of cost for the remaining path from current to goal state 

- estimation by heuristic function 

- "informed search"

Term
Associated state
Definition
- State in the state space to which the node corresponds
Term
Parent node
Definition
- node which was expanded to generate this node
Term
Operator
Definition
- Operator used to generate this node
Term
Depth
Definition
distance from root node to this one
Term
Path cost
Definition
Cost of getting from the root node to this one
Term
Declaritive
Definition

The programmer specifies a goal to be achieved and the system works out how to achieve it

e.g. prolog

Term
Procedual
Definition

The programmer specifies how to achieve a goal

e.g. C, C++, Java

Term
Advantages of Logic Programming
Definition

- Ease of programming (prolog programs are smaller in size relative to procedual)

- Increases programmer productivity

- Facilitates proving correctness of programs

Term
Disadvantages of logic programming
Definition
- Slows the execution of programs
Term

Paper Needed


List Member

Definition

member(X,[X|T]).

 

member(X,[H|T]) :- member(X,T).

Term

Paper Needed


Take a list and give a copy of it

Definition

clist([],[]).

 

clist([H|T],[H|R]) :- clist(T,R).

Term

Paper Needed


last element 

Definition

last(X,[X]).

last(X, [H|T]):-last(X,T).

Term
Length of a list predicate
Definition

len([], 0).

len([H|T],N):- len(T,X), N is X+1.

Term
Check for integars predicate
Definition

intlist([]).

intlist([X]) :- integer(X).

intlist([H|T]):- integer(H), intlist(T).

Term
List maximum predicate
Definition

max2(X,Y,Z):- X>=Y, Z is X.

max2(X,Y,Z):- X < Y, Z is Y.

maxlist([X],X).

maxlist([H|T], M):- maxlist(T, Mt), max2(H,Mt,M).

Term
Postive elements in a list
Definition

io([]).

io([H|T]):- H>0, write (H), io(T).

io([H|T]):- H <= 0, io(T).

Term
Deletion
Definition

del(H, [H|T], T).

del(X,[H|T], [H|T1]):- del(X, T, T1).

Term
Even length predicate
Definition

evenlength([]).

evenlength([H|T]):- oddlength(T).

oddlength([H|T]) :- evenlength(T).

Term
Write a Prolog predicate ‘mul’ that takes a list of numbers and multiplies each element of the list by 2.
Definition

mul([],[]).

mul([H|T], Result) :- mul(T,R) x is Z * H, concat([X], R, Result).

Term
Write a Prolog predicate ‘add’ that takes a term ‘X’ and a list L and adds X to L as the first element if X is not already in L.
Definition

member(X, [X | T]).

member(X, [H | T]) :- member(X, T).

add(Element, List, List) :- member(Element, List), !. add(Element, List, [Element | List]).

Term
Valid/Invalid Number
Definition

run:- read(X), test(X).

test(1) :- !, write('Invalid Number').

test(_) :- write('Invalid Input').

Term
Classify into 3 classes: positive, zero and negative
Definition

classify(Number, positive):- Number > 0, !.

classify(0, zero).

classify(Number, negative) :- Number < 0, !.

Term
Factorial Predicate
Definition

factorial(0,1).

factorial(N, Result):- 

N > 1,

N1 is N-1,

factorial(N1, Result),

Result is Result1 * N.

Term
Breadth First Search
Definition

- Expand the shallowest nodes on the fringe first

 

- All nodes at depth d are expanded before any nodes at depth d + 1 

Term
Breadth first criteria
Definition

Time Complexity: bd

Space Complexity: bd

Optimal: yes

Completeness: yes

Term
Uniform Cost Search Criteria
Definition

Time Complexity: bd

Space Complexity: bd

Optimal: yes

Completeness: yes

Term
Depth First Criteria
Definition

Time Complexity: bm

Space Complexity: bm

Optimal: no

Completeness: no

Term
Depth Limited Search
Definition

Time Complexity: bl

Space Complexity: bl

Optimal: no

Completeness: yes if l > d

Term
Iterative Deepening Search Criteria
Definition

Time Complexity: bd

Space Complexity: bd

Optimal: yes

Completeness: yes 

Term
Bidirectional Criteria
Definition

Time Complexity: bd/2

Space Complexity: bd/2

Optimal: yes

Completeness: yes

Term
Training Date
Definition
The data from which a patten must be discovered
Term
Target function
Definition
The actual funciton that describes the data. This is unknown
Term
Hypothesis
Definition
any function that can be induced from the training data is called hypothesis
Term
Hypothesis needs to be:-
Definition

- close to the target function. I.e. minimises error

- describes a large number of instances in a concise way

- generalises well to unseen test data

 

Term
If we have more than one hypothesis we use..
Definition

Ockhams Razor Princiable

- This is the most likely hypothesis is the simpliest one that is consistent with the training data

Term
Define Concept
Definition
A concept is a boolean- valued function defined over some set (binary classification)
Term
Each attribute will be:
Definition

- '?' which indiciates that any value is acceptable for the attribute

- specify a single value for the attribute 

Ø indicates that no value is acceptable for the attribute

Term
Find-S - Pros and Cons
Definition

- Guarenteed to output the most specific hypothesis within H that is consistent with the positive training example

 

- Output of FIND-S will be consistent with the negative training examples

 

- Finds only one of the possible hypothesis

Term
LIST-THEN-ELIMINATE Pros and Cons
Definition

- Requires H to be finite 

 

- Guarenteed to output all hypothesis consisten with the training data 

 

- Requires exhaustive ennumeration of hypothesis in H

Term
Concept Learning Methods Pros and Cons
Definition

- Methods are conceptually simple

- Can be used to represent attribute value pairs

- Difficult to use these method with structured data 

Term
Parts of the decision tree
Definition

- Each non-leaf node specifies an attribute

- Each leaf node has an integer value

- Each edge from a non leaf node is labled with a value for the attribute specified by the node 

 

Term
Choosing the root node
Definition

- Calculate the info gain for all attributes

- The attribute with the highest info gain in the root node

- At every level, choose the attribute with the highest info gain

Term
Cross Validation
Definition

- only use a part of the training data for leaving the hypothesis

- use the remaining training data for testing the hypothesis

- repeat this with different subsets of data, and choose a hypothesis with good prediction performance

Term
What is noise?
Definition
- There is noise if 2 or more examples have the same description in terms of attributes but different classifications
Term
Solution to noise
Definition

- Take the majority classifcation for the set examples

- consider the estimated probablities for each classification using their relative frequency 

 

Term
What is overfitting?
Definition
- Hypothesis is said to overfit if it imposes meaningless regularity on it bu including irrelevant attributes in descion making
Term
Solution to overfitting
Definition

- Prune irrelevant attributes

- cross validate hypothesis and choose best at decsion making

Term
Logic based learning (resolution)
Definition

                                                               If a hypothesis and an example are inconsistent, a logical inference system can learn from the example by eliminating the hypothesis.

Term
What is current best hypothesis
Definition

                                                               i.      Start with an initial hypothesis and call it the current hypothesis

 

                                                             ii.      For each training instance check if it is consistent with current hypothesis and if not adjust the current hypothesis to make it consistent

Term
Two ways to make it consistent (current best hypothesis)
Definition

1.       Generalisation – dropping conditions

 

 

2.       Specialised – Adding conditions

Term
Pros and Cons of Current Best Hypothesis
Definition

1.       This method is conceptually simple

2.       Non-deterministic; so several generalisations and specialisations can be made

3.       Choices made may not lead to simple hypothesis

 

4.       Choices may lead to irrecoverable situations, so you must backtrack

Term
What is linear separate data
Definition

                                                               i.      Data is linearly separable if a straight line can separate positive and negative instances

Term

What is    Perceptron Learning

 

Definition

                                                               i.      For the classification of linearly separable data using a binary classifier, a perceptron, It receives info from perceptrons/environment, processes it then transmits to other perceptrons/environments

Term
Pros and Cons of Perceptron Learning
Definition

 

1.       For linearly separable training data, guaranteed to find a solution in a finite number of steps

2.       Conceptually simple

3.       Multiple solutions possible

4.       May not converge for training data that isn’t linearly separable

 

5.       Does not readily generalise more than 2 classes

Term
Instance-based Learning
Definition

a.       Used to classify data that is

                                                               i.      Not linearly separable

                                                             ii.      Represented in Euclidean space

b.    

   Do not construct hypothesis

 

c.      

Each time new data is encountered a prediction is made based on new to old

Term
Describe K neighbour
Definition

This method is for classification of data represented in Euclidean space. It is used to classify data that is not linearly separable. In order to classify a point xq:

 

• find its k nearest neighbors by using Euclidean distance measure

• then, find the majority class for these k neighbors and classify xq as the majority class.

Term
Pros and Cons of K neighbour
Definition

                                                               i.      Pros

1.       Useful local approximation of complex non-linearly separable training data

 

                                                             ii.      Cons

1.       The cost of classifying new test data can be high since computation must be repeated for each test data

 

2.       The classification of test data os sensitive to the value of k

Term
Pros of Uniformed Searches
Definition

                                                               i.      Advantages

1.       Useful for graph search or traversal

2.       BFS – complete, simple to implement on any search problem

3.       DFS – memory O(bm)

4.       Iterative – memory O(bm)

 

5.       Uniform – optimal

Term
Cons of Uniformed Search
Definition

a.       Uninformed Search

                                                               i.      Disadvantages

1.       Has no knowledge about distance from the current state to the goal

2.       Can only detect when a goal state has been found

3.       BFS – Memory is high O(b^d) as its inefficient

4.       DFS – not complete

5.       Iterative – not optimal

 

6.       Uniform – exponential memory

Term
Advantages pf Informed Search
Definition

                                   

1.       A* -If h is admissible and consistent then is optimal and complete

2.       Good to have an estimate

 

3.       Can solve problems quicker

Term
Disadvantages of Informed
Definition

                                                               i.      Disadvantages

1.       Need to keep everything that happens in the memory

2.       Need to be able to do quick cost comparisons

3.       Need to choose good heuristics

4.       Greedy – Not complete or optimal, can be false starts

 

5.       A* - high memory required

Term
types of sentences
Definition

a.       A sentence S is satisfiable if there exists a structure that S evaluates to true. Otherwise S is unsatisfiable or contradictory

 

b.       A sentence S is valid or a tautology if for each possible structure for S, S evaluates to true

Term
Propostitonal Logic Pros and Cons
Definition

                                                               i.      Hard to express properties of objects or relations between them

                                                             ii.      Propositional logic ant deal with facts changing over time

                                                           iii.      Propositional logic is sound, complete, monotonic and consistent

 

                                                           iv.      Propositional logic is decidable 

Term
First Order Logic Pros and Cons
Definition

                                                               i.      Assumes the world contains objects and relations or properties with them

                                                             ii.      Contains quantifiers

 

                                                           iii.      More expressive

Term
Hill Climbing Explained
Definition
- Hill climbing starts by choosing a random start point and setting it to current point
- It then searches the neighbourhood(comprised of point n1,...nm) of c
- It then chooses the best among (n1,...nm) to be the current point
- the above steps are then repeated until no improvement can be made to the current point
Term
What is local optimum
Definition
A local optimum is a peak in a landscape, it is optimum around it's immediate surrounding neighbour hood
Term
What is global optimum
Definition
A global optimum is an optimum over the entire landscape.
Term
Most general unifer
Definition
This is process of taking two atomic sentences and giving a substitution that makes the two sentences look the same, or fails if there is no such subsittion.

A most general unifier is a substitution which makes the least commitment about bindings of the variables
Term
What is skolemization
Definition
This is the process of eliminating existential quantifies and replacing existentially quantified variables with Skolem functions
Term
Define Learning program
Definition
A program is said to learn from experience E with respect to some class of tasks in T, as measure by P, improves by performance
Term
Advantages of Perception learning
Definition
for linearly separable training data, guaranteed to find a solution in a finite number of steps

- it is conceptually simple
Term
Disadvantages of Perception learning
Definition
- Multiple solutios possible
- May not converge for training data that is not linearly separable
- Does not readily generalise to more than two classes
Term
Rules Inference
Definition
And Elimination
And Introduction
Or Introduction
Resolution
Unit resolution
Mod Pod
Double negation

Contrapositive Rule:
(P ⇒ Q) ≡ (¬Q ⇒ ¬P)

de Morgan’s Laws:
¬(P ∧ Q) ≡ (¬P ∨ ¬Q) and ¬(P ∨ Q) ≡ (¬P ∧ ¬Q)

Implication Elimination:
(P ⇒ Q) ≡ (¬P ∨ Q)
Term
Concat two lists
Definition
concat ([ ], L, L).
concat([ H | T ], L2, [H | L3]):-
concat(T, L2, L3).
Supporting users have an ad free experience!