Posts

Showing posts with the label ensemble_method(Scikit_learn)

ML- Decision tree and Random forest

Image
Introduction: Decision tree in general represent the hierarchical series of binary decision. The decision tree in the machine learning works in exactly the same way and except that we let the computer figure out the optimal structure and hierarchy of decision, instead coming up the criteria manually. In this model, I took the Australian weather dataset for forecasting.  Data Preprocessing: We'll perform the following steps to prepare the dataset for training: Create a train/test/validation split. Identify input and target columns. Identify numeric and categorical columns. Impute missing values. Scale the numeric value. Encode categorical columns to one-hot vector. Data Visualization: Tree is split on the basis of gini index.   Plot is based on the important feature of Weather prediction. Hyperparamter tuning: What we observe is that training model is 99% accuracy and validation set is just above the average, which means machine is memorizing the data in order to increase the a...