Video summary
ورود به دنیای هوش مصنوعی | جلسهی ۳ | یادگیری ماشین
Main summary
Key takeaways
Main Ideas & Lessons
1) Data is the true “fuel” of AI (and must be high-quality)
- AI value depends on data—not random text/images.
- Examples of valuable datasets:
- Medical imaging data (MRI/CT scans, etc.)
- Accounting/business records
- Web/app activity data (purchases, visited pages)
- Video/photo/conversation content (e.g., media posted online)
- Businesses often don’t realize the value of their collected data; that data can be used to train AI models.
2) Poor data quality (and missing metadata) ruins AI usefulness
- Even if data is plentiful, it must be stored correctly.
- Medical example: Students provided cases but used low-quality mobile photos of MRI/CT instead of high-resolution images → reducing AI usefulness.
- Infertility example: Images of embryos are valuable, but metadata is equally crucial:
- which embryo/image belongs to which patient
- identifiers (name/national ID), date, technique, drugs
- whether the embryo was transplanted and outcome
- Key point: Train AI with both image data and metadata.
- Practical suggestion: Start storing data today in a format usable for AI.
3) Features (X) and labels (Y) define supervised learning
Every data item has:
- Features (X): measurable inputs
- tabular data: columns
- images: pixels
- sound: time segments and signal intensity
- Labels (Y): the target to predict
Regression labels (continuous)
- Examples: house price, person height, stock price, Bitcoin price, etc.
- Goal: predict numeric values.
Classification labels (discrete)
- Examples: cat/dog, healthy/sick, disease type, etc.
Important data-storage instruction
- Ensure discrete labels are stored as proper numeric/categorical codes, not text.
- Example coding principle (illustrative):
1 = man,2 = woman, etc. (or1/2/3for disease categories)
- Avoid typos or inconsistent label numbering.
4) Generalization vs. memorization (the purpose of ML)
- ML aims to learn patterns that generalize, not merely memorize training examples.
- If you memorize last year’s exam questions, you’ll fail on new variants.
- Generalization is like high-level math contest performance—new questions require new ideas, not rote repetition.
- Example referenced: Maryam Mirzakhani’s ability to solve problems beyond seen patterns.
5) The “most important split test”: train/validation/test separation
To estimate whether a model truly generalizes, the dataset must be split.
Dataset splitting (typical approach described)
- Shuffle the dataset (like shuffling cards).
- Divide into:
- Training set: ~70%
- Validation set: ~10%
- Test set: ~20%
Purpose of each split
- Training set
- Learn model parameters (and possibly fit the model).
- Validation set
- Choose good hyperparameters (model complexity choices).
- Used for model selection by measuring prediction error on validation data.
- Test set
- Final unbiased evaluation after hyperparameters are fixed.
- Must be used only once; using it to tune models is “cheating.”
What hyperparameters mean
- Hyperparameters determine model structure/complexity, such as:
- polynomial degree (e.g., linear vs quadratic vs 10th-order)
- neural network structure:
- number of hidden layers
- number of neurons per layer
- activation function choices
- Parameters are learned from data (e.g., weights).
Overfitting concept
- Higher complexity models (e.g., very high-degree polynomial) can fit training points too well:
- training/fit error becomes tiny,
- but validation/test performance worsens.
- Overfitting = “too many clothes,” memorization rather than learning the underlying pattern.
- Therefore: choose the model with lowest validation error to promote generalization.
6) Prevent data leakage (multiple kinds)
Two major leakage problems were emphasized:
A) Duplicate/near-duplicate individuals split across sets
- If the same patient appears in both training and test (different photos/days of the same person):
- the model may memorize that person’s label
- test accuracy becomes meaningless.
- Rule given: splitting should be based on the entity (e.g., person-level), so all of one person’s images stay together in either training/validation/test.
B) Time-series leakage (shuffling destroys temporal meaning)
- For prediction tasks over time (e.g., Bitcoin price in the next 5 minutes):
- labels depend on the future relative to features.
- If you randomly shuffle rows, you may allow the model to “see the future relationship,” making test performance falsely excellent.
- Rule given: for time-series splits:
- training should only include earlier timestamps
- test should include later timestamps that were never seen
- conceptually: “train up to time T, then test on T+5min/day,” etc.
7) Loss functions / cost functions (how error is measured)
- Instead of “total error” canceling out conceptually, AI uses a loss function to quantify error.
Regression loss / cost functions described
- Mean Absolute Error (MAE)
- avoids cancellation by using absolute values:
- sum of
|y_pred - y_true|over all samples, then take the mean.
- Mean Squared Error (MSE) (referred to as mean score error)
- squares differences so negatives become positive and large errors are penalized more:
- sum of
(y_pred - y_true)^2over samples, then take the mean.
Lesson’s main point
- Choose hyperparameters/models by minimizing a validation loss/cost, and report final results using test loss.
8) Course progression: code comes next session
- The speaker states this lesson focused on concepts and definitions.
- Next session will shift to coding in practice, solving problems more hands-on (e.g., Kaggle-style tasks mentioned).
Speakers / Sources Featured
- Unnamed primary speaker: the course instructor (speaks throughout; references prior sessions and teaches ML concepts).
- Mr. Leinster Walzakh: cited as a source of a quote about talking not being valuable (the name appears distorted in subtitles).
- Maryam Mirzakhani: referenced as an example for generalization in mathematics.
- YouTube commenter(s): anonymous comment(s) said “My eyes hurt” (quoted via the instructor).
- Sarina Esmailzadeh: dedicated to (mentioned in closing).
- Taha Hoshyar: dedicated to (mentioned in closing).