Skip to content

Instantly share code, notes, and snippets.

View raamana's full-sized avatar
💭
Star it. Fork it. Solve it.

Pradeep Reddy Raamana raamana

💭
Star it. Fork it. Solve it.
View GitHub Profile
@ptasheq
ptasheq / nemenyi.py
Created April 9, 2016 08:53
The Nemenyi post-hoc test for Python
from scipy.stats import friedmanchisquare, rankdata, norm
from scipy.special import gammaln
import numpy as np
# consistent with https://cran.r-project.org/web/packages/PMCMR/vignettes/PMCMR.pdf p. 17
def test_nemenyi():
data = np.asarray([(3.88, 5.64, 5.76, 4.25, 5.91, 4.33), (30.58, 30.14, 16.92, 23.19, 26.74, 10.91),
(25.24, 33.52, 25.45, 18.85, 20.45, 26.67), (4.44, 7.94, 4.04, 4.4, 4.23, 4.36),
(29.41, 30.72, 32.92, 28.23, 23.35, 12), (38.87, 33.12, 39.15, 28.06, 38.23, 26.65)])
@alimuldal
alimuldal / nemenyi.py
Last active May 25, 2020 09:39
Implementation of Nemenyi's multiple comparison test, following a Kruskal-Wallis 1-way ANOVA
import numpy as np
from scipy import stats
from itertools import combinations
from statsmodels.stats.multitest import multipletests
from statsmodels.stats.libqsturng import psturng
import warnings
def kw_nemenyi(groups, to_compare=None, alpha=0.05, method='tukey'):
"""
@audreyfeldroy
audreyfeldroy / pypi-release-checklist.md
Last active February 23, 2023 15:03
My PyPI Release Checklist
  • Update HISTORY.md
  • Commit the changes:
git add HISTORY.md
git commit -m "Changelog for upcoming release 0.1.1."
  • Update version number (can also be minor or major)
bumpversion patch
@nealtodd
nealtodd / decorator.py
Created April 25, 2012 13:15
Python profiling decorator
from cProfile import Profile
import pstats
def profile(sort_args=['cumulative'], print_args=[10]):
profiler = Profile()
def decorator(fn):
def inner(*args, **kwargs):
result = None