lapros data for better AI
Project description
LaPros
Install
pip install -U lapros
How to use
LaPros works with classifiers. It ranks the suspicious labels given probabilies by some classification model. You can use normal Python lists, Numpy arrays or Pandas data. Return values are in a Numpy array or a Pandas series, the larger the value, the more suspicious are the coresponding labels.
from lapros import suspect
suspect
Rank the suspicious labels given probas from a classifier. Accept numpy arrays, pandas dataframes and series, and normal Python lists.
Params:
- probas: Array of shape n x m, probabilites for possible classes.
- labels: Array of shape n x 1, observed class labels
We can use interger, string or even float labels, given that the probability dataframe’s columns are indexed by the same label set.
Return
- a pandas DataFrame of one column, the magnitude of suspicious labels, valued between [0, 1], the larger the more suspicious. The index of the DataFrame indicates the index of suspicious samples.
labels = [1, 0, 0, 1, 1];
probas = [
#
[0.5, 0.6, 0.7, 0.8, 0.9],
[0.5, 0.4, 0.3, 0.2, 0.1],
];
suspect(
probas,
labels=labels,
)
<style scoped>
.dataframe tbody tr th:only-of-type {
vertical-align: middle;
}
.dataframe tbody tr th {
vertical-align: top;
}
.dataframe thead th {
text-align: right;
}
</style>
err | |
---|---|
id | |
1 | 0.566667 |
2 | 0.066667 |
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
lapros-0.1.4.tar.gz
(11.7 kB
view hashes)
Built Distribution
lapros-0.1.4-py3-none-any.whl
(11.9 kB
view hashes)