Question: PLease complete this ML COURSE - python > discrete input, discrete output > real input, real output > real input, discrete output > discrete input,

PLease complete this ML COURSE - python > discrete input, discrete output > real input, real output > real input, discrete output > discrete input, real output """ import numpy as np import pandas as pd import matplotlib.pyplot as plt from .utils import entropy, information_gain, gini_index np.random.seed(42) class DecisionTree(): def __init__(self, criterion, max_depth): """ Put all infromation to initialize your tree here. Inputs: > criterion : {"information_gain", "gini_index"} # criterion won't be used for regression > max_depth : The maximum depth the tree can grow to """ pass def fit(self, X, y): """ Function to train and construct the decision tree Inputs: X: pd.DataFrame with rows as samples and columns as features (shape of X is N X P) where N is the number of samples and P is the number of columns. y: pd.Series with rows corresponding to output variable (shape of Y is N) """ pass def predict(self, X): """ Funtion to run the decision tree on a data point Input: X: pd.DataFrame with rows as samples and columns as features Output: y: pd.Series with rows corresponding to output variable. THe output variable in a row is the prediction for sample in corresponding row in X. """ pass def plot(self): """ Function to plot the tree Output Example: ?(X1 > 4) Y: ?(X2 > 7) Y: Class A N: Class B N: Class C Where Y => Yes and N => No """ pass

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!