Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add support for scipy distances #81

Merged
merged 3 commits into from
Feb 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 34 additions & 27 deletions examples/null_size.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,9 @@
"\n",
"## Effect of null size on mAP p-value calculation\n",
"\n",
"Let's calculate mAP significance on the given dataset using `null_size` values from $10$ to $5*10^6$ and plot results below."
"Let's calculate mAP significance on the given dataset using `null_size` values from $10$ to $5*10^6$ and plot results below.\n",
"\n",
"We'll also change the location of cached null distributions from user home to a local subdiretory."
]
},
{
Expand All @@ -183,7 +185,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "f757e36886c54b19af4b8c7c1fe77e55",
"model_id": "9738b6f4faa64847aac316120975c9fd",
"version_major": 2,
"version_minor": 0
},
Expand All @@ -197,7 +199,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "f91d0ce9c5a7477c8a97bdd35a3106f6",
"model_id": "3a5ff0b3fb384c4f95baa77a66b504d7",
"version_major": 2,
"version_minor": 0
},
Expand All @@ -211,7 +213,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "9cb2a8d89d4c43708f047ca2c32666d0",
"model_id": "1412262fdfca4de5a0ac2968e37defc1",
"version_major": 2,
"version_minor": 0
},
Expand All @@ -225,7 +227,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "eb56fa1f62ee44058cdc0b12a8136649",
"model_id": "2f3bce275fab434ba1e045908ac56188",
"version_major": 2,
"version_minor": 0
},
Expand All @@ -239,7 +241,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "72c6f289388d45b19f5493df951187f6",
"model_id": "31504e9ab9334054a5c1fa9244b00461",
"version_major": 2,
"version_minor": 0
},
Expand All @@ -253,7 +255,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "8a03f324bfde45dc8a3847e0b4757718",
"model_id": "df3ee4295bf14a0fbbd3edc9b9bbce43",
"version_major": 2,
"version_minor": 0
},
Expand All @@ -267,7 +269,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "ca76fd51a52a4f178048c6145bec76ec",
"model_id": "71e241775fd74abfa4e8403d365f8136",
"version_major": 2,
"version_minor": 0
},
Expand All @@ -281,7 +283,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "e9878c1b8a6e4522aa722fb8c53ef61a",
"model_id": "bc2e1817be6b4207af2458943e547500",
"version_major": 2,
"version_minor": 0
},
Expand All @@ -295,7 +297,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "ed7243b45118432289a2a4e43ff402f0",
"model_id": "e66adb85c1f74eaf87efae66dbbd644a",
"version_major": 2,
"version_minor": 0
},
Expand All @@ -309,7 +311,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "8c4e607a52f64ffab60715ab37bd8123",
"model_id": "8b390b25b8964592bf479b42a6320d06",
"version_major": 2,
"version_minor": 0
},
Expand All @@ -323,7 +325,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "73e53a2a4af04f97a1325e859a7b4b6d",
"model_id": "8dace7243c3841cc9898fe6d304ed3ed",
"version_major": 2,
"version_minor": 0
},
Expand All @@ -337,7 +339,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "c164fada3f884e4eaa2e3034b123cf32",
"model_id": "44c48e472c6f4d5eaf3d558a8acb4519",
"version_major": 2,
"version_minor": 0
},
Expand All @@ -351,7 +353,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "866bf49221a74fb4b027d30fce7923b7",
"model_id": "aba7957fbbf74fd78474030d6d7cd63a",
"version_major": 2,
"version_minor": 0
},
Expand All @@ -365,7 +367,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "35cc6e6a050f4d54bdfe0af8c7f06ca8",
"model_id": "1289bf5d7e61407e87169aba69b4bb54",
"version_major": 2,
"version_minor": 0
},
Expand All @@ -379,7 +381,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "0cdedf53e57c447d8637131f36e235c1",
"model_id": "7534620ff82e4520995023f3830514f8",
"version_major": 2,
"version_minor": 0
},
Expand All @@ -393,7 +395,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "51f8bd9b67e84355b43250161757f9f2",
"model_id": "8afdd30c664742769161be671d05902f",
"version_major": 2,
"version_minor": 0
},
Expand All @@ -407,7 +409,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "af388a2a85344afcbc4a16754161f7d2",
"model_id": "4292e6701ae845e2b77eea11bbdb25b5",
"version_major": 2,
"version_minor": 0
},
Expand All @@ -421,7 +423,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "1bcbb98f5a914cf592675ceb3b244edb",
"model_id": "822431e328954a908c068da8b2bf124d",
"version_major": 2,
"version_minor": 0
},
Expand All @@ -435,7 +437,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "1caee17aa8df4927b1cca011b001747e",
"model_id": "86c4b77801b548a2a6ee90abea3e8b0e",
"version_major": 2,
"version_minor": 0
},
Expand All @@ -449,7 +451,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "74501731a562495d9fa7dd0e5839a8f3",
"model_id": "99c2fb7c7ab04103bcd8938f96aa5111",
"version_major": 2,
"version_minor": 0
},
Expand All @@ -463,7 +465,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "cda67a08f4b74746ad7f3a573e69bf6b",
"model_id": "dfc7b6b9ba654496be0bcefe5f717f59",
"version_major": 2,
"version_minor": 0
},
Expand All @@ -477,7 +479,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "a91d4f8287a043c0a10a8fa68f0effeb",
"model_id": "c2f45921939d4742a0d5254e404a015b",
"version_major": 2,
"version_minor": 0
},
Expand All @@ -491,7 +493,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "9ee06fd558294e89ad5c430bdc9bad68",
"model_id": "14627090dac345a695601984a5ec128a",
"version_major": 2,
"version_minor": 0
},
Expand All @@ -505,7 +507,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "d73340031a6443d190949fb609e5af8e",
"model_id": "5e7980c5c222436d895c64f85104de83",
"version_major": 2,
"version_minor": 0
},
Expand All @@ -528,6 +530,9 @@
}
],
"source": [
"seed = 0\n",
"null_cache_dir = \"cache\" # default is Path.home() / \".copairs\"\n",
"\n",
"activity_maps = []\n",
"for ns_pow in range(1, 7):\n",
" null_size = 10**ns_pow\n",
Expand All @@ -537,7 +542,8 @@
" [\"Metadata_broad_sample\"],\n",
" null_size=null_size,\n",
" threshold=0.05,\n",
" seed=0,\n",
" seed=seed,\n",
" cache_dir=null_cache_dir,\n",
" )\n",
" replicate_map[\"null_size\"] = null_size\n",
" activity_maps.append(replicate_map)\n",
Expand All @@ -547,7 +553,8 @@
" [\"Metadata_broad_sample\"],\n",
" null_size=5 * null_size,\n",
" threshold=0.05,\n",
" seed=0,\n",
" seed=seed,\n",
" cache_dir=null_cache_dir,\n",
" )\n",
" replicate_map[\"null_size\"] = 5 * null_size\n",
" activity_maps.append(replicate_map)\n",
Expand Down
Loading