Lab Manual

Syllabus
Exp 1

Data Exploration and Visualization

Explore datasets using descriptive statistics and visualizations. Understand data distributions, outliers, and patterns.

PythonPandasMatplotlibSeaborn

Procedure:

  1. Load dataset using pd.read_csv()
  2. Compute descriptive statistics: df.describe()
  3. Create histograms, box plots, and scatter plots
  4. Identify missing values and outliers
  5. Generate correlation heatmap
Exp 2

Data Preprocessing

Apply cleaning, normalization, and transformation techniques to prepare data for mining.

PythonScikit-learnPandas

Procedure:

  1. Handle missing values: mean/median/KNN imputation
  2. Apply Min-Max and Z-Score normalization
  3. Encode categorical variables (One-Hot, Label)
  4. Perform feature selection using correlation analysis
  5. Apply PCA for dimensionality reduction
Exp 3

Classification with Decision Trees

Build and evaluate Decision Tree classifiers. Understand Information Gain and pruning.

PythonScikit-learnGraphviz

Procedure:

  1. Split data into train/test sets: train_test_split()
  2. Train DecisionTreeClassifier with different criteria (gini, entropy)
  3. Visualize the tree using export_graphviz
  4. Evaluate: confusion matrix, accuracy, precision, recall
  5. Experiment with max_depth for pruning
Exp 4

Naive Bayes Classification

Implement Naive Bayes for text classification (spam detection).

PythonScikit-learnNLTK

Procedure:

  1. Load text dataset (SMS Spam Collection)
  2. Vectorize text using CountVectorizer / TF-IDF
  3. Train MultinomialNB classifier
  4. Evaluate with precision, recall, F1-score
  5. Compare with BernoulliNB variant
Exp 5

k-Nearest Neighbors Classification

Implement k-NN classifier and study the effect of k and distance metrics.

PythonScikit-learn

Procedure:

  1. Load dataset and normalize features
  2. Train KNeighborsClassifier with k=1,3,5,7,9
  3. Plot accuracy vs k to find optimal k
  4. Compare Euclidean, Manhattan, Minkowski distances
  5. Analyze confusion matrix for each k value
Exp 6

K-Means Clustering

Apply K-Means clustering and determine optimal number of clusters.

PythonScikit-learnMatplotlib

Procedure:

  1. Load and normalize data
  2. Apply KMeans with k=2 to k=10
  3. Plot SSE vs k (Elbow Method)
  4. Calculate Silhouette Coefficient for each k
  5. Visualize clusters using PCA (2D projection)
Exp 7

Hierarchical Clustering

Perform agglomerative hierarchical clustering and analyze dendrograms.

PythonScipyScikit-learn

Procedure:

  1. Compute linkage matrix using scipy.cluster.hierarchy.linkage
  2. Plot dendrogram: dendrogram()
  3. Cut dendrogram at different heights to get k clusters
  4. Compare single, complete, average linkage
  5. Evaluate with Silhouette Coefficient
Exp 8

Association Rule Mining (Apriori)

Discover frequent itemsets and generate association rules using the Apriori algorithm.

PythonmlxtendPandas

Procedure:

  1. Load transaction dataset (Market Basket)
  2. Encode data using one-hot encoding
  3. Apply Apriori with min_support threshold
  4. Generate rules with min_confidence threshold
  5. Filter rules by lift > 1 and analyze top rules
Exp 9

FP-Growth Algorithm

Implement FP-Growth and compare performance with Apriori.

Pythonmlxtend

Procedure:

  1. Load and encode transaction data (same as Exp 8)
  2. Apply FP-Growth: fpgrowth()
  3. Generate rules: association_rules()
  4. Compare execution time with Apriori
  5. Compare number of frequent itemsets found
Dashboard Annexure