Question: Information gain, decision tree import math import pandas as pd def information_gain_target (dataset_file): Input: dataset_file - A string variable which references the path to the
Information gain, decision tree

import math import pandas as pd def information_gain_target (dataset_file): Input: dataset_file - A string variable which references the path to the dataset file. Output: ig_loan - A floating point variable which holds the information gain associated with the target variat NOTE: 1. Return the information gain associated with the target variable in the dataset. 2. The Loan attribute is the target variable 3. The pandas dataframe has the following attributes: Age, Income, Student, Credit Rating, Loan 4. Perform your calculations for information gain and assign it to the variable ig_loan df - pd.read_csv( dataset_file) ig_loan - 0 #your code here in Python return ig_loan
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
