semvec/pypi-packages huggingface dataset:
Autora-Experimentalist-Sampler-Model-Disagreement-Sampler 1.0.0b0
Compares weaknesses in multiple models
License: MIT license
Requires Python: <4,>=3.8

# AutoRA Model Disagreement Sampler

The model disagreement sampler identifies experimental conditions $\vec{x}' \in X'$ with respect to
a pairwise distance metric between theorist models, $P_{M_{i}}(\hat{y}, \vec{x}')$:

$$
\underset{\vec{x}'}{\arg\max}~(P_{M_{1}}(\hat{y}, \vec{x}') - P_{M_{2}}(\hat{y}, \vec{x}'))^2
$$

# Example Code

```
from autora.experimentalist.sampler.model_disagreement_sampler import model_disagreement_sampler
from autora.theorist.bms import BMSRegressor; BMSRegressor()
from autora.theorist.darts import DARTSRegressor; DARTSRegressor()
import numpy as np

#Meta-Setup
X = np.linspace(start=-3, stop=6, num=10).reshape(-1, 1)
y = (X**2).reshape(-1, 1)
n = 5

#Theorists
bms_theorist = BMSRegressor()
darts_theorist = DARTSRegressor()
bms_theorist.fit(X,y)
darts_theorist.fit(X,y)

#Sampler
X_new = model_disagreement_sampler(X, [bms_theorist, darts_theorist], n)
```
Autora-Experimentalist-Sampler-Uncertainty-Sampler 1.0.0rc0
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^* = \operatorname{argmax} \left( 1-P(\hat{y}|x) \right),
$$

where $\hat{y} = \operatorname{argmax} P(y_i|x)$

## Margin

$$
x^* = \operatorname{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^* = \operatorname{argmax} \left( - \sum P(y_i|x)\operatorname{log} P(y_i|x) \right)
$$

# Example Code

```
from autora.experimentalist.sampler.uncertainty_sampler 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-Sampler 1.0.0a0
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 Model Disagreement 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_sampler 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)
```