# قسم الرياضيات و الإعلام الإلي

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

المقياس: Apprentissage automatique II

1. معلومات
2. الأسئلة
3. التعليم عن بعد

## 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           GoodAsma   : Female      Master            Married           Bad    Rabah  : Male         Doctorate      Married            GoodHana    : Female     Master           Single             NormalAli       : Male         Bachelor        Divorced          GoodFateh   : Male         Master           Married            NormalAmina : Female      Master           Divorced          GoodIbrahim: Male        Bachelor         Married            Low نشر على 09:34, السبت 9 نوف 2019 By Imed BOUCHRIKA In Apprentissage automatique II

أجوبة (2)

### جواب (1)

 0 votes Construct our decision tree model: 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: If( marital = Divorced ) The performance is always Good :(so the decision tree should look like this): If (marital = Married) we calculate the other two feautres's information gain: 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: 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: 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: 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 : II. Parse the new data into the decistion tree model: Ahmed: Marital = Divorced ===> Performance = Good (based on the training data) Amel: Marital = Single ----> Gender = Female =====> Performance = Normal   So Ahmed is the suitable candidate to recruit. نشر على 16:01, السبت 9 نوف 2019 by abdennour redjaibia   (282 points) In Apprentissage automatique II

### جواب (2)

 0 votes ahmed is good amel is good نشر على 20:15, الجمعة 19 مار 2021 by sofiane benrdjem (27 points) In Apprentissage automatique II

هل لديك جواب ?