โ† All Data Science with Python Certification Flashcard Decks

Data Science with Python Supervised Learning Models Flashcards

7 cards from real Data Science with Python Certification practice questions. Tap to flip, then mark Knew It or Still Learning โ€” missed cards come back until you master them.

Read the first 7 Data Science with Python Supervised Learning Models flashcards as text
  1. Which scikit-learn parameter controls the maximum depth of a decision tree to prevent overfitting?

    Answer: max_depth

    max_depth limits how deep the tree grows, reducing overfitting by preventing the model from memorizing training data.

  2. In logistic regression, what function maps the linear output to a probability between 0 and 1?

    Answer: Sigmoid

    The sigmoid function squashes any real-valued number into the (0,1) range, making it suitable for binary classification probabilities.

  3. A Support Vector Machine with an RBF kernel has a high value of gamma. What effect does this have?

    Answer: The model overfits with a complex, tightly fitted boundary

    High gamma means each training point has a small radius of influence, causing the model to fit training data very tightly and potentially overfit.

  4. Which evaluation metric is most appropriate when false negatives are more costly than false positives, such as in cancer detection?

    Answer: Recall

    Recall (sensitivity) measures the proportion of actual positives correctly identified, minimizing missed cases (false negatives).

  5. In a Random Forest, what technique introduces randomness when building each tree?

    Answer: Bootstrap sampling and random feature subsets

    Random Forest uses bootstrap sampling of data rows and random subsets of features at each split, reducing correlation between trees.

  6. What does the C parameter control in a Support Vector Classifier?

    Answer: The trade-off between margin width and training misclassification

    A large C penalizes misclassifications heavily (low bias, high variance), while a small C allows more misclassifications for a wider margin.

  7. Which sklearn method returns both predicted class labels and their probabilities for a classifier?

    Answer: predict_proba()

    predict_proba() returns an array of shape (n_samples, n_classes) containing the probability of each class for each sample.

How this page was made: written with AI tools and published by Nathan Beja, founder of Practice Test Geeks, who is responsible for its content. We have not yet matched this exam's facts to an official source, so confirm fees, dates and rules with the exam body. Not reviewed by a subject-matter expert. Editorial policy