Skip to main content

lapros data for better AI

Project description

LaPros

LaPros stands for label probability and label problems

Install

pip install lapros

How to use

The first version of LaPros will rank the suspicious labels given some trustworthy probabilies. The required inputs are a list of observed labels and a 2-dimension list of probabilities. You can use normal Python lists, Numpy arrays or Pandas Series and DataFrames. Return values are in a Numpy array or a Pandas series, the larger the value, the more suspicious are the coresponding labels.

from lapros.noise import suspect
suspect(
    [1, 0, 0, 1, 1],
    probas=[0.5, 0.6, 0.7, 0.8, 0.9],
)
2022-07-11 12:33:41.868 | DEBUG    | lapros.noise:suspect:77 - Normal Python lists
2022-07-11 12:33:41.869 | DEBUG    | lapros.noise:__rank_suspicious:22 - Numpy arrays labels and probas must have same length 5 vs 5
2022-07-11 12:33:41.869 | DEBUG    | lapros.noise:__rank_suspicious:25 - Unique labels [0 1]
2022-07-11 12:33:41.870 | DEBUG    | lapros.noise:__rank_suspicious:27 - Trying to reshape probas
2022-07-11 12:33:41.870 | DEBUG    | lapros.noise:__rank_suspicious:29 - Shape of labels and probas: (5,) vs (5, 1)
2022-07-11 12:33:41.871 | DEBUG    | lapros.noise:__rank_suspicious:37 - ranks [0.5 0.6 0.7 0.2 0.1]





[array([0.5, 0.6, 0.7, 0.2, 0.1])]
suspect(
    [1, 0, 0, 1, 1],
    probas=[[0.5, 0.6, 0.7, 0.8, 0.9]],
)
2022-07-11 12:33:41.937 | DEBUG    | lapros.noise:suspect:77 - Normal Python lists
2022-07-11 12:33:41.938 | DEBUG    | lapros.noise:__rank_suspicious:22 - Numpy arrays labels and probas must have same length 5 vs 1
2022-07-11 12:33:41.939 | DEBUG    | lapros.noise:__rank_suspicious:25 - Unique labels [0 1]
2022-07-11 12:33:41.940 | DEBUG    | lapros.noise:__rank_suspicious:27 - Trying to reshape probas
2022-07-11 12:33:41.940 | DEBUG    | lapros.noise:__rank_suspicious:29 - Shape of labels and probas: (5,) vs (5, 1)
2022-07-11 12:33:41.940 | DEBUG    | lapros.noise:__rank_suspicious:37 - ranks [0.5 0.6 0.7 0.2 0.1]





[array([0.5, 0.6, 0.7, 0.2, 0.1])]
suspect(
    np.array([1, 0, 0, 1, 1]),
    probas=np.array([0.5, 0.6, 0.7, 0.8, 0.9]),
)
2022-07-11 12:33:42.004 | DEBUG    | lapros.noise:__rank_suspicious:22 - Numpy arrays labels and probas must have same length 5 vs 5
2022-07-11 12:33:42.006 | DEBUG    | lapros.noise:__rank_suspicious:25 - Unique labels [0 1]
2022-07-11 12:33:42.006 | DEBUG    | lapros.noise:__rank_suspicious:27 - Trying to reshape probas
2022-07-11 12:33:42.007 | DEBUG    | lapros.noise:__rank_suspicious:29 - Shape of labels and probas: (5,) vs (5, 1)
2022-07-11 12:33:42.007 | DEBUG    | lapros.noise:__rank_suspicious:37 - ranks [0.5 0.6 0.7 0.2 0.1]





array([0.5, 0.6, 0.7, 0.2, 0.1])
suspect(
    pd.Series([1, 0, 0, 1, 1]),
    probas=pd.DataFrame([0.5, 0.6, 0.7, 0.8, 0.9]),
)
2022-07-11 12:33:42.063 | DEBUG    | lapros.noise:suspect:61 - Pandas series labels and dataframe probas must have same length 5 vs 5
2022-07-11 12:33:42.064 | DEBUG    | lapros.noise:__rank_suspicious:22 - Numpy arrays labels and probas must have same length 5 vs 5
2022-07-11 12:33:42.065 | DEBUG    | lapros.noise:__rank_suspicious:25 - Unique labels [0 1]
2022-07-11 12:33:42.065 | DEBUG    | lapros.noise:__rank_suspicious:29 - Shape of labels and probas: (5,) vs (5, 1)
2022-07-11 12:33:42.065 | DEBUG    | lapros.noise:__rank_suspicious:37 - ranks [0.5 0.6 0.7 0.2 0.1]





0    0.5
1    0.6
2    0.7
3    0.2
4    0.1
dtype: float64

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.0.1.tar.gz (10.7 kB view hashes)

Uploaded Source

Built Distribution

lapros-0.0.1-py3-none-any.whl (7.9 kB view hashes)

Uploaded Python 3

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