stouputils 1.14.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- stouputils/__init__.py +40 -0
- stouputils/__main__.py +86 -0
- stouputils/_deprecated.py +37 -0
- stouputils/all_doctests.py +160 -0
- stouputils/applications/__init__.py +22 -0
- stouputils/applications/automatic_docs.py +634 -0
- stouputils/applications/upscaler/__init__.py +39 -0
- stouputils/applications/upscaler/config.py +128 -0
- stouputils/applications/upscaler/image.py +247 -0
- stouputils/applications/upscaler/video.py +287 -0
- stouputils/archive.py +344 -0
- stouputils/backup.py +488 -0
- stouputils/collections.py +244 -0
- stouputils/continuous_delivery/__init__.py +27 -0
- stouputils/continuous_delivery/cd_utils.py +243 -0
- stouputils/continuous_delivery/github.py +522 -0
- stouputils/continuous_delivery/pypi.py +130 -0
- stouputils/continuous_delivery/pyproject.py +147 -0
- stouputils/continuous_delivery/stubs.py +86 -0
- stouputils/ctx.py +408 -0
- stouputils/data_science/config/get.py +51 -0
- stouputils/data_science/config/set.py +125 -0
- stouputils/data_science/data_processing/image/__init__.py +66 -0
- stouputils/data_science/data_processing/image/auto_contrast.py +79 -0
- stouputils/data_science/data_processing/image/axis_flip.py +58 -0
- stouputils/data_science/data_processing/image/bias_field_correction.py +74 -0
- stouputils/data_science/data_processing/image/binary_threshold.py +73 -0
- stouputils/data_science/data_processing/image/blur.py +59 -0
- stouputils/data_science/data_processing/image/brightness.py +54 -0
- stouputils/data_science/data_processing/image/canny.py +110 -0
- stouputils/data_science/data_processing/image/clahe.py +92 -0
- stouputils/data_science/data_processing/image/common.py +30 -0
- stouputils/data_science/data_processing/image/contrast.py +53 -0
- stouputils/data_science/data_processing/image/curvature_flow_filter.py +74 -0
- stouputils/data_science/data_processing/image/denoise.py +378 -0
- stouputils/data_science/data_processing/image/histogram_equalization.py +123 -0
- stouputils/data_science/data_processing/image/invert.py +64 -0
- stouputils/data_science/data_processing/image/laplacian.py +60 -0
- stouputils/data_science/data_processing/image/median_blur.py +52 -0
- stouputils/data_science/data_processing/image/noise.py +59 -0
- stouputils/data_science/data_processing/image/normalize.py +65 -0
- stouputils/data_science/data_processing/image/random_erase.py +66 -0
- stouputils/data_science/data_processing/image/resize.py +69 -0
- stouputils/data_science/data_processing/image/rotation.py +80 -0
- stouputils/data_science/data_processing/image/salt_pepper.py +68 -0
- stouputils/data_science/data_processing/image/sharpening.py +55 -0
- stouputils/data_science/data_processing/image/shearing.py +64 -0
- stouputils/data_science/data_processing/image/threshold.py +64 -0
- stouputils/data_science/data_processing/image/translation.py +71 -0
- stouputils/data_science/data_processing/image/zoom.py +83 -0
- stouputils/data_science/data_processing/image_augmentation.py +118 -0
- stouputils/data_science/data_processing/image_preprocess.py +183 -0
- stouputils/data_science/data_processing/prosthesis_detection.py +359 -0
- stouputils/data_science/data_processing/technique.py +481 -0
- stouputils/data_science/dataset/__init__.py +45 -0
- stouputils/data_science/dataset/dataset.py +292 -0
- stouputils/data_science/dataset/dataset_loader.py +135 -0
- stouputils/data_science/dataset/grouping_strategy.py +296 -0
- stouputils/data_science/dataset/image_loader.py +100 -0
- stouputils/data_science/dataset/xy_tuple.py +696 -0
- stouputils/data_science/metric_dictionnary.py +106 -0
- stouputils/data_science/metric_utils.py +847 -0
- stouputils/data_science/mlflow_utils.py +206 -0
- stouputils/data_science/models/abstract_model.py +149 -0
- stouputils/data_science/models/all.py +85 -0
- stouputils/data_science/models/base_keras.py +765 -0
- stouputils/data_science/models/keras/all.py +38 -0
- stouputils/data_science/models/keras/convnext.py +62 -0
- stouputils/data_science/models/keras/densenet.py +50 -0
- stouputils/data_science/models/keras/efficientnet.py +60 -0
- stouputils/data_science/models/keras/mobilenet.py +56 -0
- stouputils/data_science/models/keras/resnet.py +52 -0
- stouputils/data_science/models/keras/squeezenet.py +233 -0
- stouputils/data_science/models/keras/vgg.py +42 -0
- stouputils/data_science/models/keras/xception.py +38 -0
- stouputils/data_science/models/keras_utils/callbacks/__init__.py +20 -0
- stouputils/data_science/models/keras_utils/callbacks/colored_progress_bar.py +219 -0
- stouputils/data_science/models/keras_utils/callbacks/learning_rate_finder.py +148 -0
- stouputils/data_science/models/keras_utils/callbacks/model_checkpoint_v2.py +31 -0
- stouputils/data_science/models/keras_utils/callbacks/progressive_unfreezing.py +249 -0
- stouputils/data_science/models/keras_utils/callbacks/warmup_scheduler.py +66 -0
- stouputils/data_science/models/keras_utils/losses/__init__.py +12 -0
- stouputils/data_science/models/keras_utils/losses/next_generation_loss.py +56 -0
- stouputils/data_science/models/keras_utils/visualizations.py +416 -0
- stouputils/data_science/models/model_interface.py +939 -0
- stouputils/data_science/models/sandbox.py +116 -0
- stouputils/data_science/range_tuple.py +234 -0
- stouputils/data_science/scripts/augment_dataset.py +77 -0
- stouputils/data_science/scripts/exhaustive_process.py +133 -0
- stouputils/data_science/scripts/preprocess_dataset.py +70 -0
- stouputils/data_science/scripts/routine.py +168 -0
- stouputils/data_science/utils.py +285 -0
- stouputils/decorators.py +605 -0
- stouputils/image.py +441 -0
- stouputils/installer/__init__.py +18 -0
- stouputils/installer/common.py +67 -0
- stouputils/installer/downloader.py +101 -0
- stouputils/installer/linux.py +144 -0
- stouputils/installer/main.py +223 -0
- stouputils/installer/windows.py +136 -0
- stouputils/io.py +486 -0
- stouputils/parallel.py +483 -0
- stouputils/print.py +482 -0
- stouputils/py.typed +1 -0
- stouputils/stouputils/__init__.pyi +15 -0
- stouputils/stouputils/_deprecated.pyi +12 -0
- stouputils/stouputils/all_doctests.pyi +46 -0
- stouputils/stouputils/applications/__init__.pyi +2 -0
- stouputils/stouputils/applications/automatic_docs.pyi +106 -0
- stouputils/stouputils/applications/upscaler/__init__.pyi +3 -0
- stouputils/stouputils/applications/upscaler/config.pyi +18 -0
- stouputils/stouputils/applications/upscaler/image.pyi +109 -0
- stouputils/stouputils/applications/upscaler/video.pyi +60 -0
- stouputils/stouputils/archive.pyi +67 -0
- stouputils/stouputils/backup.pyi +109 -0
- stouputils/stouputils/collections.pyi +86 -0
- stouputils/stouputils/continuous_delivery/__init__.pyi +5 -0
- stouputils/stouputils/continuous_delivery/cd_utils.pyi +129 -0
- stouputils/stouputils/continuous_delivery/github.pyi +162 -0
- stouputils/stouputils/continuous_delivery/pypi.pyi +53 -0
- stouputils/stouputils/continuous_delivery/pyproject.pyi +67 -0
- stouputils/stouputils/continuous_delivery/stubs.pyi +39 -0
- stouputils/stouputils/ctx.pyi +211 -0
- stouputils/stouputils/decorators.pyi +252 -0
- stouputils/stouputils/image.pyi +172 -0
- stouputils/stouputils/installer/__init__.pyi +5 -0
- stouputils/stouputils/installer/common.pyi +39 -0
- stouputils/stouputils/installer/downloader.pyi +24 -0
- stouputils/stouputils/installer/linux.pyi +39 -0
- stouputils/stouputils/installer/main.pyi +57 -0
- stouputils/stouputils/installer/windows.pyi +31 -0
- stouputils/stouputils/io.pyi +213 -0
- stouputils/stouputils/parallel.pyi +216 -0
- stouputils/stouputils/print.pyi +136 -0
- stouputils/stouputils/version_pkg.pyi +15 -0
- stouputils/version_pkg.py +189 -0
- stouputils-1.14.0.dist-info/METADATA +178 -0
- stouputils-1.14.0.dist-info/RECORD +140 -0
- stouputils-1.14.0.dist-info/WHEEL +4 -0
- stouputils-1.14.0.dist-info/entry_points.txt +3 -0
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
"""
|
|
2
|
+
This module contains the MetricDictionnary class, which provides a dictionary of metric names.
|
|
3
|
+
|
|
4
|
+
This is often used to log metrics to MLflow and to display them in the console easily.
|
|
5
|
+
|
|
6
|
+
This class contains the following metrics:
|
|
7
|
+
|
|
8
|
+
1. Main metrics:
|
|
9
|
+
|
|
10
|
+
- Area Under the Curve (AUC)
|
|
11
|
+
- Area Under the Precision-Recall Curve (AUPRC)
|
|
12
|
+
- Area Under the NPV-Specificity Curve (NEGATIVE_AUPRC)
|
|
13
|
+
- Specificity (True Negative Rate)
|
|
14
|
+
- Recall/Sensitivity (True Positive Rate)
|
|
15
|
+
- Precision (Positive Predictive Value)
|
|
16
|
+
- Negative Predictive Value (NPV)
|
|
17
|
+
- Accuracy
|
|
18
|
+
- F1 Score
|
|
19
|
+
- Precision-Recall Average
|
|
20
|
+
- Precision-Recall Average for Negative Class
|
|
21
|
+
|
|
22
|
+
2. Confusion matrix metrics:
|
|
23
|
+
|
|
24
|
+
- True Negatives (TN)
|
|
25
|
+
- False Positives (FP)
|
|
26
|
+
- False Negatives (FN)
|
|
27
|
+
- True Positives (TP)
|
|
28
|
+
- False Positive Rate
|
|
29
|
+
- False Negative Rate
|
|
30
|
+
- False Discovery Rate
|
|
31
|
+
- False Omission Rate
|
|
32
|
+
- Critical Success Index (Threat Score)
|
|
33
|
+
|
|
34
|
+
3. F-scores:
|
|
35
|
+
|
|
36
|
+
- F-beta Score (where beta is configurable)
|
|
37
|
+
|
|
38
|
+
4. Matthews correlation coefficient:
|
|
39
|
+
|
|
40
|
+
- Matthews Correlation Coefficient (MCC)
|
|
41
|
+
|
|
42
|
+
5. Optimal thresholds for binary classification:
|
|
43
|
+
|
|
44
|
+
- Youden's J statistic
|
|
45
|
+
- Cost-based threshold
|
|
46
|
+
- F1 Score threshold
|
|
47
|
+
- F1 Score threshold for the negative class
|
|
48
|
+
|
|
49
|
+
6. Average metrics across folds:
|
|
50
|
+
|
|
51
|
+
- Mean value of any metric across k-fold cross validation
|
|
52
|
+
|
|
53
|
+
7. Standard deviation metrics across folds:
|
|
54
|
+
|
|
55
|
+
- Standard deviation of any metric across k-fold cross validation
|
|
56
|
+
"""
|
|
57
|
+
|
|
58
|
+
class MetricDictionnary:
|
|
59
|
+
|
|
60
|
+
# Main metrics (starting with '1:')
|
|
61
|
+
AUC: str = "1: Area Under the ROC Curve: AUC / AUROC"
|
|
62
|
+
AUPRC: str = "1: Area Under the Precision-Recall Curve: AUPRC / PR AUC"
|
|
63
|
+
NEGATIVE_AUPRC: str = "1: Area Under the NPV-Specificity Curve: AUNPRC / NPR AUC"
|
|
64
|
+
SPECIFICITY: str = "1: Specificity: True Negative Rate"
|
|
65
|
+
RECALL: str = "1: Recall/Sensitivity: True Positive Rate"
|
|
66
|
+
PRECISION: str = "1: Precision: Positive Predictive Value"
|
|
67
|
+
NPV: str = "1: NPV: Negative Predictive Value"
|
|
68
|
+
ACCURACY: str = "1: Accuracy"
|
|
69
|
+
BALANCED_ACCURACY: str = "1: Balanced Accuracy"
|
|
70
|
+
F1_SCORE: str = "1: F1 Score"
|
|
71
|
+
F1_SCORE_NEGATIVE: str = "1: F1 Score for Negative Class"
|
|
72
|
+
PR_AVERAGE: str = "1: Precision-Recall Average"
|
|
73
|
+
PR_AVERAGE_NEGATIVE: str = "1: Precision-Recall Average for Negative Class"
|
|
74
|
+
|
|
75
|
+
# Confusion matrix metrics (starting with '2:')
|
|
76
|
+
CONFUSION_MATRIX_TN: str = "2: Confusion Matrix: TN"
|
|
77
|
+
CONFUSION_MATRIX_FP: str = "2: Confusion Matrix: FP"
|
|
78
|
+
CONFUSION_MATRIX_FN: str = "2: Confusion Matrix: FN"
|
|
79
|
+
CONFUSION_MATRIX_TP: str = "2: Confusion Matrix: TP"
|
|
80
|
+
FALSE_POSITIVE_RATE: str = "2: False Positive Rate"
|
|
81
|
+
FALSE_NEGATIVE_RATE: str = "2: False Negative Rate"
|
|
82
|
+
FALSE_DISCOVERY_RATE: str = "2: False Discovery Rate"
|
|
83
|
+
FALSE_OMISSION_RATE: str = "2: False Omission Rate"
|
|
84
|
+
CRITICAL_SUCCESS_INDEX: str = "2: Critical Success Index: Threat Score"
|
|
85
|
+
|
|
86
|
+
# F-scores (starting with '3:')
|
|
87
|
+
F_SCORE_X: str = "3: F-X Score" # X is the beta value
|
|
88
|
+
|
|
89
|
+
# Matthews correlation coefficient (starting with '4:')
|
|
90
|
+
MATTHEWS_CORRELATION_COEFFICIENT: str = "4: Matthews Correlation Coefficient: MCC"
|
|
91
|
+
|
|
92
|
+
# Optimal thresholds (starting with '5:')
|
|
93
|
+
OPTIMAL_THRESHOLD_YOUDEN: str = "5: Optimal Threshold: Youden"
|
|
94
|
+
OPTIMAL_THRESHOLD_COST: str = "5: Optimal Threshold: Cost"
|
|
95
|
+
OPTIMAL_THRESHOLD_F1: str = "5: Optimal Threshold: F1"
|
|
96
|
+
OPTIMAL_THRESHOLD_F1_NEGATIVE: str = "5: Optimal Threshold: F1 for Negative Class"
|
|
97
|
+
|
|
98
|
+
# Average metrics across folds (starting with '6:')
|
|
99
|
+
AVERAGE_METRIC: str = "6: Average METRIC_NAME across folds"
|
|
100
|
+
|
|
101
|
+
# Standard deviation metrics across folds (starting with '7:')
|
|
102
|
+
STANDARD_DEVIATION_METRIC: str = "7: Standard deviation METRIC_NAME across folds"
|
|
103
|
+
|
|
104
|
+
# Parameter finder (starting with '8:')
|
|
105
|
+
PARAMETER_FINDER: str = "8: TITLE: PARAMETER_NAME"
|
|
106
|
+
|