Python
import json
import numpy as np
import pandas as pd
import plotly.express as px
from plotly.subplots import make_subplots
from sklearn.metrics import roc_curve, roc_auc_score
from prompt_playground.actionclip import VARIATION_NAMES, images_features_df
from prompt_playground.actionclip_similarities import (
SimilarityParams,
TopClassificationMethod,
clips_texts_similarities,
)
Created a temporary directory at /var/folders/yc/slfs2kzs1d72wd8b20xw0nf80000gn/T/tmpzmvhzcdg
Writing /var/folders/yc/slfs2kzs1d72wd8b20xw0nf80000gn/T/tmpzmvhzcdg/_remote_module_non_scriptable.py
Python
LOCAL_STORAGE = json.loads(
'[{"text":"a human running","classification":true},{"text":"a person running","classification":true},{"text":"a picture of a human climbing a ladder","classification":true},{"text":"a video of a human approaching a fence","classification":true},{"text":"an adult running","classification":true},{"text":"bird flying around","classification":false},{"text":"black and white picture","classification":false},{"text":"black and white picture of a human","classification":true},{"text":"black and white scene of horror movie","classification":false},{"text":"change of colorimetry","classification":false},{"text":"cloudy field with a fence","classification":false},{"text":"field at midnight","classification":false},{"text":"field with green grass","classification":false},{"text":"going through a fence","classification":true},{"text":"grayscale picture of a fence","classification":false},{"text":"grayscale picture of a human","classification":true},{"text":"horror movie scene","classification":false},{"text":"human against a wall","classification":true},{"text":"human approaching a fence","classification":true},{"text":"human bending down","classification":true},{"text":"human climbing a ladder","classification":true},{"text":"human climbing a ladder on a fence","classification":true},{"text":"human cutting a fence","classification":true},{"text":"human discretely moving towards a fence","classification":true},{"text":"human holding a ladder","classification":true},{"text":"human kneeling down","classification":true},{"text":"human making small steps","classification":true},{"text":"human pick locking","classification":true},{"text":"human stepping down","classification":true},{"text":"human unlocking a door","classification":true},{"text":"human walking","classification":true},{"text":"human wearing a coat","classification":true},{"text":"human wearing dark clothes","classification":true},{"text":"human wearing light cloths","classification":true},{"text":"human wearing white cloths","classification":true},{"text":"insect flying","classification":false},{"text":"ladder leaning against a fence","classification":true},{"text":"one person","classification":true},{"text":"person creep walking","classification":true},{"text":"person crip walking","classification":true},{"text":"picture with artefacts","classification":false},{"text":"plastic bag flying","classification":false},{"text":"plastic bag laying on the floor","classification":false},{"text":"putting a knee down","classification":true},{"text":"ripping a fence","classification":true},{"text":"video with artefacts","classification":false}]'
)
TEXTS = [o["text"] for o in LOCAL_STORAGE]
TEXT_CLASSIFICATIONS = [o["classification"] for o in LOCAL_STORAGE]
Python
VARIATION = VARIATION_NAMES[1]
VARIATION
'vit-b-16-32f'
Python
similarities = clips_texts_similarities(
SimilarityParams(
texts=TEXTS,
classifications=TEXT_CLASSIFICATIONS,
model_variation=VARIATION,
text_classification_method=TopClassificationMethod.any,
texts_to_subtract=[],
apply_softmax=False,
)
).similarities
list(similarities.keys()), list(similarities.values())[0]
(['SZTRA102b13_00_00_20.mov',
'SZTEA203a_00_21_25.mov',
'SZTEA203a_00_23_52.mov',
'SZTEA102b_00_32_57.mov',
'SZTEA103a_00_26_10.mov',
'SZTRA102b06_00_00_02.mov',
'SZTEA104a_00_47_00.mov',
'SZTEA202a_00_13_50.mov',
'SZTEA202b_00_08_07.mov',
'SZTRA103a12_00_00_07.mov',
'SZTRA202b02_00_00_19.mov',
'SZTEA102b_00_15_22.mov',
'SZTRA104a13_00_00_28.mov',
'SZTEA102b_00_13_10.mov',
'SZTEA203a_00_44_22.mov',
'SZTEA202b_00_25_38.mov',
'SZTEN101c_00_18_38.mov',
'SZTRA103b10_00_01_20.mov',
'SZTEA101b_00_24_02.mov',
'SZTEA202a_00_11_16.mov',
'SZTEA202b_00_40_44.mov',
'SZTEA203a_00_39_42.mov',
'SZTEA102a_00_16_09.mov',
'SZTEA103a_00_42_09.mov',
'SZTEA102a_00_23_50.mov',
'SZTRN102a_00_31_56.mov',
'SZTRA103a16_00_00_07.mov',
'SZTEN101b_00_19_00.mov',
'SZTRN103b_00_04_32.mov',
'SZTEA102b_00_17_48.mov',
'SZTEN103b_00_02_45.mov',
'SZTEA203a_00_26_06.mov',
'SZTEN102a_00_27_24.mov',
'SZTRA203a17_00_00_10.mov',
'SZTRA103b10_00_01_19.mov',
'SZTEN102a_00_24_51.mov',
'SZTEN102a_00_36_42.mov',
'SZTEN102a_00_32_46.mov',
'SZTRA103b10_00_02_03.mov',
'SZTRA203a01_00_05_19.mov',
'SZTEN101b_00_25_21.mov',
'SZTRA103b08_00_00_05.mov',
'SZTRN103b_00_20_12.mov',
'SZTRN101b_00_22_39.mov',
'SZTEA104a_00_43_42.mov',
'SZTRN103b_00_02_08.mov',
'SZTRA103b01_00_06_13.mov',
'SZTRN101b_00_25_11.mov',
'SZTEN101d_00_10_51.mov',
'SZTEA101b_00_18_50.mov',
'SZTRA103b09_00_00_09.mov',
'SZTEN101d_00_05_46.mov',
'SZTRN103b_00_03_38.mov',
'SZTEN101c_00_16_54.mov',
'SZTEA102b_00_43_05.mov',
'SZTRA203a07_00_00_24.mov',
'SZTRA101a19_00_01_09.mov',
'SZTEN101d_00_09_31.mov',
'SZTEA201b_00_10_53.mov',
'SZTEN101b_00_12_50.mov',
'SZTRA101a01_00_01_22.mov',
'SZTEN101b_00_01_00.mov',
'SZTEN103b_00_03_56.mov',
'SZTEN102a_00_28_52.mov',
'SZTRN103b_00_22_50.mov',
'SZTEN102a_00_41_16.mov',
'SZTEN101d_00_03_50.mov',
'SZTRN101d_00_25_31.mov',
'SZTRA103b11_00_00_22.mov',
'SZTRN102d_00_01_45.mov',
'SZTEN103b_00_15_28.mov',
'SZTRA203a06_00_00_03.mov',
'SZTEA105a_00_21_25.mov',
'SZTRA103a04_00_01_33.mov',
'SZTEN103b_00_19_07.mov',
'SZTEN101d_00_01_13.mov',
'SZTEN102a_00_34_11.mov',
'SZTEN101b_00_00_16.mov',
'SZTEN101c_00_15_37.mov',
'SZTRN102a_00_11_27.mov',
'SZTRN102a_00_03_50.mov',
'SZTEA103a_00_18_38.mov',
'SZTEN101b_00_22_29.mov',
'SZTEN103b_00_16_53.mov',
'SZTEA103a_00_08_46.mov',
'SZTEA202b_00_10_41.mov',
'SZTRA203a02_00_00_08.mov',
'SZTEN103b_00_07_41.mov',
'SZTRA102b04_00_00_22.mov',
'SZTEA202a_00_34_04.mov',
'SZTRA103b15_00_02_00.mov',
'SZTRA101a01_00_07_55.mov',
'SZTEA104a_00_38_04.mov',
'SZTRA103b07_00_00_09.mov',
'SZTEA102a_00_36_18.mov',
'SZTRA103a09_00_01_46.mov',
'SZTEN101d_00_08_43.mov',
'SZTRA103b13_00_01_33.mov',
'SZTRA103a08_00_01_48.mov',
'SZTEN101d_00_12_27.mov',
'SZTEN101d_00_26_46.mov',
'SZTRA103b16_00_00_06.mov',
'SZTEA103a_00_06_17.mov',
'SZTRN102a_00_36_20.mov',
'SZTEA103a_00_13_38.mov',
'SZTEN103b_00_25_25.mov',
'SZTRA103b11_00_02_51.mov',
'SZTEN101d_00_16_23.mov',
'SZTRA103b15_00_01_29.mov',
'SZTEA203a_00_18_33.mov',
'SZTRN101b_00_22_01.mov',
'SZTRN102a_00_15_39.mov',
'SZTRA104a03_00_00_04.mov',
'SZTRA101a11_00_01_45.mov',
'SZTEA101a_00_29_31.mov',
'SZTRA104b07_00_00_19.mov',
'SZTRA103a01_00_01_33.mov',
'SZTRA101a01_00_03_32.mov',
'SZTRA101a17_00_02_19.mov',
'SZTRA101a15_00_01_59.mov',
'SZTEA102a_00_29_46.mov',
'SZTRN102a_00_22_21.mov',
'SZTRA103a10_00_00_03.mov',
'SZTEA101b_00_26_51.mov',
'SZTEN102a_00_20_58.mov',
'SZTRA103b08_00_01_05.mov',
'SZTEA103a_00_16_19.mov',
'SZTRA203a15_00_00_09.mov',
'SZTEA103a_00_31_50.mov',
'SZTRA103a12_00_01_16.mov',
'SZTRA101a31_00_02_45.mov',
'SZTRN102a_00_26_20.mov',
'SZTRA103a06_00_00_04.mov',
'SZTEA203a_00_46_41.mov',
'SZTRN102d_00_12_42.mov',
'SZTRA203a04_00_00_03.mov',
'SZTEN102a_00_00_00.mov',
'SZTRN101b_00_09_51.mov',
'SZTRA103b05_00_02_01.mov',
'SZTRA204a04_00_00_07.mov',
'SZTRA103b05_00_03_14.mov',
'SZTEN102a_00_06_55.mov',
'SZTEA102b_00_25_33.mov',
'SZTEN101d_00_24_23.mov',
'SZTEN202b_00_27_33.mov',
'SZTEA202a_00_05_01.mov',
'SZTRA103a13_00_00_05.mov',
'SZTEN101c_00_20_43.mov',
'SZTEA104a_00_41_08.mov',
'SZTRA103b06_00_00_13.mov',
'SZTRN101b_00_15_56.mov',
'SZTRA101a24_00_00_32.mov',
'SZTRA103b12_00_00_10.mov',
'SZTEA103a_00_02_24.mov',
'SZTRN101b_00_00_15.mov',
'SZTRA103a02_00_00_07.mov',
'SZTEA202b_00_30_49.mov',
'SZTRA102a04_00_01_36.mov',
'SZTRA204a02_00_00_17.mov',
'SZTEA103a_00_35_20.mov',
'SZTEA104a_01_00_46.mov',
'SZTEA201b_00_13_56.mov',
'SZTRA103b13_00_00_16.mov',
'SZTRA102b08_00_00_07.mov',
'SZTEA203a_00_16_15.mov',
'SZTEA101b_00_29_16.mov',
'SZTRN103b_00_10_42.mov',
'SZTRA103a16_00_01_25.mov',
'SZTRA103b02_00_00_12.mov',
'SZTEA104a_01_06_12.mov',
'SZTEA202a_00_31_57.mov',
'SZTRA104a14_00_01_21.mov',
'SZTEA103a_00_30_38.mov',
'SZTEA104a_00_00_00.mov',
'SZTRA103b04_00_00_15.mov',
'SZTRA104b06_00_00_10.mov',
'SZTEN102a_00_19_35.mov',
'SZTEA202b_00_05_16.mov',
'SZTRN101b_00_04_55.mov',
'SZTRA103b16_00_01_52.mov',
'SZTRN101b_00_12_36.mov',
'SZTRA102b03_00_00_14.mov',
'SZTEA103a_00_23_55.mov',
'SZTRA102a05_00_00_20.mov',
'SZTEA103a_00_28_50.mov',
'SZTEA103a_00_21_23.mov',
'SZTEA104a_00_07_11.mov',
'SZTEN102a_00_14_18.mov',
'SZTRA103b05_00_00_30.mov',
'SZTRA103a13_00_01_33.mov',
'SZTRA203a08_00_00_05.mov',
'SZTRA103a01_00_05_19.mov',
'SZTRA104a04_00_00_07.mov',
'SZTEA105a_00_16_24.mov',
'SZTRA103b09_00_01_28.mov',
'SZTRA103b10_00_00_19.mov',
'SZTEA104a_01_19_26.mov',
'SZTEA104a_01_29_50.mov',
'SZTEA102a_00_21_18.mov',
'SZTEA202a_00_26_21.mov',
'SZTRA101a04_00_02_05.mov',
'SZTRA204a07_00_00_11.mov',
'SZTRA203a03_00_00_12.mov',
'SZTRA101a02_00_01_04.mov',
'SZTEA201b_00_21_13.mov',
'SZTEN101c_00_04_18.mov',
'SZTEA104a_01_09_31.mov',
'SZTRA103a09_00_00_15.mov',
'SZTRA202b09_00_00_06.mov',
'SZTRA104a11_00_02_03.mov',
'SZTEA103a_00_34_09.mov',
'SZTRA101a01_00_04_31.mov',
'SZTRA102a02_00_00_02.mov',
'SZTEA202b_00_45_20.mov',
'SZTRA101a24_00_01_14.mov',
'SZTRA101a30_00_00_54.mov',
'SZTRA204a06_00_00_48.mov',
'SZTEA104a_01_16_14.mov',
'SZTEA201b_00_35_31.mov',
'SZTEN101c_00_00_03.mov',
'SZTRA104a10_00_00_11.mov',
'SZTEN102c_00_06_05.mov',
'SZTRA101a11_00_00_16.mov',
'SZTRN101a_00_04_14.mov',
'SZTEN101c_00_13_06.mov',
'SZTEA104a_00_30_59.mov',
'SZTEA102b_00_07_50.mov',
'SZTEA102b_00_22_49.mov',
'SZTRA202a10_00_00_08.mov',
'SZTRA102a02_00_01_50.mov',
'SZTRA203a10_00_00_02.mov',
'SZTEA103a_00_11_21.mov',
'SZTEA104a_00_12_51.mov',
'SZTEN102d_00_13_13.mov',
'SZTRA102b09_00_00_06.mov',
'SZTEA105a_00_18_56.mov',
'SZTEA102a_00_31_58.mov',
'SZTRA103a05_00_00_07.mov',
'SZTEA102a_00_08_01.mov',
'SZTRN102b_00_00_10.mov',
'SZTRA103b01_00_00_47.mov',
'SZTRA103b03_00_02_22.mov',
'SZTEN102b_00_14_55.mov',
'SZTEA202b_00_20_12.mov',
'SZTEA102b_00_05_08.mov',
'SZTRA203a09_00_00_16.mov',
'SZTRN102b_00_27_31.mov',
'SZTRA204a05_00_00_10.mov',
'SZTRA103a04_00_00_03.mov',
'SZTEA104a_00_28_38.mov',
'SZTRN102b_00_25_18.mov',
'SZTEA201b_00_07_45.mov',
'SZTEN202b_00_16_43.mov',
'SZTEN102b_00_17_15.mov',
'SZTEN101c_00_07_26.mov',
'SZTRA104b02_00_01_10.mov',
'SZTEA104a_00_25_05.mov',
'SZTRA101a29_00_01_13.mov',
'SZTEN102d_00_12_09.mov',
'SZTRA101a31_00_01_17.mov',
'SZTEN102c_00_21_55.mov',
'SZTRN102b_00_04_18.mov',
'SZTRA104b01_00_09_03.mov',
'SZTEA102a_00_05_01.mov',
'SZTRN102b_00_09_35.mov',
'SZTEN102c_00_12_50.mov',
'SZTRA101a14_00_00_09.mov',
'SZTEA101b_00_35_29.mov',
'SZTEN102b_00_01_28.mov',
'SZTEN102a_00_04_44.mov',
'SZTEA102b_00_30_44.mov',
'SZTRN102b_00_15_33.mov',
'SZTRA101a26_00_00_09.mov',
'SZTRA203a13_00_00_02.mov',
'SZTRA103b03_00_00_11.mov',
'SZTEN102b_00_24_25.mov',
'SZTRA102a08_00_00_17.mov',
'SZTRA104b09_00_00_22.mov',
'SZTRA101a01_00_08_50.mov',
'SZTRA104a07_00_01_32.mov',
'SZTEN102b_00_19_26.mov',
'SZTEA104a_00_15_58.mov',
'SZTRA204a08_00_00_19.mov',
'SZTRA102a07_00_00_58.mov',
'SZTRN102c_00_24_35.mov',
'SZTRA104a14_00_00_13.mov',
'SZTEA105a_00_29_03.mov',
'SZTRA104b08_00_00_19.mov',
'SZTRA103a08_00_00_04.mov',
'SZTRN102b_00_13_37.mov',
'SZTRA104a01_00_05_14.mov',
'SZTRA103b01_00_00_07.mov',
'SZTRA104a08_00_00_18.mov',
'SZTRN101c_00_00_48.mov',
'SZTRA104a06_00_00_46.mov',
'SZTRA103a07_00_00_11.mov',
'SZTRN201d_00_26_19.mov',
'SZTEN102c_00_01_52.mov',
'SZTEA203a_00_28_48.mov',
'SZTEA103a_00_17_34.mov',
'SZTEA104a_01_13_07.mov',
'SZTRA203b13_00_00_16.mov',
'SZTEA104a_00_35_33.mov',
'SZTEA102b_00_28_27.mov',
'SZTRA202b09_00_01_55.mov',
'SZTEN102d_00_05_42.mov',
'SZTRN102b_00_11_38.mov',
'SZTEA101b_00_48_48.mov',
'SZTEA202b_00_17_52.mov',
'SZTEA201b_00_16_17.mov',
'SZTRN102c_00_15_41.mov',
'SZTEN102c_00_14_20.mov',
'SZTRN202b_00_10_27.mov',
'SZTRA104a06_00_02_09.mov',
'SZTEN201c_00_01_12.mov',
'SZTEN102a_00_08_29.mov',
'SZTRA102b05_00_00_06.mov',
'SZTRA103b14_00_00_15.mov',
'SZTRA103b15_00_00_09.mov',
'SZTEA104a_00_57_37.mov',
'SZTRN102b_00_01_34.mov',
'SZTRA101a25_00_01_14.mov',
'SZTEA202b_00_33_01.mov',
'SZTRA101a28_00_00_58.mov',
'SZTRA104a01_00_04_18.mov',
'SZTRA203a03_00_02_10.mov',
'SZTRA102a01_00_02_40.mov',
'SZTRN101c_00_20_26.mov',
'SZTRA203a08_00_01_42.mov',
'SZTRA203a11_00_00_10.mov',
'SZTRN102c_00_27_03.mov',
'SZTEA203a_00_11_18.mov',
'SZTRA102a01_00_05_36.mov',
'SZTEN202b_00_19_11.mov',
'SZTEA102b_00_37_59.mov',
'SZTRN201d_00_06_32.mov',
'SZTRA101a09_00_00_01.mov',
'SZTRA202a05_00_00_21.mov',
'SZTEA102a_00_13_50.mov',
'SZTRA203a01_00_00_03.mov',
'SZTRA102a06_00_00_54.mov',
'SZTEA101a_00_27_58.mov',
'SZTRA102a07_00_00_02.mov',
'SZTRA103a03_00_00_12.mov',
'SZTRN202b_00_00_09.mov',
'SZTEA102b_00_20_09.mov',
'SZTEA202b_00_28_32.mov',
'SZTRN102c_00_23_10.mov',
'SZTEA105a_00_12_30.mov',
'SZTEA201b_00_32_27.mov',
'SZTRN101d_00_07_31.mov',
'SZTRA204a01_00_05_06.mov',
'SZTEN103a_00_12_08.mov',
'SZTRA101a19_00_00_06.mov',
'SZTRA203a10_00_01_22.mov',
'SZTRN102c_00_25_40.mov',
'SZTRA104a10_00_02_00.mov',
'SZTRA104a01_00_07_16.mov',
'SZTEA104a_00_49_38.mov',
'SZTEA101b_00_32_26.mov',
'SZTRA102a09_00_00_09.mov',
'SZTRA104b10_00_01_22.mov',
'SZTRA104a12_00_01_39.mov',
'SZTEN103a_00_29_26.mov',
'SZTEA102b_00_35_28.mov',
'SZTRA101a18_00_00_12.mov',
'SZTRA103a17_00_00_09.mov',
'SZTEN201a_00_01_49.mov',
'SZTEA104a_01_31_51.mov',
'SZTRA101a22_00_01_11.mov',
'SZTRN102c_00_13_04.mov',
'SZTRA104a04_00_01_23.mov',
'SZTEA201a_00_35_52.mov',
'SZTRA101a21_00_00_06.mov',
'SZTRA203a12_00_00_06.mov',
'SZTEN202b_00_05_53.mov',
'SZTEA105a_00_13_40.mov',
'SZTEA103a_00_36_41.mov',
'SZTRA203a06_00_01_26.mov',
'SZTEA102a_00_00_48.mov',
'SZTRA102b01_00_00_50.mov',
'SZTEA105a_00_10_37.mov',
'SZTEN202c_00_15_18.mov',
'SZTEN202b_00_22_47.mov',
'SZTRA104b10_00_00_40.mov',
'SZTEA105a_00_32_03.mov',
'SZTEA101b_00_38_29.mov',
'SZTRA102b01_00_04_58.mov',
'SZTRA102a01_00_02_55.mov',
'SZTRN101c_00_09_22.mov',
'SZTRA202b01_00_04_59.mov',
'SZTRN202b_00_04_27.mov',
'SZTRA101a10_00_00_15.mov',
'SZTRA102b01_00_02_10.mov',
'SZTRA104a02_00_00_17.mov',
'SZTEN202b_00_09_53.mov',
'SZTRA101a26_00_01_18.mov',
'SZTEN101c_00_01_27.mov',
'SZTEA103a_00_39_36.mov',
'SZTRA203a05_00_00_05.mov',
'SZTEA102a_00_34_05.mov',
'SZTRA204a09_00_00_37.mov',
'SZTRN101a_00_11_10.mov',
'SZTRN202b_00_23_27.mov',
'SZTRA103a14_00_00_02.mov',
'SZTEN102c_00_24_29.mov',
'SZTEA202b_00_22_54.mov',
'SZTRA104a12_00_00_08.mov',
'SZTEA101b_00_04_56.mov',
'SZTEN101c_00_10_35.mov',
'SZTRA104b07_00_01_24.mov',
'SZTRA104b03_00_00_39.mov',
'SZTEA202b_00_43_09.mov',
'SZTEA101b_00_16_17.mov',
'SZTEA103a_00_44_25.mov',
'SZTRA104a01_00_01_48.mov',
'SZTRN202b_00_18_57.mov',
'SZTEA105a_00_02_09.mov',
'SZTEA201b_00_41_49.mov',
'SZTRA102b01_00_03_35.mov',
'SZTRN201d_00_17_50.mov',
'SZTRA201a31_00_01_17.mov',
'SZTEA104a_00_21_34.mov',
'SZTRA203a14_00_00_06.mov',
'SZTEA203a_00_42_05.mov',
'SZTRA203b04_00_00_15.mov',
'SZTRN101d_00_11_28.mov',
'SZTEN102b_00_11_05.mov',
'SZTRA102b07_00_00_49.mov',
'SZTRA203a07_00_01_57.mov',
'SZTRA203a01_00_03_16.mov',
'SZTRA102a01_00_02_15.mov',
'SZTEA201b_00_06_10.mov',
'SZTEA202b_00_38_08.mov',
'SZTRA203a09_00_01_19.mov',
'SZTEA202a_00_36_15.mov',
'SZTRA103a11_00_00_14.mov',
'SZTRA101a23_00_01_10.mov',
'SZTEN103a_00_26_32.mov',
'SZTRA104b07_00_01_33.mov',
'SZTRN101c_00_11_11.mov',
'SZTRN201d_00_08_28.mov',
'SZTEA202b_00_15_26.mov',
'SZTEA101b_00_21_12.mov',
'SZTRN101d_00_01_42.mov',
'SZTEA101a_00_31_14.mov',
'SZTEA201b_00_24_00.mov',
'SZTEA201a_00_08_58.mov',
'SZTRN201d_00_16_02.mov',
'SZTRA101a13_00_00_25.mov',
'SZTEA105a_00_35_05.mov',
'SZTEA202a_00_18_58.mov',
'SZTEA104a_00_54_49.mov',
'SZTRN101a_00_05_14.mov',
'SZTRN101c_00_14_40.mov',
'SZTRA204a02_00_01_53.mov',
'SZTRA202b08_00_00_03.mov',
'SZTRN202b_00_14_30.mov',
'SZTEN202b_00_25_06.mov',
'SZTRN201d_00_07_33.mov',
'SZTEA203a_00_31_43.mov',
'SZTRA104b01_00_01_10.mov',
'SZTEN103a_00_16_13.mov',
'SZTRA104b10_00_00_20.mov',
'SZTRN101d_00_10_25.mov',
'SZTEA101b_00_07_45.mov',
'SZTRA101a12_00_00_21.mov',
'SZTRA104b04_00_02_13.mov',
'SZTEA203a_00_34_03.mov',
'SZTEA104a_01_27_12.mov',
'SZTRA202a01_00_05_36.mov',
'SZTRN201d_00_02_19.mov',
'SZTRA204a03_00_00_03.mov',
'SZTEA202b_00_13_14.mov',
'SZTRN202b_00_17_33.mov',
'SZTRN101c_00_26_16.mov',
'SZTEA104a_01_22_06.mov',
'SZTEA105a_00_26_32.mov',
'SZTRA101a27_00_00_34.mov',
'SZTEA201b_00_40_43.mov',
'SZTRA102a10_00_00_12.mov',
'SZTEA104a_00_52_17.mov',
'SZTRA104b06_00_01_09.mov',
'SZTRA102b02_00_00_17.mov',
'SZTRN202b_00_16_07.mov',
'SZTRA104b01_00_06_12.mov',
'SZTEA102b_00_40_37.mov',
'SZTRA104a07_00_00_10.mov',
'SZTRA101a05_00_00_07.mov',
'SZTEA105a_00_23_55.mov',
'SZTRN202b_00_05_15.mov',
'SZTRA102b11_00_00_12.mov',
'SZTRA102b08_00_01_54.mov',
'SZTRA202b11_00_01_18.mov',
'SZTEA102b_00_10_36.mov',
'SZTRA104b04_00_00_47.mov',
'SZTRA104a15_00_00_25.mov',
'SZTRA104b02_00_00_24.mov',
'SZTEA101b_00_13_56.mov',
'SZTEA102a_00_18_56.mov',
'SZTRN103a_00_17_58.mov',
'SZTEA104a_01_03_28.mov',
'SZTEN201a_00_05_28.mov',
'SZTRN101d_00_12_27.mov',
'SZTRA101a02_00_01_38.mov',
'SZTRN201d_00_05_04.mov',
'SZTEA201b_00_26_50.mov',
'SZTRN101c_00_14_24.mov',
'SZTEA104a_00_33_20.mov',
'SZTEN101a_00_08_14.mov',
'SZTEA201b_00_38_30.mov',
'SZTRA203b14_00_00_18.mov',
'SZTRA102a01_00_01_23.mov',
'SZTRA101a20_00_00_03.mov',
'SZTRA104b05_00_00_36.mov',
'SZTEA101b_00_45_54.mov',
'SZTRA201a24_00_01_20.mov',
'SZTEN201a_00_06_46.mov',
'SZTRA202b07_00_00_53.mov',
'SZTRN201a_00_11_57.mov',
'SZTRA103b17_00_00_12.mov',
'SZTEA102a_00_26_22.mov',
'SZTEN101a_00_00_56.mov',
'SZTRA201a28_00_00_56.mov',
'SZTEN202a_00_06_14.mov',
'SZTEA101a_00_05_37.mov',
'SZTRA201a26_00_01_18.mov',
'SZTRA104b02_00_00_08.mov',
'SZTRN103a_00_19_59.mov',
'SZTRA102b02_00_01_58.mov',
'SZTRN202c_00_19_03.mov',
'SZTRN201c_00_12_25.mov',
'SZTEN101a_00_07_17.mov',
'SZTRN103a_00_35_11.mov',
'SZTRA104a05_00_00_09.mov',
'SZTRA104b01_00_00_31.mov',
'SZTEA201b_00_18_49.mov',
'SZTRN101c_00_17_22.mov',
'SZTEA202a_00_04_31.mov',
'SZTRN103a_00_26_55.mov',
'SZTRN103a_00_28_51.mov',
'SZTRA102b12_00_00_11.mov',
'SZTRN201c_00_02_06.mov',
'SZTRA104a11_00_00_06.mov',
'SZTRA202a02_00_01_50.mov',
'SZTRA201a30_00_00_54.mov',
'SZTRN102c_00_07_53.mov',
'SZTRA202a06_00_00_54.mov',
'SZTRN101a_00_06_28.mov',
'SZTRA204a07_00_01_37.mov',
'SZTRA101a03_00_01_25.mov',
'SZTRN103a_00_34_13.mov',
'SZTRA202b05_00_01_10.mov',
'SZTRN202c_00_01_55.mov',
'SZTRN201a_00_04_07.mov',
'SZTRN101c_00_22_00.mov',
'SZTRN103a_00_22_56.mov',
'SZTEN103a_00_01_42.mov',
'SZTEN202a_00_10_10.mov',
'SZTEA104a_00_09_51.mov',
'SZTEA202a_00_16_06.mov',
'SZTRN202c_00_26_02.mov',
'SZTEA202a_00_24_52.mov',
'SZTRA202a04_00_00_09.mov',
'SZTEN201a_00_09_24.mov',
'SZTRA202b04_00_01_21.mov',
'SZTEA103a_00_46_44.mov',
'SZTEN201d_00_23_52.mov',
'SZTRA102b10_00_00_09.mov',
'SZTEA102b_00_45_14.mov',
'SZTRA202b03_00_00_15.mov',
'SZTRA103a15_00_00_06.mov',
'SZTEN202c_00_05_29.mov',
'SZTRA201a25_00_01_14.mov',
'SZTEN202c_00_04_36.mov',
'SZTRN101d_00_13_58.mov',
'SZTRN202c_00_03_05.mov',
'SZTRN201a_00_07_31.mov',
'SZTRN202c_00_15_00.mov',
'SZTRA104a09_00_00_29.mov',
'SZTEA101a_00_12_12.mov',
'SZTEN202c_00_16_47.mov',
'SZTRA202b12_00_00_12.mov',
'SZTRN201c_00_18_33.mov',
'SZTEA101a_00_08_58.mov',
'SZTRA204a06_00_02_31.mov',
'SZTEA101a_00_35_51.mov',
'SZTRA203b17_00_00_13.mov',
'SZTRA201a11_00_00_14.mov',
'SZTRN202c_00_04_17.mov',
'SZTRN101a_00_00_30.mov',
'SZTEA101b_00_10_40.mov',
'SZTEA101a_00_24_44.mov',
'SZTRN201e_00_06_06.mov',
'SZTRN101a_00_10_36.mov',
'SZTEA102a_00_11_15.mov',
'SZTRN201c_00_15_09.mov',
'SZTRA201a15_00_00_15.mov',
'SZTEA204a_01_16_10.mov',
'SZTEA202b_00_35_30.mov',
'SZTRA202b04_00_00_22.mov',
'SZTRA203b15_00_00_09.mov',
'SZTRA102b12_00_01_14.mov',
'SZTRA204a11_00_00_06.mov',
'SZTEA101a_00_17_01.mov',
'SZTEA101b_00_41_47.mov',
'SZTEA101a_00_00_42.mov',
'SZTRA203a16_00_01_27.mov',
'SZTEA203a_00_36_37.mov',
'SZTEN202c_00_00_31.mov',
'SZTRN202a_00_27_11.mov',
'SZTRN201c_00_03_50.mov',
'SZTRA201a27_00_00_31.mov',
'SZTRA202b01_00_01_09.mov',
'SZTEN201d_00_00_35.mov',
'SZTRA202b02_00_01_33.mov',
'SZTRA202a01_00_02_17.mov',
'SZTEA201b_00_29_06.mov',
'SZTRN201c_00_19_47.mov',
'SZTRA201a17_00_00_10.mov',
'SZTEA202a_00_23_48.mov',
'SZTEN101a_00_04_35.mov',
'SZTRA203a16_00_00_06.mov',
'SZTEA202a_00_21_12.mov',
'SZTRA202a01_00_04_02.mov',
'SZTRA201a29_00_01_13.mov',
'SZTEA101a_00_15_14.mov',
'SZTRN103a_00_00_59.mov',
'SZTEN201d_00_05_33.mov',
'SZTRA203b14_00_01_48.mov',
'SZTRA101a07_00_00_19.mov',
'SZTRA101a04_00_00_18.mov',
'SZTEN202c_00_03_41.mov',
'SZTEN202a_00_03_14.mov',
'SZTEA201a_00_15_15.mov',
'SZTRA101a08_00_00_04.mov',
'SZTEA101a_00_18_41.mov',
'SZTRA101a15_00_00_15.mov',
'SZTEN202a_00_00_23.mov',
'SZTEN201d_00_08_20.mov',
'SZTEN201a_00_11_48.mov',
'SZTEA104a_01_24_54.mov',
'SZTRA204a10_00_00_10.mov',
'SZTEA202a_00_08_00.mov',
'SZTEN202a_00_13_45.mov',
'SZTRA201a14_00_00_14.mov',
'SZTRN103a_00_09_40.mov',
'SZTEA101a_00_21_32.mov',
'SZTRA202a03_00_01_56.mov',
'SZTRN101d_00_16_59.mov',
'SZTEA201a_00_12_13.mov',
'SZTRN103a_00_07_06.mov',
'SZTEN202a_00_04_01.mov',
'SZTEN201e_00_06_58.mov',
'SZTRA202b01_00_03_26.mov',
'SZTRA101a06_00_00_03.mov',
'SZTRA202a01_00_00_42.mov',
'SZTRA202a08_00_02_46.mov',
'SZTEA204a_00_41_01.mov',
'SZTRA204a10_00_01_34.mov',
'SZTRA201a09_00_00_01.mov',
'SZTEA204a_00_52_12.mov',
'SZTRN201a_00_05_01.mov',
'SZTEN201e_00_05_23.mov',
'SZTRN201e_00_00_59.mov',
'SZTEN201d_00_02_31.mov',
'SZTRA202b10_00_00_09.mov',
'SZTRN201c_00_06_03.mov',
'SZTEA203a_00_04_39.mov',
'SZTRA202b06_00_00_01.mov',
'SZTRA203b11_00_02_44.mov',
'SZTRA202a07_00_00_02.mov',
'SZTRA202a08_00_00_17.mov',
'SZTEA204a_01_29_45.mov',
'SZTEN201c_00_25_40.mov',
'SZTRN201b_00_06_34.mov',
'SZTEN203a_00_03_33.mov',
'SZTEA204a_00_15_54.mov',
'SZTRN201b_00_04_55.mov',
'SZTRN201e_00_08_07.mov',
'SZTEA101a_00_04_47.mov',
'SZTRA204a13_00_00_27.mov',
'SZTEN202a_00_37_41.mov',
'SZTRA201a28_00_00_03.mov',
'SZTEA202a_00_29_43.mov',
'SZTEA204a_01_31_46.mov',
'SZTEN201d_00_18_29.mov',
'SZTEN202d_00_16_52.mov',
'SZTRN201e_00_02_26.mov',
'SZTEA204a_00_46_53.mov',
'SZTEN201e_00_02_48.mov',
'SZTRA202a03_00_00_09.mov',
'SZTEA201a_00_24_44.mov',
'SZTEN201e_00_10_39.mov',
'SZTRA203b03_00_00_26.mov',
'SZTEN202a_00_15_24.mov',
'SZTRA204a12_00_01_34.mov',
'SZTRA202b11_00_00_08.mov',
'SZTEN202a_00_18_45.mov',
'SZTRA203b16_00_00_06.mov',
'SZTRA101a17_00_00_10.mov',
'SZTRA201a29_00_00_06.mov',
'SZTEA204a_00_57_37.mov',
'SZTEA201a_00_27_58.mov',
'SZTRA201a13_00_00_26.mov',
'SZTRA204a12_00_00_07.mov',
'SZTRA202a09_00_00_04.mov',
'SZTRA201a17_00_01_48.mov',
'SZTEN202a_00_35_36.mov',
'SZTRN201e_00_12_47.mov',
'SZTRA201a01_00_08_50.mov',
'SZTEA201b_00_45_50.mov',
'SZTRN201e_00_04_57.mov',
'SZTEN202d_00_07_28.mov',
'SZTEN203a_00_17_39.mov',
'SZTEA203a_00_06_14.mov',
'SZTEA204a_00_54_48.mov',
'SZTRA203b09_00_00_08.mov',
'SZTEA204a_00_37_57.mov',
'SZTRA202b05_00_00_06.mov',
'SZTRA204a13_00_01_39.mov',
'SZTRA201a23_00_01_08.mov',
'SZTRA201a12_00_00_22.mov',
'SZTRA202a06_00_02_55.mov',
'SZTRN202d_00_09_52.mov',
'SZTRA201a10_00_00_15.mov',
'SZTRN202d_00_03_05.mov',
'SZTEN201c_00_13_25.mov',
'SZTEA201a_00_21_32.mov',
'SZTEA201a_00_31_29.mov',
'SZTRA201a07_00_00_24.mov',
'SZTEN202d_00_10_34.mov',
'SZTEN201c_00_21_02.mov',
'SZTEN203a_00_31_05.mov',
'SZTEN201c_00_11_25.mov',
'SZTEA203a_00_13_34.mov',
'SZTRN202d_00_11_17.mov',
'SZTRA201a18_00_00_15.mov',
'SZTRA202a06_00_00_30.mov',
'SZTRA204a14_00_00_09.mov',
'SZTRA102a04_00_00_09.mov',
'SZTEA204a_00_43_28.mov',
'SZTRA204a14_00_01_38.mov',
'SZTEA204a_00_49_35.mov',
'SZTRA101a16_00_00_20.mov',
'SZTEN202a_00_40_25.mov',
'SZTEN201b_00_02_15.mov',
'SZTEA201a_00_22_50.mov',
'SZTRA201a08_00_00_06.mov',
'SZTRN202d_00_12_32.mov',
'SZTRA201a03_00_01_17.mov',
'SZTEN203a_00_00_10.mov',
'SZTRA201a01_00_05_13.mov',
'SZTEN202a_00_28_49.mov',
'SZTEN201b_00_22_32.mov',
'SZTEN203a_00_25_49.mov',
'SZTEA204a_00_28_33.mov',
'SZTEA204a_01_00_41.mov',
'SZTRA201a31_00_02_23.mov',
'SZTRN201b_00_09_23.mov',
'SZTRA201a06_00_00_03.mov',
'SZTEN201b_00_24_46.mov',
'SZTRA203b10_00_00_17.mov',
'SZTRN203a_00_00_45.mov',
'SZTRA204a15_00_00_24.mov',
'SZTEN201c_00_14_41.mov',
'SZTRA201a10_00_01_22.mov',
'SZTEA204a_01_03_22.mov',
'SZTRA201a07_00_02_02.mov',
'SZTRN202d_00_08_18.mov',
'SZTEA204a_00_30_54.mov',
'SZTRA201a16_00_00_15.mov',
'SZTEA204a_01_09_28.mov',
'SZTEA204a_01_19_21.mov',
'SZTRA203b03_00_02_38.mov',
'SZTRN203a_00_10_40.mov',
'SZTRA204a15_00_01_05.mov',
'SZTRA203b02_00_00_12.mov',
'SZTEN203a_00_35_51.mov',
'SZTEA204a_01_26_20.mov',
'SZTEA204a_01_13_00.mov',
'SZTRA201a20_00_01_38.mov',
'SZTRA203b01_00_00_21.mov',
'SZTEA204a_00_07_06.mov',
'SZTRN202a_00_24_30.mov',
'SZTRA203b11_00_00_13.mov',
'SZTEA204a_01_27_06.mov',
'SZTRN201b_00_25_57.mov',
'SZTRA202b13_00_00_19.mov',
'SZTEN201b_00_18_03.mov',
'SZTRN201b_00_14_19.mov',
'SZTRA202a04_00_01_22.mov',
'SZTRA201a01_00_01_06.mov',
'SZTEA204a_00_12_54.mov',
'SZTRN202a_00_14_58.mov',
'SZTRA201a05_00_00_09.mov',
'SZTRN202a_00_18_05.mov',
'SZTRA201a14_00_02_47.mov',
'SZTEA204a_01_21_56.mov',
'SZTEA104a_00_18_52.mov',
'SZTEN201b_00_12_30.mov',
'SZTEA204a_00_33_15.mov',
'SZTRA201a22_00_01_10.mov',
'SZTEA201a_00_05_35.mov',
'SZTEA203a_00_08_42.mov',
'SZTEN202d_00_10_10.mov',
'SZTRA201a21_00_00_06.mov',
'SZTEA204a_01_06_08.mov',
'SZTEN201b_00_06_49.mov',
'SZTRA201a01_00_06_19.mov',
'SZTRA203b05_00_00_43.mov',
'SZTRA201a13_00_01_38.mov',
'SZTRA201a01_00_02_43.mov',
'SZTEA204a_01_24_45.mov',
'SZTRA102a03_00_00_11.mov',
'SZTEA201a_00_18_41.mov',
'SZTRN202d_00_03_35.mov',
'SZTRA203b08_00_01_06.mov',
'SZTRA201a01_00_07_21.mov',
'SZTRA204a15_00_01_29.mov',
'SZTRN202a_00_01_02.mov',
'SZTEA201b_00_48_48.mov',
'SZTRA203b02_00_02_12.mov',
'SZTEA204a_00_25_07.mov',
'SZTEN202d_00_19_50.mov',
'SZTEA204a_00_09_45.mov',
'SZTRA201a02_00_00_06.mov',
'SZTRA203b10_00_01_48.mov',
'SZTEA204a_00_18_41.mov',
'SZTRA201a02_00_01_38.mov',
'SZTRA201a04_00_01_46.mov',
'SZTRA201a04_00_00_16.mov',
'SZTRA201a05_00_01_59.mov',
'SZTRN201b_00_22_08.mov',
'SZTRA203b06_00_01_27.mov',
'SZTRA203b02_00_01_57.mov',
'SZTRA203b12_00_00_10.mov',
'SZTRA203b07_00_00_09.mov',
'SZTRN202a_00_11_12.mov',
'SZTRA203b05_00_02_01.mov',
'SZTEA204a_00_35_29.mov',
'SZTEA201a_00_00_16.mov',
'SZTRA203b13_00_01_28.mov',
'SZTRN202a_00_11_46.mov',
'SZTRA203b01_00_02_33.mov',
'SZTRA203b15_00_01_56.mov',
'SZTEA201a_00_06_51.mov',
'SZTRA201a20_00_00_02.mov',
'SZTRA203b08_00_00_05.mov',
'SZTEA204a_00_21_29.mov',
'SZTRN202a_00_02_52.mov',
'SZTRA203b15_00_01_40.mov',
'SZTEN201b_00_10_14.mov',
'SZTRA203b01_00_06_13.mov',
'SZTRA201a19_00_00_06.mov',
'SZTRA203b06_00_00_13.mov',
'SZTEN202a_00_22_37.mov',
'SZTRA203b13_00_02_23.mov',
'SZTRA203b16_00_01_15.mov'],
[ClipSimilarity(text='human climbing a ladder on a fence', classification=True, similarity=0.29738786816596985),
ClipSimilarity(text='ladder leaning against a fence', classification=True, similarity=0.2910667955875397),
ClipSimilarity(text='human climbing a ladder', classification=True, similarity=0.2722422182559967),
ClipSimilarity(text='a picture of a human climbing a ladder', classification=True, similarity=0.2717447280883789),
ClipSimilarity(text='human holding a ladder', classification=True, similarity=0.2708641290664673),
ClipSimilarity(text='human cutting a fence', classification=True, similarity=0.2545849680900574),
ClipSimilarity(text='human discretely moving towards a fence', classification=True, similarity=0.24132955074310303),
ClipSimilarity(text='going through a fence', classification=True, similarity=0.23344074189662933),
ClipSimilarity(text='a video of a human approaching a fence', classification=True, similarity=0.23164501786231995),
ClipSimilarity(text='human approaching a fence', classification=True, similarity=0.23143544793128967),
ClipSimilarity(text='cloudy field with a fence', classification=False, similarity=0.22934524714946747),
ClipSimilarity(text='grayscale picture of a fence', classification=False, similarity=0.22067207098007202),
ClipSimilarity(text='human against a wall', classification=True, similarity=0.20839564502239227),
ClipSimilarity(text='ripping a fence', classification=True, similarity=0.1993856132030487),
ClipSimilarity(text='human wearing light cloths', classification=True, similarity=0.18789789080619812),
ClipSimilarity(text='human unlocking a door', classification=True, similarity=0.18621651828289032),
ClipSimilarity(text='person creep walking', classification=True, similarity=0.17750699818134308),
ClipSimilarity(text='insect flying', classification=False, similarity=0.17567391693592072),
ClipSimilarity(text='change of colorimetry', classification=False, similarity=0.17455320060253143),
ClipSimilarity(text='one person', classification=True, similarity=0.17450594902038574),
ClipSimilarity(text='field at midnight', classification=False, similarity=0.17325203120708466),
ClipSimilarity(text='field with green grass', classification=False, similarity=0.17027802765369415),
ClipSimilarity(text='human pick locking', classification=True, similarity=0.1696421355009079),
ClipSimilarity(text='human making small steps', classification=True, similarity=0.1695183962583542),
ClipSimilarity(text='grayscale picture of a human', classification=True, similarity=0.16647958755493164),
ClipSimilarity(text='black and white scene of horror movie', classification=False, similarity=0.16539160907268524),
ClipSimilarity(text='human stepping down', classification=True, similarity=0.16417959332466125),
ClipSimilarity(text='person crip walking', classification=True, similarity=0.1628001183271408),
ClipSimilarity(text='human kneeling down', classification=True, similarity=0.1613774448633194),
ClipSimilarity(text='horror movie scene', classification=False, similarity=0.16073685884475708),
ClipSimilarity(text='human walking', classification=True, similarity=0.1604146659374237),
ClipSimilarity(text='human wearing a coat', classification=True, similarity=0.1594875454902649),
ClipSimilarity(text='video with artefacts', classification=False, similarity=0.15898731350898743),
ClipSimilarity(text='picture with artefacts', classification=False, similarity=0.15870694816112518),
ClipSimilarity(text='black and white picture of a human', classification=True, similarity=0.15710760653018951),
ClipSimilarity(text='human wearing white cloths', classification=True, similarity=0.15623575448989868),
ClipSimilarity(text='black and white picture', classification=False, similarity=0.15532320737838745),
ClipSimilarity(text='an adult running', classification=True, similarity=0.15290750563144684),
ClipSimilarity(text='a person running', classification=True, similarity=0.15242403745651245),
ClipSimilarity(text='putting a knee down', classification=True, similarity=0.15070852637290955),
ClipSimilarity(text='bird flying around', classification=False, similarity=0.15065544843673706),
ClipSimilarity(text='a human running', classification=True, similarity=0.15051360428333282),
ClipSimilarity(text='plastic bag flying', classification=False, similarity=0.14311353862285614),
ClipSimilarity(text='human wearing dark clothes', classification=True, similarity=0.1401837170124054),
ClipSimilarity(text='human bending down', classification=True, similarity=0.13714884221553802),
ClipSimilarity(text='plastic bag laying on the floor', classification=False, similarity=0.09037552028894424)])
First Clip experiment
Python
clip0 = next(iter(similarities.keys()))
similarities0 = pd.DataFrame(
[similarity.dict() for similarity in similarities[clip0]]
).sort_values("classification")
similarities0
| text | classification | similarity | |
|---|---|---|---|
| 45 | plastic bag laying on the floor | False | 0.0903755 |
| 21 | field with green grass | False | 0.170278 |
| 20 | field at midnight | False | 0.173252 |
| 29 | horror movie scene | False | 0.160737 |
| 18 | change of colorimetry | False | 0.174553 |
| 17 | insect flying | False | 0.175674 |
| 32 | video with artefacts | False | 0.158987 |
| 33 | picture with artefacts | False | 0.158707 |
| 11 | grayscale picture of a fence | False | 0.220672 |
| 10 | cloudy field with a fence | False | 0.229345 |
| 25 | black and white scene of horror movie | False | 0.165392 |
| 36 | black and white picture | False | 0.155323 |
| 40 | bird flying around | False | 0.150655 |
| 42 | plastic bag flying | False | 0.143114 |
| 26 | human stepping down | True | 0.16418 |
| 37 | an adult running | True | 0.152908 |
| 38 | a person running | True | 0.152424 |
| 31 | human wearing a coat | True | 0.159488 |
| 30 | human walking | True | 0.160415 |
| 39 | putting a knee down | True | 0.150709 |
| 41 | a human running | True | 0.150514 |
| 43 | human wearing dark clothes | True | 0.140184 |
| 28 | human kneeling down | True | 0.161377 |
| 27 | person crip walking | True | 0.1628 |
| 35 | human wearing white cloths | True | 0.156236 |
| 34 | black and white picture of a human | True | 0.157108 |
| 0 | human climbing a ladder on a fence | True | 0.297388 |
| 23 | human making small steps | True | 0.169518 |
| 1 | ladder leaning against a fence | True | 0.291067 |
| 2 | human climbing a ladder | True | 0.272242 |
| 3 | a picture of a human climbing a ladder | True | 0.271745 |
| 4 | human holding a ladder | True | 0.270864 |
| 5 | human cutting a fence | True | 0.254585 |
| 6 | human discretely moving towards a fence | True | 0.24133 |
| 7 | going through a fence | True | 0.233441 |
| 24 | grayscale picture of a human | True | 0.16648 |
| 8 | a video of a human approaching a fence | True | 0.231645 |
| 12 | human against a wall | True | 0.208396 |
| 13 | ripping a fence | True | 0.199386 |
| 14 | human wearing light cloths | True | 0.187898 |
| 15 | human unlocking a door | True | 0.186217 |
| 16 | person creep walking | True | 0.177507 |
| 19 | one person | True | 0.174506 |
| 44 | human bending down | True | 0.137149 |
| 9 | human approaching a fence | True | 0.231435 |
| 22 | human pick locking | True | 0.169642 |
Python
groupby_classification = similarities0.groupby("classification")["similarity"]
weighted_similarity = groupby_classification.sum() / groupby_classification.count()
weighted_similarity
classification
False 0.166219
True 0.195024
Name: similarity, dtype: float64
Python
weighted_similarity.loc[True] / weighted_similarity.loc[False]
1.1732981050769506
Python
groupby_classification.count()
classification
False 14
True 32
Name: similarity, dtype: int64
Apply ratio on entire dataset
Python
alarms_series = images_features_df(VARIATION)["Alarm"]
df = (
pd.DataFrame(
[
dict(clip=clip, y_true=alarms_series[clip], **v.dict())
for clip, l in similarities.items()
for v in l
]
)
.rename(columns={"classification": "y_predict"})
.sort_values(["clip", "y_true", "y_predict", "text"])
.reset_index(drop=True)
)
df.head(5)
| clip | y_true | text | y_predict | similarity | |
|---|---|---|---|---|---|
| 0 | SZTEA101a_00_00_42.mov | False | bird flying around | False | 0.144516 |
| 1 | SZTEA101a_00_00_42.mov | False | black and white picture | False | 0.159767 |
| 2 | SZTEA101a_00_00_42.mov | False | black and white scene of horror movie | False | 0.16728 |
| 3 | SZTEA101a_00_00_42.mov | False | change of colorimetry | False | 0.155367 |
| 4 | SZTEA101a_00_00_42.mov | False | cloudy field with a fence | False | 0.181464 |
Python
unique_y_true = df["y_true"].unique()
fig = make_subplots(
rows=1,
cols=4,
column_widths=[0.3, 0.2, 0.3, 0.2],
shared_yaxes=True,
y_title="similarity",
subplot_titles=[f"y_true={y_true}" for y_true in unique_y_true for _ in range(2)],
)
# group by
# 1. y_true (facet)
# 2. y_predict / text class (color)
for i, y_true in enumerate(unique_y_true):
facet_df = df[df["y_true"] == y_true]
for y_predict, class_color in zip(
sorted(facet_df["y_predict"].unique()), ["CornflowerBlue", "Tomato"]
):
facet_color_df = facet_df[facet_df["y_predict"] == y_predict]
violin_side = "positive" if y_predict else "negative"
fig.add_scatter(
x=facet_color_df["text"],
y=facet_color_df["similarity"],
marker=dict(color=class_color, size=3),
hovertext=facet_color_df["clip"],
mode="markers",
name=f"y_predict={str(y_predict)}",
legendgroup=f"y_true={str(y_true)}",
legendgrouptitle=dict(text=f"y_true={str(y_true)}"),
row=1,
col=i * 2 + 1,
)
fig.update_layout(**{f"xaxis{i*2+1}": dict(title="text")})
fig.add_violin(
x=np.repeat(str(y_true), len(facet_color_df)),
y=facet_color_df["similarity"],
box=dict(visible=True),
scalegroup=str(y_true),
scalemode="count",
width=1,
meanline=dict(visible=True),
side=violin_side,
marker=dict(color=class_color),
showlegend=False,
row=1,
col=i * 2 + 2,
)
fig.update_layout(height=900, violingap=0, violinmode="overlay")
fig.show()
Python
fig = px.scatter(
ratio_df.sort_values(["y_true", "ratio"]),
y="ratio",
color="y_true",
render_mode="line",
marginal_y="violin",
height=900,
)
fig.show()
Python
fpr, tpr, thresholds = roc_curve(ratio_df["y_true"], ratio_df["ratio"])
auc_score = roc_auc_score(ratio_df["y_true"], ratio_df["ratio"])
Python
roc_df = pd.DataFrame(
{
"False Positive Rate": fpr,
"True Positive Rate": tpr,
"Threshold": thresholds
},
columns=pd.Index(["False Positive Rate", "True Positive Rate", "Threshold"], name="Rate"),
index=pd.Index(thresholds, name="Thresholds"),
)
px.line(
roc_df,
x="False Positive Rate",
y="True Positive Rate",
hover_data=["Threshold"],
title=f"{VARIATION} - AUC: {auc_score:.5f}",
color_discrete_sequence=["orange"],
range_x=[0, 1],
range_y=[0, 1],
width=600,
height=450,
).add_shape(type="line", line=dict(dash="dash"), x0=0, x1=1, y0=0, y1=1)
Python
from sklearn.metrics import precision_recall_curve
precision, recall, thresholds = precision_recall_curve(ratio_df["y_true"], ratio_df["ratio"])
Python
precision
array([0.50291036, 0.5034965 , 0.50408401, 0.5046729 , 0.50526316,
0.5058548 , 0.50644783, 0.50704225, 0.50763807, 0.50823529,
0.50883392, 0.50943396, 0.51003542, 0.5106383 , 0.5112426 ,
0.51184834, 0.51126928, 0.51187648, 0.51248514, 0.51309524,
0.51370679, 0.51431981, 0.51373955, 0.51435407, 0.51377246,
0.51318945, 0.51380552, 0.51322115, 0.51383875, 0.51325301,
0.51387214, 0.51449275, 0.51511487, 0.5157385 , 0.51515152,
0.5157767 , 0.5164034 , 0.51703163, 0.51766139, 0.51829268,
0.51892552, 0.5195599 , 0.52019584, 0.52083333, 0.5202454 ,
0.52088452, 0.52152522, 0.52216749, 0.52281134, 0.52222222,
0.52286774, 0.52351485, 0.52416357, 0.5248139 , 0.52546584,
0.5261194 , 0.5267746 , 0.52743142, 0.52808989, 0.52875 ,
0.52941176, 0.52882206, 0.52948557, 0.53015075, 0.52955975,
0.52896725, 0.5296343 , 0.53030303, 0.52970923, 0.53037975,
0.52978454, 0.53045685, 0.53113088, 0.53053435, 0.53121019,
0.53188776, 0.53256705, 0.53324808, 0.53393086, 0.53333333,
0.53401797, 0.53470437, 0.53539254, 0.53608247, 0.53677419,
0.53617571, 0.53686934, 0.53756477, 0.538262 , 0.53896104,
0.5396619 , 0.5390625 , 0.53976532, 0.54046997, 0.54117647,
0.54188482, 0.54259502, 0.54330709, 0.54402102, 0.54473684,
0.54545455, 0.54485488, 0.54557464, 0.5462963 , 0.54569536,
0.5464191 , 0.54581673, 0.54654255, 0.54727031, 0.548 ,
0.54873164, 0.54946524, 0.5502008 , 0.55093834, 0.55167785,
0.55241935, 0.55316285, 0.55390836, 0.55465587, 0.55540541,
0.55615697, 0.55691057, 0.55766621, 0.55706522, 0.55782313,
0.55722071, 0.5579809 , 0.55874317, 0.55813953, 0.55890411,
0.55967078, 0.56043956, 0.56121045, 0.56198347, 0.56275862,
0.5621547 , 0.5615491 , 0.56232687, 0.5631068 , 0.56388889,
0.56328234, 0.56406685, 0.56485356, 0.56564246, 0.56643357,
0.56582633, 0.56661992, 0.56741573, 0.56680731, 0.56760563,
0.56840621, 0.56779661, 0.56718529, 0.56657224, 0.56595745,
0.56534091, 0.56614509, 0.56695157, 0.56633381, 0.56714286,
0.56795422, 0.56876791, 0.56814921, 0.56896552, 0.56834532,
0.56916427, 0.56998557, 0.57080925, 0.57163531, 0.57246377,
0.57184325, 0.57267442, 0.5720524 , 0.57142857, 0.57080292,
0.57163743, 0.57101025, 0.57038123, 0.5712188 , 0.57058824,
0.57142857, 0.57227139, 0.57311669, 0.57248521, 0.57333333,
0.57418398, 0.57355126, 0.57440476, 0.5752608 , 0.5761194 ,
0.5754858 , 0.57634731, 0.57721139, 0.57807808, 0.57744361,
0.57831325, 0.57767722, 0.57854985, 0.57942511, 0.57878788,
0.57966616, 0.58054711, 0.57990868, 0.58079268, 0.58015267,
0.58103976, 0.58039816, 0.5797546 , 0.58064516, 0.58 ,
0.58089368, 0.58024691, 0.57959815, 0.57894737, 0.57984496,
0.57919255, 0.5785381 , 0.57943925, 0.58034321, 0.58125 ,
0.58215962, 0.5830721 , 0.58398744, 0.58490566, 0.58582677,
0.5851735 , 0.58609795, 0.58702532, 0.58795563, 0.58730159,
0.58664547, 0.58598726, 0.58692185, 0.58626198, 0.5856 ,
0.5849359 , 0.58426966, 0.585209 , 0.58615137, 0.58709677,
0.58642973, 0.58737864, 0.58833063, 0.58766234, 0.58861789,
0.58794788, 0.58727569, 0.58660131, 0.58756137, 0.58688525,
0.5862069 , 0.58552632, 0.58649094, 0.58580858, 0.58512397,
0.58443709, 0.58374793, 0.58305648, 0.58236273, 0.58333333,
0.58263773, 0.5819398 , 0.58291457, 0.58389262, 0.58487395,
0.58417508, 0.58347386, 0.58277027, 0.5820643 , 0.58305085,
0.58404075, 0.58333333, 0.58262351, 0.58361775, 0.58461538,
0.58561644, 0.58662093, 0.58591065, 0.58519793, 0.5862069 ,
0.58549223, 0.58477509, 0.58578856, 0.58680556, 0.58608696,
0.58536585, 0.58464223, 0.58391608, 0.58318739, 0.58421053,
0.58347979, 0.58274648, 0.58377425, 0.58480565, 0.5840708 ,
0.58333333, 0.58259325, 0.58185053, 0.58110517, 0.58035714,
0.57960644, 0.58064516, 0.57989228, 0.57913669, 0.57837838,
0.57942238, 0.57866184, 0.57971014, 0.57894737, 0.57818182,
0.57741348, 0.57664234, 0.57586837, 0.57509158, 0.57614679,
0.57536765, 0.57642726, 0.57749077, 0.5767098 , 0.57592593,
0.57513915, 0.57434944, 0.57541899, 0.57649254, 0.57757009,
0.57677903, 0.57598499, 0.57518797, 0.57438795, 0.5754717 ,
0.57655955, 0.57575758, 0.57685009, 0.57604563, 0.5752381 ,
0.57442748, 0.57552581, 0.57471264, 0.57581574, 0.57692308,
0.5761079 , 0.57528958, 0.57446809, 0.57364341, 0.57475728,
0.57392996, 0.57309942, 0.57226562, 0.57338552, 0.57254902,
0.57170923, 0.57086614, 0.57199211, 0.57114625, 0.57227723,
0.5734127 , 0.57256461, 0.57171315, 0.57085828, 0.572 ,
0.57314629, 0.57228916, 0.57344064, 0.57258065, 0.57373737,
0.57287449, 0.57200811, 0.57317073, 0.57433809, 0.5755102 ,
0.57464213, 0.57377049, 0.57289528, 0.57201646, 0.57113402,
0.57231405, 0.57349896, 0.57261411, 0.57172557, 0.57291667,
0.57411273, 0.57322176, 0.57232704, 0.57142857, 0.57052632,
0.56962025, 0.56871036, 0.56991525, 0.56900212, 0.57021277,
0.56929638, 0.56837607, 0.56745182, 0.56866953, 0.56774194,
0.56896552, 0.57019438, 0.57142857, 0.57049892, 0.56956522,
0.56862745, 0.569869 , 0.56892779, 0.56798246, 0.56703297,
0.5660793 , 0.56732892, 0.56858407, 0.56984479, 0.57111111,
0.5701559 , 0.57142857, 0.57270694, 0.57174888, 0.57078652,
0.56981982, 0.56884876, 0.57013575, 0.569161 , 0.56818182,
0.56947608, 0.57077626, 0.56979405, 0.57110092, 0.57241379,
0.57142857, 0.5704388 , 0.57175926, 0.57308585, 0.57209302,
0.57342657, 0.57476636, 0.57377049, 0.57511737, 0.57411765,
0.5754717 , 0.57446809, 0.57582938, 0.57482185, 0.57380952,
0.575179 , 0.57416268, 0.57314149, 0.57211538, 0.57108434,
0.57004831, 0.56900726, 0.56796117, 0.56934307, 0.56829268,
0.56968215, 0.56862745, 0.56756757, 0.56650246, 0.56790123,
0.56930693, 0.56823821, 0.56716418, 0.56608479, 0.565 ,
0.56641604, 0.56532663, 0.56423174, 0.56313131, 0.56202532,
0.56091371, 0.55979644, 0.56122449, 0.5601023 , 0.55897436,
0.55784062, 0.55670103, 0.55555556, 0.55699482, 0.55584416,
0.55729167, 0.55613577, 0.55497382, 0.55643045, 0.55526316,
0.55672823, 0.55555556, 0.55702918, 0.55585106, 0.55733333,
0.55614973, 0.55495979, 0.55645161, 0.55525606, 0.55405405,
0.55284553, 0.55434783, 0.55585831, 0.55464481, 0.55616438,
0.55769231, 0.55922865, 0.56077348, 0.56232687, 0.56111111,
0.56267409, 0.56424581, 0.56582633, 0.56741573, 0.56901408,
0.56779661, 0.5694051 , 0.56818182, 0.56695157, 0.56857143,
0.57020057, 0.57183908, 0.57060519, 0.56936416, 0.56811594,
0.56976744, 0.57142857, 0.57017544, 0.56891496, 0.57058824,
0.57227139, 0.5739645 , 0.57566766, 0.57440476, 0.57313433,
0.57185629, 0.57057057, 0.56927711, 0.56797583, 0.56969697,
0.56838906, 0.56707317, 0.56880734, 0.56748466, 0.56923077,
0.57098765, 0.56965944, 0.57142857, 0.57320872, 0.575 ,
0.57366771, 0.57232704, 0.57413249, 0.57278481, 0.57142857,
0.57006369, 0.5686901 , 0.56730769, 0.5659164 , 0.56774194,
0.56957929, 0.56818182, 0.57003257, 0.57189542, 0.5704918 ,
0.57236842, 0.57425743, 0.57284768, 0.57142857, 0.57333333,
0.57190635, 0.5704698 , 0.56902357, 0.56756757, 0.56610169,
0.56802721, 0.5665529 , 0.56849315, 0.57044674, 0.56896552,
0.57093426, 0.56944444, 0.56794425, 0.56643357, 0.56842105,
0.57042254, 0.57243816, 0.57446809, 0.57295374, 0.57142857,
0.56989247, 0.56834532, 0.566787 , 0.56521739, 0.56727273,
0.56934307, 0.56776557, 0.56617647, 0.56826568, 0.56666667,
0.56505576, 0.56343284, 0.56554307, 0.56390977, 0.56603774,
0.56439394, 0.56273764, 0.5648855 , 0.56321839, 0.56153846,
0.55984556, 0.5620155 , 0.56420233, 0.56640625, 0.56470588,
0.56299213, 0.56521739, 0.56349206, 0.56175299, 0.56 ,
0.55823293, 0.55645161, 0.55870445, 0.56097561, 0.55918367,
0.55737705, 0.55967078, 0.55785124, 0.5560166 , 0.55416667,
0.55230126, 0.55042017, 0.55274262, 0.55084746, 0.54893617,
0.55128205, 0.54935622, 0.54741379, 0.54978355, 0.55217391,
0.55458515, 0.55263158, 0.55066079, 0.54867257, 0.54666667,
0.54464286, 0.5470852 , 0.54954955, 0.54751131, 0.54545455,
0.543379 , 0.5412844 , 0.53917051, 0.54166667, 0.53953488,
0.53738318, 0.53521127, 0.53773585, 0.54028436, 0.53809524,
0.54066986, 0.53846154, 0.5410628 , 0.53883495, 0.53658537,
0.53921569, 0.53694581, 0.53960396, 0.54228856, 0.54 ,
0.54271357, 0.54545455, 0.54314721, 0.54081633, 0.54358974,
0.54639175, 0.54404145, 0.546875 , 0.54450262, 0.54210526,
0.54497354, 0.54255319, 0.54545455, 0.54301075, 0.54054054,
0.54347826, 0.54098361, 0.54395604, 0.54696133, 0.55 ,
0.54748603, 0.54494382, 0.54237288, 0.53977273, 0.54285714,
0.54022989, 0.53757225, 0.53488372, 0.5380117 , 0.54117647,
0.53846154, 0.53571429, 0.53293413, 0.53614458, 0.53333333,
0.5304878 , 0.53374233, 0.53703704, 0.53416149, 0.5375 ,
0.5408805 , 0.5443038 , 0.54140127, 0.53846154, 0.53548387,
0.53246753, 0.53594771, 0.53947368, 0.53642384, 0.54 ,
0.54362416, 0.5472973 , 0.54421769, 0.54109589, 0.53793103,
0.53472222, 0.53146853, 0.52816901, 0.5248227 , 0.52857143,
0.5323741 , 0.53623188, 0.53284672, 0.53676471, 0.53333333,
0.53731343, 0.54135338, 0.53787879, 0.53435115, 0.53846154,
0.53488372, 0.53125 , 0.52755906, 0.53174603, 0.528 ,
0.53225806, 0.52845528, 0.52459016, 0.52066116, 0.51666667,
0.5210084 , 0.52542373, 0.52136752, 0.51724138, 0.51304348,
0.50877193, 0.51327434, 0.50892857, 0.51351351, 0.50909091,
0.51376147, 0.50925926, 0.51401869, 0.50943396, 0.51428571,
0.51923077, 0.52427184, 0.52941176, 0.53465347, 0.53 ,
0.52525253, 0.52040816, 0.51546392, 0.52083333, 0.52631579,
0.5212766 , 0.51612903, 0.51086957, 0.51648352, 0.52222222,
0.52808989, 0.53409091, 0.54022989, 0.53488372, 0.52941176,
0.52380952, 0.51807229, 0.52439024, 0.51851852, 0.525 ,
0.51898734, 0.51282051, 0.50649351, 0.5 , 0.50666667,
0.5 , 0.49315068, 0.5 , 0.49295775, 0.48571429,
0.49275362, 0.48529412, 0.47761194, 0.48484848, 0.49230769,
0.5 , 0.50793651, 0.51612903, 0.50819672, 0.5 ,
0.49152542, 0.5 , 0.49122807, 0.5 , 0.49090909,
0.48148148, 0.47169811, 0.46153846, 0.45098039, 0.44 ,
0.42857143, 0.4375 , 0.42553191, 0.41304348, 0.42222222,
0.40909091, 0.39534884, 0.38095238, 0.36585366, 0.35 ,
0.33333333, 0.31578947, 0.2972973 , 0.30555556, 0.28571429,
0.29411765, 0.27272727, 0.25 , 0.22580645, 0.23333333,
0.20689655, 0.21428571, 0.22222222, 0.19230769, 0.16 ,
0.125 , 0.08695652, 0.09090909, 0.0952381 , 0.05 ,
0.05263158, 0. , 0. , 0. , 0. ,
0. , 0. , 0. , 0. , 0. ,
0. , 0. , 0. , 0. , 0. ,
0. , 0. , 0. , 0. , 1. ])
Python
recall
array([1. , 1. , 1. , 1. , 1. ,
1. , 1. , 1. , 1. , 1. ,
1. , 1. , 1. , 1. , 1. ,
1. , 0.99768519, 0.99768519, 0.99768519, 0.99768519,
0.99768519, 0.99768519, 0.99537037, 0.99537037, 0.99305556,
0.99074074, 0.99074074, 0.98842593, 0.98842593, 0.98611111,
0.98611111, 0.98611111, 0.98611111, 0.98611111, 0.9837963 ,
0.9837963 , 0.9837963 , 0.9837963 , 0.9837963 , 0.9837963 ,
0.9837963 , 0.9837963 , 0.9837963 , 0.9837963 , 0.98148148,
0.98148148, 0.98148148, 0.98148148, 0.98148148, 0.97916667,
0.97916667, 0.97916667, 0.97916667, 0.97916667, 0.97916667,
0.97916667, 0.97916667, 0.97916667, 0.97916667, 0.97916667,
0.97916667, 0.97685185, 0.97685185, 0.97685185, 0.97453704,
0.97222222, 0.97222222, 0.97222222, 0.96990741, 0.96990741,
0.96759259, 0.96759259, 0.96759259, 0.96527778, 0.96527778,
0.96527778, 0.96527778, 0.96527778, 0.96527778, 0.96296296,
0.96296296, 0.96296296, 0.96296296, 0.96296296, 0.96296296,
0.96064815, 0.96064815, 0.96064815, 0.96064815, 0.96064815,
0.96064815, 0.95833333, 0.95833333, 0.95833333, 0.95833333,
0.95833333, 0.95833333, 0.95833333, 0.95833333, 0.95833333,
0.95833333, 0.95601852, 0.95601852, 0.95601852, 0.9537037 ,
0.9537037 , 0.95138889, 0.95138889, 0.95138889, 0.95138889,
0.95138889, 0.95138889, 0.95138889, 0.95138889, 0.95138889,
0.95138889, 0.95138889, 0.95138889, 0.95138889, 0.95138889,
0.95138889, 0.95138889, 0.95138889, 0.94907407, 0.94907407,
0.94675926, 0.94675926, 0.94675926, 0.94444444, 0.94444444,
0.94444444, 0.94444444, 0.94444444, 0.94444444, 0.94444444,
0.94212963, 0.93981481, 0.93981481, 0.93981481, 0.93981481,
0.9375 , 0.9375 , 0.9375 , 0.9375 , 0.9375 ,
0.93518519, 0.93518519, 0.93518519, 0.93287037, 0.93287037,
0.93287037, 0.93055556, 0.92824074, 0.92592593, 0.92361111,
0.9212963 , 0.9212963 , 0.9212963 , 0.91898148, 0.91898148,
0.91898148, 0.91898148, 0.91666667, 0.91666667, 0.91435185,
0.91435185, 0.91435185, 0.91435185, 0.91435185, 0.91435185,
0.91203704, 0.91203704, 0.90972222, 0.90740741, 0.90509259,
0.90509259, 0.90277778, 0.90046296, 0.90046296, 0.89814815,
0.89814815, 0.89814815, 0.89814815, 0.89583333, 0.89583333,
0.89583333, 0.89351852, 0.89351852, 0.89351852, 0.89351852,
0.8912037 , 0.8912037 , 0.8912037 , 0.8912037 , 0.88888889,
0.88888889, 0.88657407, 0.88657407, 0.88657407, 0.88425926,
0.88425926, 0.88425926, 0.88194444, 0.88194444, 0.87962963,
0.87962963, 0.87731481, 0.875 , 0.875 , 0.87268519,
0.87268519, 0.87037037, 0.86805556, 0.86574074, 0.86574074,
0.86342593, 0.86111111, 0.86111111, 0.86111111, 0.86111111,
0.86111111, 0.86111111, 0.86111111, 0.86111111, 0.86111111,
0.8587963 , 0.8587963 , 0.8587963 , 0.8587963 , 0.85648148,
0.85416667, 0.85185185, 0.85185185, 0.84953704, 0.84722222,
0.84490741, 0.84259259, 0.84259259, 0.84259259, 0.84259259,
0.84027778, 0.84027778, 0.84027778, 0.83796296, 0.83796296,
0.83564815, 0.83333333, 0.83101852, 0.83101852, 0.8287037 ,
0.82638889, 0.82407407, 0.82407407, 0.82175926, 0.81944444,
0.81712963, 0.81481481, 0.8125 , 0.81018519, 0.81018519,
0.80787037, 0.80555556, 0.80555556, 0.80555556, 0.80555556,
0.80324074, 0.80092593, 0.79861111, 0.7962963 , 0.7962963 ,
0.7962963 , 0.79398148, 0.79166667, 0.79166667, 0.79166667,
0.79166667, 0.79166667, 0.78935185, 0.78703704, 0.78703704,
0.78472222, 0.78240741, 0.78240741, 0.78240741, 0.78009259,
0.77777778, 0.77546296, 0.77314815, 0.77083333, 0.77083333,
0.76851852, 0.7662037 , 0.7662037 , 0.7662037 , 0.76388889,
0.76157407, 0.75925926, 0.75694444, 0.75462963, 0.75231481,
0.75 , 0.75 , 0.74768519, 0.74537037, 0.74305556,
0.74305556, 0.74074074, 0.74074074, 0.73842593, 0.73611111,
0.7337963 , 0.73148148, 0.72916667, 0.72685185, 0.72685185,
0.72453704, 0.72453704, 0.72453704, 0.72222222, 0.71990741,
0.71759259, 0.71527778, 0.71527778, 0.71527778, 0.71527778,
0.71296296, 0.71064815, 0.70833333, 0.70601852, 0.70601852,
0.70601852, 0.7037037 , 0.7037037 , 0.70138889, 0.69907407,
0.69675926, 0.69675926, 0.69444444, 0.69444444, 0.69444444,
0.69212963, 0.68981481, 0.6875 , 0.68518519, 0.68518519,
0.68287037, 0.68055556, 0.67824074, 0.67824074, 0.67592593,
0.67361111, 0.6712963 , 0.6712963 , 0.66898148, 0.66898148,
0.66898148, 0.66666667, 0.66435185, 0.66203704, 0.66203704,
0.66203704, 0.65972222, 0.65972222, 0.65740741, 0.65740741,
0.65509259, 0.65277778, 0.65277778, 0.65277778, 0.65277778,
0.65046296, 0.64814815, 0.64583333, 0.64351852, 0.6412037 ,
0.6412037 , 0.6412037 , 0.63888889, 0.63657407, 0.63657407,
0.63657407, 0.63425926, 0.63194444, 0.62962963, 0.62731481,
0.625 , 0.62268519, 0.62268519, 0.62037037, 0.62037037,
0.61805556, 0.61574074, 0.61342593, 0.61342593, 0.61111111,
0.61111111, 0.61111111, 0.61111111, 0.6087963 , 0.60648148,
0.60416667, 0.60416667, 0.60185185, 0.59953704, 0.59722222,
0.59490741, 0.59490741, 0.59490741, 0.59490741, 0.59490741,
0.59259259, 0.59259259, 0.59259259, 0.59027778, 0.58796296,
0.58564815, 0.58333333, 0.58333333, 0.58101852, 0.5787037 ,
0.5787037 , 0.5787037 , 0.57638889, 0.57638889, 0.57638889,
0.57407407, 0.57175926, 0.57175926, 0.57175926, 0.56944444,
0.56944444, 0.56944444, 0.56712963, 0.56712963, 0.56481481,
0.56481481, 0.5625 , 0.5625 , 0.56018519, 0.55787037,
0.55787037, 0.55555556, 0.55324074, 0.55092593, 0.54861111,
0.5462963 , 0.54398148, 0.54166667, 0.54166667, 0.53935185,
0.53935185, 0.53703704, 0.53472222, 0.53240741, 0.53240741,
0.53240741, 0.53009259, 0.52777778, 0.52546296, 0.52314815,
0.52314815, 0.52083333, 0.51851852, 0.5162037 , 0.51388889,
0.51157407, 0.50925926, 0.50925926, 0.50694444, 0.50462963,
0.50231481, 0.5 , 0.49768519, 0.49768519, 0.49537037,
0.49537037, 0.49305556, 0.49074074, 0.49074074, 0.48842593,
0.48842593, 0.48611111, 0.48611111, 0.4837963 , 0.4837963 ,
0.48148148, 0.47916667, 0.47916667, 0.47685185, 0.47453704,
0.47222222, 0.47222222, 0.47222222, 0.46990741, 0.46990741,
0.46990741, 0.46990741, 0.46990741, 0.46990741, 0.46759259,
0.46759259, 0.46759259, 0.46759259, 0.46759259, 0.46759259,
0.46527778, 0.46527778, 0.46296296, 0.46064815, 0.46064815,
0.46064815, 0.46064815, 0.45833333, 0.45601852, 0.4537037 ,
0.4537037 , 0.4537037 , 0.45138889, 0.44907407, 0.44907407,
0.44907407, 0.44907407, 0.44907407, 0.44675926, 0.44444444,
0.44212963, 0.43981481, 0.4375 , 0.43518519, 0.43518519,
0.43287037, 0.43055556, 0.43055556, 0.42824074, 0.42824074,
0.42824074, 0.42592593, 0.42592593, 0.42592593, 0.42592593,
0.42361111, 0.4212963 , 0.4212963 , 0.41898148, 0.41666667,
0.41435185, 0.41203704, 0.40972222, 0.40740741, 0.40740741,
0.40740741, 0.40509259, 0.40509259, 0.40509259, 0.40277778,
0.40277778, 0.40277778, 0.40046296, 0.39814815, 0.39814815,
0.39583333, 0.39351852, 0.3912037 , 0.38888889, 0.38657407,
0.38657407, 0.38425926, 0.38425926, 0.38425926, 0.38194444,
0.38194444, 0.37962963, 0.37731481, 0.375 , 0.375 ,
0.375 , 0.375 , 0.375 , 0.37268519, 0.37037037,
0.36805556, 0.36574074, 0.36342593, 0.36111111, 0.36111111,
0.36111111, 0.3587963 , 0.35648148, 0.35648148, 0.35416667,
0.35185185, 0.34953704, 0.34953704, 0.34722222, 0.34722222,
0.34490741, 0.34259259, 0.34259259, 0.34027778, 0.33796296,
0.33564815, 0.33564815, 0.33564815, 0.33564815, 0.33333333,
0.33101852, 0.33101852, 0.3287037 , 0.32638889, 0.32407407,
0.32175926, 0.31944444, 0.31944444, 0.31944444, 0.31712963,
0.31481481, 0.31481481, 0.3125 , 0.31018519, 0.30787037,
0.30555556, 0.30324074, 0.30324074, 0.30092593, 0.29861111,
0.29861111, 0.2962963 , 0.29398148, 0.29398148, 0.29398148,
0.29398148, 0.29166667, 0.28935185, 0.28703704, 0.28472222,
0.28240741, 0.28240741, 0.28240741, 0.28009259, 0.27777778,
0.27546296, 0.27314815, 0.27083333, 0.27083333, 0.26851852,
0.2662037 , 0.26388889, 0.26388889, 0.26388889, 0.26157407,
0.26157407, 0.25925926, 0.25925926, 0.25694444, 0.25462963,
0.25462963, 0.25231481, 0.25231481, 0.25231481, 0.25 ,
0.25 , 0.25 , 0.24768519, 0.24537037, 0.24537037,
0.24537037, 0.24305556, 0.24305556, 0.24074074, 0.23842593,
0.23842593, 0.23611111, 0.23611111, 0.2337963 , 0.23148148,
0.23148148, 0.22916667, 0.22916667, 0.22916667, 0.22916667,
0.22685185, 0.22453704, 0.22222222, 0.21990741, 0.21990741,
0.21759259, 0.21527778, 0.21296296, 0.21296296, 0.21296296,
0.21064815, 0.20833333, 0.20601852, 0.20601852, 0.2037037 ,
0.20138889, 0.20138889, 0.20138889, 0.19907407, 0.19907407,
0.19907407, 0.19907407, 0.19675926, 0.19444444, 0.19212963,
0.18981481, 0.18981481, 0.18981481, 0.1875 , 0.1875 ,
0.1875 , 0.1875 , 0.18518519, 0.18287037, 0.18055556,
0.17824074, 0.17592593, 0.17361111, 0.1712963 , 0.1712963 ,
0.1712963 , 0.1712963 , 0.16898148, 0.16898148, 0.16666667,
0.16666667, 0.16666667, 0.16435185, 0.16203704, 0.16203704,
0.15972222, 0.15740741, 0.15509259, 0.15509259, 0.15277778,
0.15277778, 0.15046296, 0.14814815, 0.14583333, 0.14351852,
0.14351852, 0.14351852, 0.1412037 , 0.13888889, 0.13657407,
0.13425926, 0.13425926, 0.13194444, 0.13194444, 0.12962963,
0.12962963, 0.12731481, 0.12731481, 0.125 , 0.125 ,
0.125 , 0.125 , 0.125 , 0.125 , 0.12268519,
0.12037037, 0.11805556, 0.11574074, 0.11574074, 0.11574074,
0.11342593, 0.11111111, 0.1087963 , 0.1087963 , 0.1087963 ,
0.1087963 , 0.1087963 , 0.1087963 , 0.10648148, 0.10416667,
0.10185185, 0.09953704, 0.09953704, 0.09722222, 0.09722222,
0.09490741, 0.09259259, 0.09027778, 0.08796296, 0.08796296,
0.08564815, 0.08333333, 0.08333333, 0.08101852, 0.0787037 ,
0.0787037 , 0.07638889, 0.07407407, 0.07407407, 0.07407407,
0.07407407, 0.07407407, 0.07407407, 0.07175926, 0.06944444,
0.06712963, 0.06712963, 0.06481481, 0.06481481, 0.0625 ,
0.06018519, 0.05787037, 0.05555556, 0.05324074, 0.05092593,
0.04861111, 0.04861111, 0.0462963 , 0.04398148, 0.04398148,
0.04166667, 0.03935185, 0.03703704, 0.03472222, 0.03240741,
0.03009259, 0.02777778, 0.02546296, 0.02546296, 0.02314815,
0.02314815, 0.02083333, 0.01851852, 0.0162037 , 0.0162037 ,
0.01388889, 0.01388889, 0.01388889, 0.01157407, 0.00925926,
0.00694444, 0.00462963, 0.00462963, 0.00462963, 0.00231481,
0.00231481, 0. , 0. , 0. , 0. ,
0. , 0. , 0. , 0. , 0. ,
0. , 0. , 0. , 0. , 0. ,
0. , 0. , 0. , 0. , 0. ])
Python
thresholds
array([0.8577905 , 0.86491984, 0.86952407, 0.87051329, 0.8759551 ,
0.88708555, 0.89975147, 0.90380444, 0.90500865, 0.90799679,
0.91561904, 0.91861862, 0.91868188, 0.91887232, 0.92106572,
0.93077436, 0.93086052, 0.93585175, 0.93691061, 0.93737198,
0.93772696, 0.93854784, 0.94010189, 0.94074262, 0.94086645,
0.94256252, 0.94269882, 0.94343543, 0.94467168, 0.94577336,
0.94613755, 0.94632769, 0.94668614, 0.94706569, 0.94717835,
0.94770426, 0.94870519, 0.94916096, 0.94921334, 0.94929758,
0.94974094, 0.94985051, 0.95018839, 0.9509275 , 0.95121413,
0.95133778, 0.95138138, 0.95143606, 0.95152871, 0.95198803,
0.95319302, 0.95433013, 0.95435403, 0.95438661, 0.95452487,
0.95504335, 0.95622062, 0.95627739, 0.95640976, 0.95655998,
0.95687132, 0.95757152, 0.95808095, 0.95852441, 0.9591682 ,
0.9596501 , 0.95967884, 0.95976579, 0.95988972, 0.96078548,
0.9614686 , 0.96154994, 0.96200911, 0.9629689 , 0.96366461,
0.96381708, 0.96391707, 0.9645085 , 0.96456866, 0.96504448,
0.96509813, 0.96552613, 0.96594895, 0.96642924, 0.96645046,
0.96664878, 0.96688983, 0.96691686, 0.9672349 , 0.96750432,
0.96773712, 0.96801369, 0.96806674, 0.96847182, 0.96878215,
0.96885193, 0.96977684, 0.96999526, 0.97040673, 0.97054062,
0.97057288, 0.97065619, 0.97103613, 0.9716003 , 0.97167726,
0.97207354, 0.9724697 , 0.97262256, 0.97277717, 0.97287099,
0.9729401 , 0.97305219, 0.97316465, 0.97319766, 0.97334837,
0.97398574, 0.97407122, 0.97438511, 0.97445339, 0.97473761,
0.97483834, 0.97486621, 0.9750311 , 0.97538236, 0.97540854,
0.97588725, 0.97619565, 0.97690489, 0.97717769, 0.97726218,
0.97779885, 0.97780675, 0.97783636, 0.97848237, 0.97949984,
0.97966233, 0.97994193, 0.98006828, 0.9803803 , 0.98049088,
0.98049895, 0.98099096, 0.98104807, 0.98109172, 0.98113023,
0.98150653, 0.98201133, 0.98208884, 0.9827767 , 0.98279359,
0.98280214, 0.98308178, 0.98326459, 0.98353396, 0.98389055,
0.98390007, 0.98414773, 0.98440394, 0.98451912, 0.98452914,
0.98454324, 0.98457443, 0.98463904, 0.98518268, 0.98539508,
0.98553029, 0.98562149, 0.98565974, 0.98592138, 0.98595594,
0.98602158, 0.98603884, 0.98631568, 0.98653934, 0.98662485,
0.98711869, 0.98716244, 0.98727972, 0.98731799, 0.98736024,
0.98736263, 0.98803613, 0.98813019, 0.98850995, 0.98876985,
0.98975993, 0.98981279, 0.99011509, 0.99053994, 0.99088362,
0.9910763 , 0.99110502, 0.9916813 , 0.99217809, 0.9921937 ,
0.99220301, 0.99264255, 0.99270873, 0.99281244, 0.99344096,
0.99346979, 0.99355111, 0.99387919, 0.99388031, 0.99390137,
0.99469927, 0.99491156, 0.99507129, 0.9951505 , 0.99526907,
0.99535992, 0.99548007, 0.99572992, 0.9957495 , 0.99582944,
0.99585602, 0.99587218, 0.99614197, 0.99624518, 0.996258 ,
0.99629063, 0.99668861, 0.99703336, 0.99706645, 0.9972262 ,
0.99765435, 0.99765763, 0.99796394, 0.99797234, 0.99860832,
0.99876395, 0.99885704, 0.99918251, 0.99921504, 0.9992949 ,
0.9993479 , 0.99957016, 0.99961645, 0.99978354, 0.99988257,
1.00062559, 1.00084758, 1.00107687, 1.00124514, 1.00172259,
1.00198358, 1.00283285, 1.00292066, 1.00358223, 1.00361012,
1.00381574, 1.00415094, 1.00443719, 1.00455209, 1.00480696,
1.00535615, 1.00535848, 1.00578243, 1.00583095, 1.00606485,
1.00646204, 1.00665351, 1.00672791, 1.00686851, 1.00754527,
1.00785057, 1.008071 , 1.00868409, 1.00886839, 1.00923677,
1.00924015, 1.00938803, 1.0095747 , 1.00965435, 1.01095784,
1.01117087, 1.0112006 , 1.01136772, 1.01209194, 1.0121139 ,
1.01247275, 1.01270053, 1.01294157, 1.01297992, 1.01352121,
1.01362972, 1.01405394, 1.01446107, 1.01450365, 1.01463254,
1.01513554, 1.01514464, 1.01525722, 1.01525989, 1.01553341,
1.01581606, 1.01594379, 1.01616712, 1.0169452 , 1.01702739,
1.01710503, 1.01762361, 1.01789426, 1.01792762, 1.01815067,
1.0181649 , 1.01817082, 1.01869965, 1.01885719, 1.01895146,
1.01935181, 1.01948226, 1.01977023, 1.01996725, 1.02004391,
1.02015918, 1.0204488 , 1.02054076, 1.0211514 , 1.02120033,
1.02156116, 1.02187137, 1.02199752, 1.02202556, 1.02218675,
1.02223286, 1.02285075, 1.02316227, 1.02324006, 1.02327253,
1.02371335, 1.02384546, 1.02401176, 1.02423211, 1.02430177,
1.02430744, 1.02434542, 1.02449771, 1.024765 , 1.02512196,
1.02524021, 1.02541017, 1.02552444, 1.02567282, 1.02569816,
1.02571098, 1.02575921, 1.02613331, 1.02649766, 1.0266447 ,
1.02664887, 1.02669766, 1.02680343, 1.02691909, 1.02718848,
1.0274026 , 1.02745555, 1.02745667, 1.02753999, 1.02757842,
1.02762156, 1.02768791, 1.02815601, 1.02826719, 1.02869157,
1.02881309, 1.0288195 , 1.02901967, 1.02945549, 1.0296909 ,
1.03001088, 1.03020929, 1.03035414, 1.03036452, 1.03045319,
1.03063791, 1.03073978, 1.0308386 , 1.03092087, 1.03107935,
1.03145716, 1.03149944, 1.03153761, 1.03155083, 1.03164129,
1.03178906, 1.0321146 , 1.03248888, 1.03251565, 1.03263597,
1.03267782, 1.03272921, 1.03280411, 1.03291429, 1.03297867,
1.03301373, 1.03334015, 1.03336561, 1.0334082 , 1.03367261,
1.03383954, 1.03385304, 1.03404424, 1.03413378, 1.03418902,
1.03424606, 1.03445718, 1.03475502, 1.03506418, 1.03528217,
1.03538291, 1.03548399, 1.03577025, 1.03577089, 1.0358245 ,
1.03606731, 1.03613796, 1.03628692, 1.03634354, 1.03640165,
1.03649381, 1.03652781, 1.03659703, 1.03672696, 1.03693617,
1.03702369, 1.03730261, 1.03731847, 1.03733056, 1.03751629,
1.03763736, 1.0377916 , 1.03785473, 1.03791385, 1.03817118,
1.03818678, 1.03841731, 1.03892971, 1.03932886, 1.03963237,
1.03972338, 1.0398607 , 1.03988348, 1.03993013, 1.04039421,
1.04056481, 1.04066765, 1.04067624, 1.04092862, 1.04114381,
1.04135511, 1.04146166, 1.04177925, 1.04208108, 1.04228346,
1.04232569, 1.04238619, 1.04260332, 1.04286911, 1.04313981,
1.04318016, 1.04319516, 1.04329121, 1.04344429, 1.04352579,
1.04386637, 1.0439529 , 1.04417806, 1.04432197, 1.04446111,
1.04454676, 1.04472178, 1.04482752, 1.04503684, 1.04507931,
1.04508999, 1.04515959, 1.04543724, 1.04558578, 1.04560387,
1.04590664, 1.04615974, 1.04684138, 1.0469094 , 1.04703743,
1.0470838 , 1.04711615, 1.04729717, 1.04761186, 1.04798642,
1.04814183, 1.04821735, 1.04852162, 1.04854297, 1.04854692,
1.0487817 , 1.04892565, 1.0490041 , 1.04902719, 1.0492232 ,
1.04929272, 1.04933105, 1.04971183, 1.05028812, 1.05034435,
1.05050052, 1.05058712, 1.05063235, 1.05066347, 1.05066634,
1.05075124, 1.05112751, 1.05123213, 1.05145502, 1.05167267,
1.05170593, 1.05172229, 1.05184018, 1.05214262, 1.05240938,
1.05247705, 1.05257836, 1.05276512, 1.0531036 , 1.0532078 ,
1.05367063, 1.05372616, 1.05379166, 1.05460758, 1.05494012,
1.05494773, 1.05522241, 1.05530378, 1.05558388, 1.05572993,
1.0562575 , 1.05640784, 1.056657 , 1.05677964, 1.05704723,
1.05720847, 1.05738924, 1.05741051, 1.05814788, 1.05849247,
1.05857253, 1.05873939, 1.05880265, 1.05880659, 1.05887085,
1.058877 , 1.05898573, 1.05913554, 1.05929867, 1.05936022,
1.05943911, 1.05958609, 1.05979836, 1.05988327, 1.06018429,
1.06055546, 1.0608109 , 1.06125264, 1.06130862, 1.06153609,
1.06160647, 1.06170934, 1.06195157, 1.06212998, 1.06213163,
1.06244925, 1.06244992, 1.06256 , 1.06293898, 1.0629413 ,
1.06299094, 1.06304339, 1.06348272, 1.06375367, 1.06375769,
1.06418874, 1.06436824, 1.06446326, 1.06447317, 1.06487598,
1.06500313, 1.06522749, 1.0654264 , 1.06572119, 1.06577767,
1.06583279, 1.06617572, 1.06643803, 1.0666195 , 1.06697725,
1.06715486, 1.06727877, 1.06738727, 1.06741317, 1.06756353,
1.06757595, 1.06762213, 1.06772496, 1.06834307, 1.06843025,
1.06857095, 1.06864209, 1.06898412, 1.06923508, 1.06947841,
1.06951176, 1.06952716, 1.07006092, 1.07040668, 1.07087227,
1.0709446 , 1.0714793 , 1.07181221, 1.07183664, 1.07229475,
1.07272378, 1.07289905, 1.07304653, 1.07330627, 1.07335019,
1.07338763, 1.07345727, 1.07374778, 1.07437506, 1.07454498,
1.0746095 , 1.07500504, 1.07501614, 1.07515599, 1.07528193,
1.07543961, 1.07549421, 1.07576575, 1.07598779, 1.0761499 ,
1.07631286, 1.07634342, 1.07677466, 1.0768132 , 1.07735575,
1.07768346, 1.07788892, 1.07809431, 1.07822239, 1.07823132,
1.07880036, 1.07908079, 1.07948418, 1.0794878 , 1.07951887,
1.07985582, 1.08008008, 1.08016577, 1.08028247, 1.08029019,
1.08060439, 1.0810672 , 1.08123433, 1.0813929 , 1.08160258,
1.08177315, 1.08184301, 1.08188794, 1.08226949, 1.08236305,
1.08266088, 1.08322855, 1.08386094, 1.08391 , 1.08414627,
1.08417496, 1.08441243, 1.08462561, 1.08513602, 1.08551903,
1.08561844, 1.08592923, 1.08624548, 1.0869521 , 1.08722414,
1.08771562, 1.08774737, 1.08786659, 1.087963 , 1.0880408 ,
1.08852669, 1.08908295, 1.08939065, 1.08944841, 1.08996295,
1.09014001, 1.09045189, 1.0905706 , 1.09132293, 1.09179925,
1.09194899, 1.09201109, 1.09209296, 1.0922574 , 1.09228639,
1.09263303, 1.09264782, 1.09265694, 1.09278529, 1.09284148,
1.09352842, 1.09424809, 1.09475471, 1.09498575, 1.09499602,
1.09507909, 1.09546306, 1.0954792 , 1.09573951, 1.09659181,
1.09702815, 1.09703442, 1.0974813 , 1.09750605, 1.09800791,
1.0981739 , 1.09875257, 1.09935698, 1.09945469, 1.09963864,
1.10041665, 1.10045272, 1.10075016, 1.10123817, 1.10188382,
1.10218107, 1.10235385, 1.10243374, 1.10246377, 1.10314752,
1.10317805, 1.10323712, 1.10404374, 1.10423868, 1.10455744,
1.10475028, 1.10493743, 1.10500969, 1.10532116, 1.10553193,
1.10553626, 1.10581575, 1.10646129, 1.10711553, 1.10720392,
1.10747694, 1.10794641, 1.10821627, 1.10857123, 1.10861657,
1.10922255, 1.10932071, 1.109465 , 1.10967366, 1.11008163,
1.11027342, 1.11044222, 1.11088889, 1.11096955, 1.11116562,
1.11184696, 1.11184795, 1.11188682, 1.11216828, 1.11220899,
1.11228018, 1.11270038, 1.11281861, 1.11306464, 1.11309873,
1.11396715, 1.11399132, 1.11436047, 1.11467336, 1.11467385,
1.11506262, 1.11544708, 1.11599508, 1.11605035, 1.11624582,
1.11625591, 1.11711992, 1.11723828, 1.11799639, 1.11804579,
1.1185542 , 1.11900111, 1.11944666, 1.12008154, 1.12017866,
1.12115987, 1.12116274, 1.12273753, 1.12303803, 1.12389037,
1.12491981, 1.12681337, 1.12709686, 1.12770754, 1.1279332 ,
1.12804247, 1.12856893, 1.12870287, 1.12943798, 1.12956756,
1.13025021, 1.13182703, 1.13258506, 1.13333905, 1.13334852,
1.13338897, 1.13366529, 1.1346209 , 1.13644788, 1.13664012,
1.13669225, 1.14012004, 1.14133281, 1.14722766, 1.14977161,
1.15412298, 1.15614816, 1.16236536, 1.16359623, 1.16417619,
1.16870942, 1.17034445, 1.17241879, 1.17329811, 1.19069314,
1.19609825, 1.2024856 , 1.20598676, 1.20935502, 1.20942248,
1.21071454, 1.21318424, 1.21660982, 1.21953989, 1.2196442 ,
1.2222283 , 1.22345554, 1.22640816, 1.22762441, 1.22785326,
1.23300289, 1.23736304, 1.23813366, 1.24264505])
Python
import matplotlib.pyplot as plt
from sklearn.metrics import auc, PrecisionRecallDisplay
PrecisionRecallDisplay.from_predictions(ratio_df["y_true"], ratio_df["ratio"])
plt.show()
auc_score = auc(recall, precision)
auc_score
0.5438214776147201