from scipy.stats import ttest_rel
stat, p = ttest_rel(df[ 'inflow avg_3m'].values, df ['Seg_Locality'].values)
print('Statistics=%.3f, p=%.5f' % (stat, p))
from scipy.stats import f_oneway
stat, p = f_oneway(df[ 'inflow avg_3m'].values, df [ 'Seg_Locality'].values)
print('Statistics=%.3f, p=%.5f' % (stat, p))
Две вещи, которые я понял - прежде чем вводить данные в модель, нам нужно сделать две вещи: 1 - корреляция между независимыми переменными 2 - проверка гипотезы для независимой переменной с двоичной зависимой переменной
1.For independent variable correlation
a. numbers variable with numbers variables--------corr.matrix
b.number variables with categorical variables-------??????????
c.categorical variable with categorical variables-----------chi square-
2.how to do hypothesis test for all above independent variables with binary `
classification output(i.e===if p value is low we can include that
particular independent variable in model otherwise we can remove that
variable from the model.)how to find the p value for this?