classnotes RTX 4070 Ti SUPER · faster-whisper · DeepSeek

6103 - Advanced ML

← 6103 - Advanced ML

Advance Machine Learning-20260905_092416-Meeting Recording

Date 2026-09-05 Length 1h 24m Words 12,003 Segments 628
⤓ Download transcript (.txt with timestamps) ⤓ Plain transcript (.txt) ⤓ Transcript (.md)

Summary


session: "6103-advanced-ml/2026-09-05 0924 Advance Machine Learning"

title: "Advance Machine Learning"

date: "2026-09-05 09:24"

duration: "1h 24m"

language: "en"

model: "deepseek-ai/DeepSeek-V3.2"

parts: 3

transcript_chars: 59617

generated: "2026-11-23T01:45:19+05:30"


Advanced Machine Learning

Overview

This class introduced the essential Python libraries for machine learning: NumPy, pandas, matplotlib, scikit-learn, and seaborn. It focused on data visualization using matplotlib, covering basic plots, subplots, and various chart types. The session then transitioned to scikit-learn, demonstrating the complete workflow of loading a dataset (Iris), splitting data, training a k-nearest neighbors (KNN) classifier, evaluating accuracy, and making predictions. The class concluded with a brief mention of saving models. This practical session lays the foundational toolkit for implementing and visualizing machine learning models, preceding deeper dives into specific algorithms like linear regression and KNN.

Learning outcomes

Core concepts

Data Visualization with Matplotlib

Definition: Matplotlib is a low-level, open-source library for creating static, animated, and interactive visualizations in Python.

Why it matters: Visualizing data is crucial for understanding distributions, spotting patterns, and communicating results before and after model training.

Connection: It is used alongside pandas for data exploration and alongside scikit-learn for visualizing model performance (e.g., decision boundaries, error plots).

Scikit-learn Workflow

Definition: Scikit-learn is a comprehensive library providing consistent APIs for data preprocessing, model training, validation, and evaluation.

Why it matters: It standardizes the ML process, making it easier to implement, compare, and productionize algorithms.

Connection: It builds on NumPy and pandas for data handling and is the primary library used for implementing algorithms taught in the course, from linear regression to advanced models.

Train-Test Split

Definition: The practice of randomly partitioning a dataset into a subset for training the model and a separate subset for evaluating its performance.

Why it matters: It provides an unbiased estimate of model performance on unseen data, preventing overfitting.

Connection: It is a mandatory step after data loading and before model training in the scikit-learn workflow.

Model Persistence

Definition: Saving a trained model to disk (using joblib or pickle) so it can be reloaded and used for predictions without retraining.

Why it matters: It enables deployment and reuse of models, saving computational resources.

Connection: It is the final step after model training and evaluation, allowing the model to be applied to new data in the future.

Formulas and maths

(No explicit formulas or equations were presented in this class.)

Worked examples

Matplotlib Examples

1. Line Plot: x = np.arange(0, 7) generates points [0,1,2,3,4,5,6]. y = [0, 250] plots a line from (0,0) to (6,250).

2. Markers: Adding marker='o' to plt.plot(x, y) displays points on the line.

3. Labels & Title: plt.xlabel("average pulse"), plt.ylabel("calorie voltage"), plt.title("sport watch data").

4. Subplots: plt.subplot(1, 2, 1) and plt.subplot(1, 2, 2) create two plots side-by-side in a 1-row, 2-column figure.

5. Scatter Plot: plt.scatter(x, y) creates a scatter plot instead of a line plot.

6. Bar Chart: plt.bar(x, y, color='red', width=0.1) creates a red bar chart with specified bar width.

7. Histogram: x = np.random.uniform(170, 10, 100) generates 100 random values around 170. plt.hist(x) plots their frequency distribution.

8. Pie Chart: y = np.array([35, 25, 25, 15]). plt.pie(y, labels=['apple', 'banana', 'cherry', 'dates'], startangle=90, explode=(0.2, 0, 0, 0)) creates a labeled pie chart starting at 90 degrees, with the first slice ('apple') exploded out by 0.2.

Scikit-learn Workflow with Iris Dataset

1. Load Data: Iris dataset features: ['sepal length', 'sepal width', 'petal length', 'petal width']. Target names: ['setosa', 'versicolor', 'virginica'].

2. Split Data: train_test_split(X, y, test_size=0.3, random_state=42).

3. Train KNN: knn = KNeighborsClassifier(n_neighbors=3). knn.fit(X_train, y_train).

4. Evaluate: y_pred = knn.predict(X_test). accuracy_score(y_test, y_pred) returned 98.33%.

5. Predict New Samples:

Questions asked in class

Key takeaways

Exam-style questions

1. Describe the purpose of the train_test_split function in scikit-learn and explain the role of the random_state parameter.

2. Given a dataset with 150 samples, you perform train_test_split with test_size=0.3. What will be the dimensions of your X_train and X_test arrays?

3. You have trained a KNN classifier and achieved 95% accuracy on the test set. You then use the model to predict a brand new, single sample. Does this prediction affect the model's previously calculated accuracy score? Why or why not?

4. When creating a histogram, why is it incorrect to pass a single value (e.g., plt.hist(170))? What does a histogram actually represent?

Glossary

Follow-ups

Transcript

One line per segment, [hh:mm:ss] timestamp first.

loading…