GradePack

    • Home
    • Blog
Skip to content
bg
bg
bg
bg

GradePack

A classifier has confusion matrix TN = 5000, FP = 50, FN = 1…

A classifier has confusion matrix TN = 5000, FP = 50, FN = 100, TP = 400. What is its PRECISION on the positive class (to 1 decimal)?

Read Details

Given a fitted logistic regression `clf`, which line returns…

Given a fitted logistic regression `clf`, which line returns the predicted CLASS LABELS (0 or 1) for X_test?

Read Details

Identify the number of protons, neutrons and electrons in an…

Identify the number of protons, neutrons and electrons in an atom of  fluorine-19

Read Details

The output of `model.predict_proba(X)` for a binary logistic…

The output of `model.predict_proba(X)` for a binary logistic regression classifier, for a single observation, is:

Read Details

A fraud-detection classifier was tested on 1,000 credit-card…

A fraud-detection classifier was tested on 1,000 credit-card transactions. Its confusion matrix is: True Negatives (TN) = 850 False Positives (FP) = 30 False Negatives (FN) = 50 True Positives (TP) = 70 In 2-3 sentences, describe what this model does WELL and what it does POORLY, and say what a fraud-operations manager should take away from these numbers. Cite specific values (or percentages derived from them) in your answer.

Read Details

Which confusion-matrix error is also called a ‘Type I error’…

Which confusion-matrix error is also called a ‘Type I error’?

Read Details

You are given a Pandas DataFrame `customer_df` with the foll…

You are given a Pandas DataFrame `customer_df` with the following columns: TenureMonths (numeric) MonthlyCharges (numeric, dollars) NumSupportCalls (integer) HasPromoCode (0 or 1) Churned (0 or 1 — the TARGET) Write a short Python script (roughly 10-15 lines) that does ALL of the following, in order: (1) Imports from sklearn everything you will need (train/test split, logistic regression, and the metrics to print a confusion matrix and a classification report). (2) Prepares the feature matrix X (using the four predictor columns) and the target y. (3) Splits the data into 80% training and 20% test, with a fixed random_state for reproducibility and with the class balance preserved in both splits. (4) Creates a LogisticRegression model (allowing enough iterations to converge, and with a setting appropriate for an imbalanced target) and fits it on the training data. (5) Uses the fitted model to produce predicted class labels on the test set. (6) Prints both the confusion matrix and the classification report for the test-set predictions. Use the exact function and method names you learned in class. Short variable names are fine.

Read Details

Given a DataFrame df with a ‘City’ column, which expression…

Given a DataFrame df with a ‘City’ column, which expression returns a Series listing how many rows fall into each city?

Read Details

Which chart type is best for comparing the average sales acr…

Which chart type is best for comparing the average sales across 5 product categories?

Read Details

Which statement about the p-value is CORRECT?

Which statement about the p-value is CORRECT?

Read Details

Posts pagination

Newer posts 1 … 33 34 35 36 37 … 82,664 Older posts

GradePack

  • Privacy Policy
  • Terms of Service
Top