Sheet Evolutionary Algorithm

roomycankerblossomAI and Robotics

Oct 23, 2013 (3 years and 9 months ago)

81 views


1


Sheet
Evolutionary Algorithm



(1)
F
or the data listed below, use genetic algorithm to estimate an individual’s credit risk
on the basis of such properties as credit history, current debt, collateral and income.
Construct 5 genes
randomly

in the initial
population, and then use crossover once in
1
st

generation and mutation operation once in 2
nd

generation. The crossover and
mutation operation use random individuals. (Do not calculate the fitness value for any
gene)

No

Credit
History

Debt

Collateral

Income

RISK

1

Bad

High

None

Low

High

2

Unknown

High

None

Moderate

High

3

Unknown

Low

None

Moderate

Moderate

4

Unknown

Low

None

Low

High

5

Unknown

Low

None

High

Low

6

Unknown

Low

Adequate

High

Low

7

Bad

Low

None

Low

High

8

Bad

Low

Adequate

High

Moderate

9

Good

Low

None

High

Low

10

Good

High

Adequate

High

Low

11

Good

High

None

Low

High

12

Good

High

None

Moderate

Moderate

13

Good

High

None

High

Low

14

Bad

High

None

Moderate

High


Alexandria University


Faculty of Science


Course title : Machine Learning

Course code

: CS324

Instructors : Dr. Yasser Fouad





2

(2)
For the data listed below, it is for estimating buys computer on th
e basis of such
properties as age, income, student and credit rating. Construct 10 genes from the data
and 5 genes random with the same format of the data. Setup the 15 genes as initial
population for Genetic Algorithm. Derive the new population in generat
ion one and
two by applying Crossover operator with percentage 40% of the best genes according
to fitness, and Mutation operator with percentage 20% of the worst fitness genes. The
fitness is computed by ((the sum of (bit’s value multiply by its position)
multiply by 4
and add 2 if Buys_computer is Yes) mod 100) %.


No

Age

Income

Student

Credit_rating

Buys_computer

1

<=30

High

No

Fair

No

2

<=30

High

No

Excellent

No

3

31…40

eigh



cair

ves

4

>40

Medium

No

Fair

Yes

5

>40

Low

Yes

Fair

Yes

6

>40

Low

Yes

Excellent

No

7

31…40

i潷

ves

bxcellent

ves

8

<=30

Medium

No

Fair

No

9

<=30

Low

Yes

Fair

Yes

10

>40

Medium

Yes

Fair

Yes

11

<=30

Medium

Yes

Excellent

Yes

12

31…40

Me摩um



bxcellent

ves

13

31…40

eigh

ves

cair

ves

14

>40

Medium

No

Excellent

No


(3)

In this question, you need to propose crossover and mutation for gen
etic algorithms
that result in “
valid

states.


1.

The 8
-
queens problem, as discussed in class, asks you to place 8 queens on an 8x8
chessboard such

that no two queens can attack each other
(i.e. share the same row,
column, or diagonal). The

chromosome (representing an individual) and crossover
for the 8
-
queens problem shown in the class

generate chromosomes with exactly
one queen per column, but often more than one queens (or none)

per row.
Propose
a chromosome representation and crossover and mutation mechanisms that
generate

result in exactly one queen per column and one queen per row.



Hint:

Look at the chromosome in the slides. What makes a chromosome valid
(one queen per column

and per
row)? Think about how you can keep the
chromosome valid. For crossover, you do not have

to cut chromosome strings and
concatenate them together. For mutation, you do not have to change

one character
in the chromosome strings.




3

2.

The traveling salesman probl
em (TSP) is the problem of
fi
nding the shortest route
to visit a set of cities

exactly once and return to the starting city. In class, we
showed that TSP can be solved by a genetic

algorithm, but did not present the
chromosome, crossover,
a
nd mutation. Pro
pose a chromosome

representation and
the corresponding crossover and mutation, such that the chromosomes generated

after crossover and mutation are still valid (visiting each city exactly once).


Hint:
It is likely that you can use a solution similar to yo
ur 8
-
queens solution.
Think about what the

valid chromosome representations for these two problems
have in common?



Good Luck