Data Mining Journal 4 Kashan
Data Mining Journal 4 Kashan
Data Mining Journal 4 Kashan
Karachi Campus
LIST OF TASKS
TASK NO OBJECTIVE
1 Using python implement Decision Tree Algorithm on Diabetes Dataset the chances of
diabetes in a person. visualize the results of the model in the form of a confusion matrix
using matplotlib and seaborn.
2 Using Knime implement Task # 01.
3 Using python perform the parameter tuning to optimize the Decision Tree performance and
compare the results with task # 1.
Date: ___________
# Splitting the data into features (X) and target variable (y)
X = data.drop('Outcome', axis=1)
y = data['Outcome']
# Splitting the data into training and testing sets (80% train, 20% test)
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)
# Calculating accuracy
accuracy = accuracy_score(y_test, y_pred)
print("Accuracy:", accuracy)
Assign different values to different colors on color manager.
Kashan Riaz 02-131212-075 Data mining Journal
Keep partitioning as 80 percent.
Decision tree learner view
# Splitting the data into features (X) and target variable (y)
X = data.drop('Outcome', axis=1)
y = data['Outcome']
# Splitting the data into training and testing sets (80% train, 20% test)
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2,
random_state=42)
# Initialize GridSearchCV
grid_search = GridSearchCV(clf, param_grid, cv=5)
# Perform GridSearchCV
grid_search.fit(X_train, y_train)