Département de Mathématiques et Informatique

www.univ-soukahras.dz/fr/dept/mi

Matière: Apprentissage automatique II

  1. Information
  2. Questions
  3. e-Learning

Using a Decision Tree, find the suitable candidate to recruit,

1 votes

Using a Decision Tree, find the suitable candidate to recruit, based on their performance

Candidates:
             Gender      Edu Level      Marital             Performance        
Ahmed :  Male        Master           Divorced          ???
Amel    :  Female    Doctorate       Single             ???

Employees:
Tarek   :  Male         Bachelor          Single           Good
Asma   : Female      Master            Married           Bad   
Rabah  : Male         Doctorate      Married            Good
Hana    : Female     Master           Single             Normal
Ali       : Male         Bachelor        Divorced          Good
Fateh   : Male         Master           Married            Normal
Amina : Female      Master           Divorced          Good
Ibrahim: Male        Bachelor         Married            Low

 

Posté le 09:34, Saturday 9 Nov 2019 By Imed BOUCHRIKA
In Apprentissage automatique II


Réponses (2)




Réponse (1)

0 votes

  1. Construct our decision tree model:
    1. Extract rules and calculate their information gain:  
      • Gender :
        • gender = male => p = 5/8, E(gender=male) = - (1/5) log2(1/5) - (1/5)log2(1/5) - (3/5)log2(3/5) = 1.3710
        • gender = female =>  p= 3/8, E(gender=female) = -1/3 log2(1/3) - 1/3 log(1/3) - 1/3 log(1/3) = 1.5850
        • E(Parent) = -4/8 log2(4/8) - 1/8 log2(1/8) - 2/8 log2(2/8) -1/8log2(1/8) = 1.75
        • Information Gain(Gender) = 1.75 - ((5/8*1.3710)+(3/8*1.5750)) = 0.3025
      • Edu level:
        • EL = Bachelor => p = 3/8, E(EL=Bachelor) = -1/3 log2(1/3) - 2/3log2(2/3) = 0.9183
        • EL = Master => p= 4/8, E(EL=Master) = -1/4 log2(1/4) -2/4 log2(2/4) - 1/4 log2(1/4) = 1.5
        • EL = Doctorate => 1/8 E(EL= doctorate) = 0
        • E(Parnet) = 1.75
        • Information Gain = 1.75 - (3/8*0.9183+4/8*1.5+1/8*0) = 0.6556
      • Marital:
        • Marital = Single => p=2/8, E(M=S) = -1/2 log2(1/2) - 1/2 log2(1/2) = 1
        • Marital = Married => p=4/8, E(M=Married) = -1/4log2(1/4)*4= 2
        • Marital = Divorced => p= 2/8, E(M=Divorced) = 0
        • E(Parent) = 1.75
        • Information Gain = 1.75 - (2/8*1+4/8*2+2/8*0)  = 0.50

First feautre that give us the highest value of information gain is Marital:So the first node in our tree is Marital:                             First NodeIf( marital = Divorced ) The performance is always Good :(so the decision tree should look like this):

Decision Tree

If (marital = Married) we calculate the other two feautres's information gain:

      1. Marital = Married => 4 rows:
        • Gender :
          • G = Male => P = 3/4, e(G=male) = -1/3 log2(1/3) * 3 = 1.5850
          • G = Female => p = 1/4 e(G=Female) = 0
          • E(Parent) = E(Marital=Married) = 2
          • Information Gain = 2-(3/4*1.5850 + 1/4*0) = 0.8113
        • Education Level :
          • EL = Master => p = 2/4, E(EL=master) = 1
          • EL = Doctorate =>p=1/4, E(EL=Doctorate) = 0
          • EL = Bachelor => p=1/4, E(EL=Bachelor) = 0
          • E(Parent ) = E(Marital=Married) = 2
          • Information Gain = 2- (2/4*1+1/4*0+1/4*0) = 1.5
        • The Education level features has the highest value so our Tree should be like this:

DTree

If (marital = Single) we calculate the other two feautres's information gain:

  • P(Marital = Single ) = 2
      • Gender:
        • Gender = Male-> p= 1/2, E(Gender=Male) =0
        • Gender = Female -> p = 1/2 , E(Gender = Female ) = 0
        • E(Parent) = E(Marital=Single) = 1
        • Information Gain = 1-0 = 1
      • Education Level
        • EL = Bachelor => p= 1/2, E = 0
        • EL = Master=> p= 1/2, E = 0
        • Information Gain = 1-0 = 1
    • As we see they both have the same information gain so the rank doesn't matter so we draw our tree:

Tree

    • If Marital = Married And Education Level = Bachelor -> The performance is always = Low
    • If Marital = Married And Education Level = Master ->
      • if gender = Male => The performance = Normal
      • if gender = Female=> The performance = Bad
    • If Marital = Married And Education Level = Doctorate -> The performance is Good

our tree should look like this:

 

aaa

For the last node (Marital = Single) :

  • if ( EL= Bachelor) or (Gender = Male) Performance = Good
  • if(El = master) or (Gender = Female) Performance = Normal

Final Decition tree :

 

 

asa

 

    II. Parse the new data into the decistion tree model:

    1. Ahmed:
      • Marital = Divorced ===> Performance = Good (based on the training data)
    2. Amel:
      • Marital = Single ----> Gender = Female =====> Performance = Normal

 

So Ahmed is the suitable candidate to recruit.

 

Posté le 16:01, Saturday 9 Nov 2019 by abdennour redjaibia (282 points)
In Apprentissage automatique II



Réponse (2)

0 votes

ahmed is good

amel is good

Posté le 20:15, Friday 19 Mar 2021 by sofiane benrdjem (27 points)
In Apprentissage automatique II



Avez vous une réponse ?