Skip to main content

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


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

File details

Details for the file autora_experimentalist_uncertainty-2.1.0.tar.gz.

File metadata

File hashes

Hashes for autora_experimentalist_uncertainty-2.1.0.tar.gz
Algorithm Hash digest
SHA256 cc2126951695b536ded22333cc11854f00adf29d436693de5e3afba511283156
MD5 31f0c74c80ae867e345675d29b967412
BLAKE2b-256 47b05af998f4108a763436c67fe37de86d3556bc912645c165b3e94a7a39a561

See more details on using hashes here.

File details

Details for the file autora_experimentalist_uncertainty-2.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for autora_experimentalist_uncertainty-2.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2bab43433f31c0caa1f5a7f3ff81cc56b6d4310bdb337c30fc8013adfe800757
MD5 ef378bc140b8f7c100a0a831e4c599da
BLAKE2b-256 9a11a4737498111461853bc4f5a7e22e506eb02b3b056e9048cfe50ce8d07881

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page