Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
L
lecture_applied_bioimage_analysis_2020
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
rhaase
lecture_applied_bioimage_analysis_2020
Commits
3ab2279c
Commit
3ab2279c
authored
Jun 23, 2020
by
rhaase
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added another potential solution (which is not working)
parent
91fd7ece
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
95 additions
and
11 deletions
+95
-11
11_Hypothesis_testing/exercise_otsu/Otsu_Method_Comparison.ipynb
...thesis_testing/exercise_otsu/Otsu_Method_Comparison.ipynb
+95
-11
No files found.
11_Hypothesis_testing/exercise_otsu/Otsu_Method_Comparison.ipynb
View file @
3ab2279c
...
...
@@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "code",
"execution_count":
2
,
"execution_count":
1
,
"metadata": {},
"outputs": [
{
...
...
@@ -88,7 +88,7 @@
},
{
"cell_type": "code",
"execution_count":
3
,
"execution_count":
2
,
"metadata": {},
"outputs": [
{
...
...
@@ -123,7 +123,7 @@
},
{
"cell_type": "code",
"execution_count":
4
,
"execution_count":
3
,
"metadata": {},
"outputs": [
{
...
...
@@ -174,7 +174,7 @@
},
{
"cell_type": "code",
"execution_count":
5
,
"execution_count":
4
,
"metadata": {},
"outputs": [
{
...
...
@@ -209,7 +209,7 @@
},
{
"cell_type": "code",
"execution_count":
6
,
"execution_count":
5
,
"metadata": {},
"outputs": [],
"source": [
...
...
@@ -234,7 +234,7 @@
},
{
"cell_type": "code",
"execution_count":
7
,
"execution_count":
6
,
"metadata": {},
"outputs": [
{
...
...
@@ -265,7 +265,7 @@
},
{
"cell_type": "code",
"execution_count":
8
,
"execution_count":
7
,
"metadata": {},
"outputs": [
{
...
...
@@ -292,7 +292,7 @@
},
{
"cell_type": "code",
"execution_count":
41
,
"execution_count":
8
,
"metadata": {},
"outputs": [
{
...
...
@@ -303,7 +303,7 @@
" (-0.0743754713943518, 0.47051036223078757, 48.0))"
]
},
"execution_count":
41
,
"execution_count":
8
,
"metadata": {},
"output_type": "execute_result"
}
...
...
@@ -318,7 +318,91 @@
},
{
"cell_type": "code",
"execution_count": 40,
"execution_count": 9,
"metadata": {},
"outputs": [],
"source": [
"# source: https://gist.github.com/josef-pkt/3900314\n",
"\n",
"'''Test of Equivalence and Non-Inferiority\n",
"currently only TOST for paired sample\n",
"Application for example bioequivalence\n",
"Author: Josef Perktold\n",
"License: BSD-3\n",
"'''\n",
"\n",
"\n",
"import numpy as np\n",
"from scipy import stats\n",
"\n",
"def tost_paired(y, x, low, upp, transform=None):\n",
" '''test of (non-)equivalence for paired sample\n",
" TOST: two one-sided t tests\n",
" null hypothesis x - y < low or x - y > upp\n",
" alternative hypothesis: low < x - y < upp\n",
" If the pvalue is smaller than a threshold, then we reject the hypothesis\n",
" that there is difference between the two samples larger than the one\n",
" given by low and upp.\n",
" Parameters\n",
" ----------\n",
" y, x : array_like\n",
" two paired samples\n",
" low, upp : float\n",
" equivalence interval low < x - y < upp\n",
" transform : None or function\n",
" If None (default), then the data is not transformed. Given a function\n",
" sample data and thresholds are transformed. If transform is log the\n",
" the equivalence interval is in ratio: low < x / y < upp\n",
" Returns\n",
" -------\n",
" pvalue : float\n",
" pvalue of the non-equivalence test\n",
" t1, pv1 : tuple of floats\n",
" test statistic and pvalue for lower threshold test\n",
" t2, pv2 : tuple of floats\n",
" test statistic and pvalue for upper threshold test\n",
" Notes\n",
" -----\n",
" tested on only one example\n",
" uses stats.ttest_1samp which doesn't have a real one-sided option\n",
" '''\n",
" if transform:\n",
" y = transform(y)\n",
" x = transform(x)\n",
" low = transform(low)\n",
" upp = transform(upp)\n",
" t1, pv1 = stats.ttest_1samp(x - y, low)\n",
" t2, pv2 = stats.ttest_1samp(x - y, upp)\n",
" return max(pv1, pv2)/2., (t1, pv1 / 2.), (t2, pv2 / 2.)"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"(3.0607159809231846e-11,\n",
" (-11.104032129950907, 3.0607159809231846e-11),\n",
" (-12.32257205021279, 3.601584280854005e-12))"
]
},
"execution_count": 10,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"tolerance = 0.1\n",
"\n",
"tost_paired(measurement_python, measurement_imagej, -tolerance, tolerance)\n"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {},
"outputs": [
{
...
...
@@ -336,7 +420,7 @@
" [72.64029810317597, 1.19906617345889e-29]]"
]
},
"execution_count":
40
,
"execution_count":
11
,
"metadata": {},
"output_type": "execute_result"
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment