Posts

Showing posts with the label Iris

Classification of Iris flowers using Random Forest

Image
  Classification of Iris flowers using Random Forest Steps: 1. Importing the library files 2. Reading the Iris Dataset 3. Preprocessing 4. Split the dataset into training and testing 5. Build the model (Random Forest Model) 6. Evaluate the performance of the Model 1. Importing the library files 2. Reading the Iris Dataset 3. Preprocessing 4. Split the dataset into training and testing 5. Build the model (Random Forest Model) sklearn.ensemble .RandomForestClassifier class   sklearn.ensemble. RandomForestClassifier ( n_estimators = 100 ,  * ,  criterion = 'gini' ,  max_depth = None ,  min_samples_split = 2 ,  min_samples_leaf = 1 ,  min_weight_fraction_leaf = 0.0 ,  max_features = 'sqrt' ,  max_leaf_nodes = None ,  min_impurity_decrease = 0.0 ,  bootstrap = True ,  oob_score = False ,  n_jobs = None ,  random_state = None ,  verbose = 0 ,  warm_start = False ,  class_weight = None ,  ccp_alpha = 0.0 ,  max_samples = None ) A random forest classifier. A random forest is a

Decision Tree Classifier on Iris Dataset

Image
Decision Tree Classifier on Iris Dataset  Steps: 1. Importing the library files 2. Reading the Iris Dataset 3. Preprocessing 4. Split the dataset into training and testing 5. Build the model (Decision Tree Model) 6. Evaluate the performance of the Model 7. Visualize the model 1. Importing the library files 2. Reading the Iris Dataset 3. Preprocessing 4. Split the dataset into training and testing 5. Build the model (Decision Tree Mode l) class   sklearn.tree. DecisionTreeClassifier ( * ,  criterion = 'gini' ,  splitter = 'best' ,  max_depth = None ,  min_samples_split = 2 ,  min_samples_leaf = 1 ,  min_weight_fraction_leaf = 0.0 ,  max_features = None ,  random_state = None ,  max_leaf_nodes = None ,  min_impurity_decrease = 0.0 ,  class_weight = None ,  ccp_alpha = 0.0 ) Parameters : criterion {“gini”, “entropy”, “log_loss”}, default=”gini” The function to measure the quality of a split. Supported criteria are “gini” for the Gini impurity and “log_loss” and “entropy” b