-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* updating project metadata * fixing CI yaml * using venv * trying again * redoing CI * fixing tests * changing some settings * updates * fixing build * trying to fix this * fixing release * bumping version * better code organization * updates * adding initial cm impl * adding unique, dispatching pattern to Py objects, renaming ext * rustfmt * cm dispatched * rustfmt * tests and benchmarks added * bump version * 100% test coverage * updating readme * Threading enabled (#9) * bumping version * major refactor leveraging macros * bumping version and updating test * adding executed notebook * fixing performance w/ bool * multiclass implemented and tested ready for 1.0.0 * shifting to u32 for numpy compatability * bumping version * changing to i64 for better compatability * Major additions to Python API to include high-level helpers
- Loading branch information
1 parent
bc0573f
commit a9b812b
Showing
11 changed files
with
562 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = "fast-stats" | ||
version = "1.0.2" | ||
version = "1.1.0" | ||
edition = "2021" | ||
|
||
[lib] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,144 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"### Imports" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 1, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"import numpy as np\n", | ||
"import fast_stats" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"### Settings" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 2, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"SIZE = (10, 512, 512)\n", | ||
"NUM_CATS = 8" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"### Binary Statistics" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 3, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"y_true = np.random.randint(0, 2, SIZE).astype(bool)\n", | ||
"y_pred = np.random.randint(0, 2, SIZE).astype(bool)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 4, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"data": { | ||
"text/plain": [ | ||
"{'precision': 0.49939381724124243,\n", | ||
" 'recall': 0.4994250828781588,\n", | ||
" 'f1-score': 0.4994094495703526}" | ||
] | ||
}, | ||
"execution_count": 4, | ||
"metadata": {}, | ||
"output_type": "execute_result" | ||
} | ||
], | ||
"source": [ | ||
"fast_stats.binary_stats(y_true, y_pred)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"### Multi-class Statistics" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 5, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"y_true = np.random.randint(0, NUM_CATS, SIZE)\n", | ||
"y_pred = np.random.randint(0, NUM_CATS, SIZE)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 6, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"data": { | ||
"text/plain": [ | ||
"{'precision': array([0.1256168 , 0.12500038, 0.12486642, 0.1248673 , 0.12500914,\n", | ||
" 0.12636344, 0.12454387, 0.12488666]),\n", | ||
" 'recall': array([0.12568051, 0.12524121, 0.1245743 , 0.12500458, 0.12535152,\n", | ||
" 0.12616009, 0.12444887, 0.12469365]),\n", | ||
" 'f1-score': array([0.12564865, 0.12512068, 0.12472019, 0.1249359 , 0.1251801 ,\n", | ||
" 0.12626169, 0.12449635, 0.12479008])}" | ||
] | ||
}, | ||
"execution_count": 6, | ||
"metadata": {}, | ||
"output_type": "execute_result" | ||
} | ||
], | ||
"source": [ | ||
"fast_stats.stats(y_true, y_pred)" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"interpreter": { | ||
"hash": "a3a671d63c09fb4878d313d605bf6366336b9695c04e11736a5d015abf9b1e42" | ||
}, | ||
"kernelspec": { | ||
"display_name": "Python 3.9.11 ('.venv39': venv)", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.9.11" | ||
}, | ||
"orig_nbformat": 4 | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 2 | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
from .binary import binary_f1_score, binary_precision, binary_recall | ||
from .binary import ( | ||
binary_f1_score, | ||
binary_precision, | ||
binary_recall, | ||
binary_stats, | ||
binary_tp_fp_fn, | ||
) | ||
from .confusion_matrix import confusion_matrix | ||
from .multiclass import f1_score, precision, recall | ||
from .multiclass import f1_score, precision, recall, stats |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.