1. Home
  2. Explore
  3. Computer Science
  4. Machine Learning for Beginners

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Machine Learning for Beginners

  • 40Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: Machine Learning Basics
  • spaceFlip card
  • KI knew it
  • DI didn't know it
  • ←Previous card
  • →Next card

What is machine learning?

Tap to flipClick to flipspace

A subdomain of computer science that focuses on algorithms that help a computer learn from data without explicit programming.

Or swipe the card

40 cards

  1. What is machine learning?

    A subdomain of computer science that focuses on algorithms that help a computer learn from data without explicit programming.

  2. How does AI differ from machine learning and data science?

    AI is a broader field aimed at enabling machines to perform human-like tasks. ML is a subset of AI that focuses on making predictions from data. Data science is a field that finds patterns and insights from data, often using ML.

  3. Define supervised learning.

    A type of machine learning where labeled inputs (with corresponding output labels) are used to train models to predict outputs for new, unseen inputs.

  4. Define unsupervised learning.

    A type of machine learning where unlabeled data is used to learn patterns, such as clustering or dimensionality reduction, without explicit output labels.

  5. What is reinforcement learning?

    A type of machine learning where an agent learns by interacting with an environment, receiving rewards or penalties, to maximize cumulative reward.

  6. Distinguish between features and labels in supervised learning.

    Features are the input attributes (e.g., length, width) used to make predictions. The label is the output value (e.g., class or continuous number) that the model aims to predict.

  7. What are the two main types of features based on data type?

    Qualitative (categorical) features, which can be nominal (no order) or ordinal (order). Quantitative (numerical) features, which are continuous or discrete.

  8. How do you encode nominal categorical features for machine learning?

    Using one-hot encoding, where each category becomes a binary column (1 if the sample belongs to that category, 0 otherwise).

  9. What are the two main tasks in supervised learning?

    Classification (predicting discrete classes) and regression (predicting continuous values).

  10. What is the purpose of splitting data into training, validation, and test sets?

    To evaluate how well the model generalizes to unseen data. Training set trains the model, validation set tunes hyperparameters and checks overfitting, test set gives final performance estimate.

  11. Define loss in machine learning.

    A numerical measure of the difference between the model's prediction and the true value. Lower loss indicates better performance.

  12. Write the formula for L1 loss (sum of absolute errors).

    L1=∑i=1n∣yi−y^i∣L1 = \sum_{i=1}^{n} |y_i - \hat{y}_i|L1=∑i=1n​∣yi​−y^​i​∣

  13. Write the formula for L2 loss (sum of squared errors).

    L2=∑i=1n(yi−y^i)2L2 = \sum_{i=1}^{n} (y_i - \hat{y}_i)^2L2=∑i=1n​(yi​−y^​i​)2

  14. What is the binary cross-entropy loss used for?

    It is a loss function commonly used for binary classification problems.

  15. Define accuracy, precision, recall, and F1 score.

    Accuracy = (TP+TN)/(TP+TN+FP+FN). Precision = TP/(TP+FP). Recall = TP/(TP+FN). F1 = 2*(precision*recall)/(precision+recall).

  16. Explain how K-Nearest Neighbors (KNN) works.

    KNN classifies a new point by finding the K nearest training points (using Euclidean distance) and taking the majority class among them.

  17. Write the Euclidean distance formula between two points xxx and yyy in nnn dimensions.

    d(x,y)=∑i=1n(xi−yi)2d(x,y) = \sqrt{\sum_{i=1}^{n} (x_i - y_i)^2}d(x,y)=∑i=1n​(xi​−yi​)2​

  18. State Bayes' rule.

    P(A∣B)=P(B∣A)⋅P(A)P(B)P(A|B) = \frac{P(B|A) \cdot P(A)}{P(B)}P(A∣B)=P(B)P(B∣A)⋅P(A)​

  19. What is the 'naive' assumption in Naive Bayes?

    That all features are independent given the class.

  20. What is logistic regression?

    A classification model that uses the sigmoid function to output a probability between 0 and 1. It models the log-odds as a linear combination of features.

  21. Write the sigmoid function.

    σ(x)=11+e−x\sigma(x) = \frac{1}{1 + e^{-x}}σ(x)=1+e−x1​

  22. What is the goal of a Support Vector Machine (SVM)?

    To find a hyperplane that best separates classes with maximum margin.

  23. What is the kernel trick in SVMs?

    A technique to transform data into a higher-dimensional space where it becomes linearly separable, without explicitly computing the transformation.

  24. List common activation functions used in neural networks.

    Sigmoid: 11+e−x\frac{1}{1+e^{-x}}1+e−x1​; Tanh: ex−e−xex+e−x\frac{e^x - e^{-x}}{e^x + e^{-x}}ex+e−xex−e−x​; ReLU: max⁡(0,x)\max(0, x)max(0,x).

  25. What is backpropagation?

    An algorithm that computes gradients of the loss with respect to weights using the chain rule, then updates weights via gradient descent to minimize loss.

  26. Define the learning rate in gradient descent.

    A hyperparameter that controls the step size in weight updates. If too large, the model may diverge; if too small, training is slow.

  27. What is the purpose of the linear regression line of best fit?

    To model the relationship between a dependent variable yyy and independent variable(s) xxx by minimizing the sum of squared residuals.

  28. Define residual or error in regression.

    The difference between the actual value yiy_iyi​ and the predicted value y^i\hat{y}_iy^​i​: ei=yi−y^ie_i = y_i - \hat{y}_iei​=yi​−y^​i​.

  29. What are the four assumptions of linear regression?

    Linearity (relationship is linear), Independence (observations are independent), Normality (residuals are normally distributed), Homoscedasticity (constant variance of residuals).

  30. Write the formula for Mean Absolute Error (MAE).

    MAE=1n∑i=1n∣yi−y^i∣MAE = \frac{1}{n} \sum_{i=1}^{n} |y_i - \hat{y}_i|MAE=n1​∑i=1n​∣yi​−y^​i​∣

  31. Write the formula for Mean Squared Error (MSE).

    MSE=1n∑i=1n(yi−y^i)2MSE = \frac{1}{n} \sum_{i=1}^{n} (y_i - \hat{y}_i)^2MSE=n1​∑i=1n​(yi​−y^​i​)2

  32. Write the formula for Root Mean Squared Error (RMSE).

    RMSE=1n∑i=1n(yi−y^i)2RMSE = \sqrt{\frac{1}{n} \sum_{i=1}^{n} (y_i - \hat{y}_i)^2}RMSE=n1​∑i=1n​(yi​−y^​i​)2​

  33. Write the formula for R-squared (R2R^2R2).

    R2=1−RSSTSSR^2 = 1 - \frac{RSS}{TSS}R2=1−TSSRSS​ where RSS=∑(yi−y^i)2RSS = \sum (y_i - \hat{y}_i)^2RSS=∑(yi​−y^​i​)2 and TSS=∑(yi−yˉ)2TSS = \sum (y_i - \bar{y})^2TSS=∑(yi​−yˉ​)2.

  34. How does K-Means clustering work?

    1. Choose K random centroids. 2. Assign each point to the nearest centroid. 3. Recompute centroids as the mean of assigned points. Repeat 2-3 until convergence.
  35. What is the goal of Principal Component Analysis (PCA)?

    To reduce dimensionality by finding directions (principal components) that maximize variance or minimize reconstruction error.

  36. In PCA, what does the first principal component represent?

    The direction in feature space along which the data has the largest variance.

  37. What is a confusion matrix?

    A table showing true positives, true negatives, false positives, and false negatives for a classifier.

  38. Why is scaling features important before applying gradient-based models or distance-based algorithms?

    Because features with larger scales can dominate the loss or distance calculation, leading to biased models.

  39. What is the purpose of oversampling in imbalanced datasets?

    To balance the class distribution by increasing the number of samples in the minority class, often via random duplication.

  40. What is a dropout layer in neural networks?

    A regularization technique that randomly sets a fraction of neuron outputs to zero during training to prevent overfitting.

Card 1 of 40
Card 1 of 40

Ask anything

We've read this whole study set, so questions about it get the best answers.

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent