## scores.RandomScore


Returns random uncertainty scores per sample.


Usage

``` python
scores.RandomScore()
```


This score assigns a random float in `[0, 1]` to each sample. It is useful as a baseline or for testing purposes. By default, the threshold is set to `0.99`, so approximately 99% of samples are selected.


## See Also

[scores.UncertaintyScore](scores.UncertaintyScore.md#seapig.scores.UncertaintyScore)  


## Methods

| Name | Description |
|----|----|
| [fit()](#fit) | Unused. |
| [score()](#score) | Compute a random uncertainty score for every sample in a batch. |
| [select()](#select) | Select samples for prediction based on their random uncertainty score. |

------------------------------------------------------------------------


#### fit()


Unused.


Usage

``` python
fit(X=None, Y=None)
```


------------------------------------------------------------------------


#### score()


Compute a random uncertainty score for every sample in a batch.


Usage

``` python
score(X)
```


Returns random scores where low values indicate likely inliers and high values indicate likely outliers.


##### Parameters


`X: torch.Tensor`  
Input batch of shape `(B, ...)`. Only the batch size is used.


##### Returns


`torch.Tensor`  
1-D tensor of shape `(B,)` with uniform random scores in `[0, 1]`.


##### Examples

``` python
import torch
from seapig.scores import RandomScore
score = RandomScore()
scores = score.score(torch.zeros(4, 10))
```

------------------------------------------------------------------------


#### select()


Select samples for prediction based on their random uncertainty score.


Usage

``` python
select(X)
```


Samples with scores lower than the threshold are selected for prediction.


##### Parameters


`X: torch.Tensor`  
Input batch of shape `(B, ...)`. Only the batch size is used.


##### Returns


`dict[str, torch.Tensor]`  
A dict with keys `'score'` (random scores) and `'selected'` (boolean mask where `True` means the sample is selected).


##### Examples

``` python
import torch
from seapig.scores import RandomScore
score = RandomScore()
result = score.select(torch.zeros(4, 10))
# result['selected'] is a boolean tensor of shape (4,)
```
