Experimentalist based on where the model is least certain.
Project description
AutoRA Uncertainty Experimentalist
The uncertainty experimentalist identifies experimental conditions $\vec{x}' \in X'$ with respect model uncertainty. Within the uncertainty experimentalist, there are three methods to determine uncertainty:
Least Confident
$$ x^* = \text{argmax} \left( 1-P(\hat{y}|x) \right), $$
where $\hat{y} = \text{argmax} P(y_i|x)$
Margin
$$ x^* = \text{argmax} \left( P(\hat{y}_1|x) - P(\hat{y}_2|x) \right), $$
where $\hat{y}_1$ and $\hat{y}_2$ are the first and second most probable class labels under the model, respectively.
Entropy
$$ x^* = \text{argmax} \left( - \sum P(y_i|x)\text{log} P(y_i|x) \right) $$
Example Code
from autora.experimentalist.uncertainty import uncertainty_sample
from sklearn.linear_model import LogisticRegression
import numpy as np
#Meta-Setup
X = np.linspace(start=-3, stop=6, num=10).reshape(-1, 1)
y = (X**2).reshape(-1)
n = 5
#Theorists
lr_theorist = LogisticRegression()
lr_theorist.fit(X,y)
#Experimentalist
X_new = uncertainty_sample(X, lr_theorist, n, measure ="least_confident")
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for autora-experimentalist-uncertainty-2.0.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | a84e7b57206a4ed46c9014d86693c0fc0537682e837e14b8fc2e11fb4e9ce094 |
|
MD5 | d80fc38598b3a9099b79e5d08c11f3ff |
|
BLAKE2b-256 | 7789eed068c08cd218142b66e2f2e73625474a2c71fa3933c75c1ee6eb8c147a |
Close
Hashes for autora_experimentalist_uncertainty-2.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cee33383249aecab3f781148ea254c1dbb561cc2cb94810931644383f4ff1668 |
|
MD5 | dbe4d2d8cda66a539c1a04b06a5bcd9e |
|
BLAKE2b-256 | 98f59a26fe767ed49a0e37cb7c13b9888acf3afba1a9f369c823afbdbb09273d |