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

update deprecated binom_test #426

Merged
merged 6 commits into from
Mar 27, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
5 changes: 2 additions & 3 deletions nltools/analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,12 @@
import pandas as pd
import numpy as np
from nltools.plotting import roc_plot
from scipy.stats import norm, binom_test
from scipy.stats import norm, binomtest
from sklearn.metrics import auc
from copy import deepcopy


class Roc(object):

"""Roc Class

The Roc class is based on Tor Wager's Matlab roc_plot.m function and
Expand Down Expand Up @@ -233,7 +232,7 @@ def calculate(

# Calculate p-Value using binomial test (can add hierarchical version of binomial test)
self.n = len(self.misclass)
self.accuracy_p = binom_test(int(np.sum(~self.misclass)), self.n, p=0.5)
self.accuracy_p = binomtest(int(np.sum(~self.misclass)), self.n, p=0.5)
self.accuracy_se = np.sqrt(
np.mean(~self.misclass) * (np.mean(~self.misclass)) / self.n
)
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ pandas>=1.1.0
numpy<1.24
seaborn>=0.7.0
matplotlib>=2.2.0
scipy
scipy>=1.7.0
pynv
joblib>=0.15
h5py
Loading