This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
from mlxtend.evaluate import bootstrap_point632_score | |
from sklearn.metrics import recall_score | |
from sklearn.datasets import make_classification | |
from sklearn.linear_model import LogisticRegression | |
# Create a dataset | |
X, y = make_classification(n_samples=1000, n_features=5, n_redundant=0) | |
# Add some noise to the features | |
X += np.random.normal(0, 2.5, X.shape) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
from mlxtend.evaluate import bootstrap_point632_score | |
def bootstrap_estimate_and_ci(estimator, X, y, scoring_func=None, random_seed=0, | |
method='.632', alpha=0.05, n_splits=200): | |
scores = bootstrap_point632_score(estimator, X, y, scoring_func=scoring_func, | |
n_splits=n_splits, random_seed=random_seed, | |
method=method) | |
estimate = np.mean(scores) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. The false omission rate of a test is 95% and its specificity is 95%. | |
We perform the test on a sick subject. | |
What is the probability that the test will return a positive result? | |
2. The sensitivity of a test is 95%. | |
We also know that the test's false omission rate is 85% and that these metrics were obtained | |
when the test was evaluated on a dataset where the prevalence was 5%. | |
We perform the test on a random subject, and it returns a negative result. | |
What is the probability that it is a false negative? |