ML LAB PRACTICAL FILE WITH INDEX
INDEX
1. Linear Regression – House Price Prediction
2. Logistic Regression – Student Pass/Fail Classification
3. KNN – Iris Flower Classification
4. Decision Tree – Play Tennis Dataset
5. Random Forest – Loan Approval Prediction
6. SVM – Digit Classification
7. K-Means – Customer Segmentation
8. PCA – Dimensionality Reduction
9. Naive Bayes – SMS Spam Detection
10. Artificial Neural Network – Diabetes Prediction
--------------------------------------------
1. LINEAR REGRESSION – HOUSE PRICE PREDICTION
• Train linear regression using area/rooms.
• Predict price for new value.
Code:
from sklearn.linear_model import LinearRegression
model = LinearRegression()
2. LOGISTIC REGRESSION – PASS/FAIL
• Train logistic regression model using study hours.
• Show accuracy.
3. KNN – IRIS CLASSIFICATION
• Test different K values and compare performance.
4. DECISION TREE – PLAY TENNIS
• Train decision tree classifier.
• Visualize decision tree.
5. RANDOM FOREST – LOAN APPROVAL
• Train random forest classifier.
• Display accuracy and feature importance.
6. SVM – DIGIT CLASSIFICATION
• Train SVM using various kernels – linear, rbf, poly.
• Compare accuracy.
7. K-MEANS – CUSTOMER CLUSTERING
• Use elbow method to determine best number of clusters.
8. PCA – DIMENSIONALITY REDUCTION
• Reduce dataset to 2 components.
• Compare accuracy before & after PCA.
9. NAIVE BAYES – SMS SPAM DETECTION
• Convert text to TF-IDF.
• Train Naive Bayes & show performance metrics.
10. ARTIFICIAL NEURAL NETWORK – DIABETES PREDICTION
• Build ANN model.
• Train and plot loss vs epochs.