What are these Random Forest Decision Boundary indicate?

What insights or implications can be inferred from these images regarding the observed computational behavior?

In the context of a specific binary classification problem, I have generated decision boundary plots for a Random Forest Model utilizing a full feature dataset comprising 34 input features and a target column, encompassing 7428 records. Subsequently, I applied the “Information Gain” feature selection technique, resulting in a reduced dataset containing 25 input features and a target column, yet maintaining the same number of records (7428). Upon applying the identical Random Forest model with consistent hyperparameter values via GridSearchCV to both datasets, I observed an unexpected increase in computation time when processing the reduced dataset, despite its fewer features.

For seeking clarity, I decided to visualize the decision boundaries for both datasets, and the attached images represent these plots (with few columns).

enter image description here

enter image description here

Remaining images are not having complex boundaries.
Sample code to plot is:

import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd
from sklearn.ensemble import RandomForestClassifier
from sklearn.model_selection import train_test_split

# Load dataset
df = pd.read_excel("curated_data.xlsx") 

# Split the data into features (X) and target variable (y)
X = df.drop(columns=['Pathogen Test Result'])  
y = df['Pathogen Test Result']

# Split the data into train and test sets
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)

# Verify the number of features in X_train and X_test
print("Number of features in X_train:", X_train.shape[1])
print("Number of features in X_test:", X_test.shape[1])

# Train a Random Forest classifier
clf = RandomForestClassifier(n_estimators=200, max_depth=None, max_features = 'log2', min_samples_leaf = 1, min_samples_split = 2, random_state=42)
clf.fit(X_train, y_train)

# Plot decision boundaries
plt.figure(figsize=(8, 6))

# Define the mesh grid
x_min, x_max = X_train.iloc[:, 0].min() - 1, X_train.iloc[:, 0].max() + 1
y_min, y_max = X_train.iloc[:, 1].min() - 1, X_train.iloc[:, 1].max() + 1
xx, yy = np.meshgrid(np.arange(x_min, x_max, 0.1), np.arange(y_min, y_max, 0.1))

# Create a mesh grid with all features
mesh_data = np.column_stack((xx.ravel(), yy.ravel()))  # Assuming only first two features are used for plotting

# Extend mesh grid with zeros to match the number of features expected by the classifier
for i in range(2, 34):
    mesh_data = np.column_stack((mesh_data, np.zeros_like(xx.ravel())))

# Predict on the mesh grid
Z = clf.predict(mesh_data)
Z = Z.reshape(xx.shape)

# Plot the decision boundaries
plt.contourf(xx, yy, Z, alpha=0.8)

for i in df1.columns:
    # Plot the data points
    sns.scatterplot(x=df1[i], y=df1['Pathogen Test Result'], hue=y_train, palette='Set1', edgecolor='k', alpha=0.7)
    plt.title('Decision Boundaries of Random Forest Classifier on Full Feature Set')
    plt.xlabel(i)
    plt.ylabel('Pathogen Test Result')
    plt.legend(loc='best')
    plt.show()

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật