Data Mining and Warehousing Concepts Lab: (ITPC - 228)
Data Mining and Warehousing Concepts Lab: (ITPC - 228)
Data Mining and Warehousing Concepts Lab: (ITPC - 228)
(ITPC - 228)
(Assignment - 6)
STEPS -
# Sample prediction
sample_data = [[5.1, 3.0, 1.4, 0.2]]
sample_pred = knn.predict(sample_data)
print(f"Predicted class for sample data {sample_data}:
{dataset.target_names[sample_pred[0]]}")
Output :
AIM(6.b) - Python Implementation of Naive Bayes Classifier
Algorithm using iris dataset.
STEPS -
Source code :
# Sample prediction
sample_data = [[4.0, 3.5, 1.4, 0.2]]
sample_pred = nb.predict(sample_data)
print(f"Predicted class for sample data{sample_data}:
{iris.target_names[sample_pred[0]]}")
Output :
Data mining and warehousing concepts Lab
(ITPC - 228)
(Assignment - 7)
Source code :
from sklearn.datasets import load_iris
from sklearn.model_selection import train_test_split
from sklearn.tree import DecisionTreeClassifier, plot_tree
from sklearn.metrics import accuracy_score
import matplotlib.pyplot as plt