semvec/pypi-packages huggingface dataset:
autora-experimentalist-sampler-uncertainty 1.0.1
Sampler based on where the model is least certain.
License: MIT license
Requires Python: <4,>=3.8

# AutoRA Uncertainty Sampler

The uncertainty sampler identifies experimental conditions $\vec{x}' \in X'$ with respect model uncertainty. Within the uncertainty sampler, 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.sampler.uncertainty import uncertainty_sampler
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)

#Sampler
X_new = uncertainty_sampler(X, lr_theorist, n, measure ="least_confident")
```
autora-experimentalist-sampler-nearest-value 1.0.1
A sampler which returns the nearest values between the input samples and the allowed values, without replacement.
License: MIT license
Requires Python: <4,>=3.8

# AutoRA Nearest Value Sampler

A sampler which returns the nearest values between the input samples and the allowed values, without replacement.

# Example Code

```
from autora.experimentalist.sampler.nearest_value import nearest_values_sampler
import numpy as np

#Meta-Setup
X_allowed = np.linspace(-3, 6, 10)
X = np.random.choice(X_allowed,10)
n = 5

#Sampler
X_new = nearest_values_sampler(X, X_allowed, n)
```