⚡ Adds absence Kendall-tau
This commit is contained in:
parent
7a96f1e82c
commit
ba31f87932
25
analyze_absence.py
Normal file
25
analyze_absence.py
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
import numpy as np
|
||||||
|
from scipy.stats import kendalltau
|
||||||
|
|
||||||
|
dataset = np.load("clean.npy")
|
||||||
|
print(f"dataset shape: {dataset.shape}, analyzing column 11 (absence)")
|
||||||
|
print("\tinteger value")
|
||||||
|
print("")
|
||||||
|
|
||||||
|
|
||||||
|
def analyze_absence(name: str, col: np.ndarray):
|
||||||
|
absence_col = dataset[:, 11]
|
||||||
|
tau, p = kendalltau(absence_col, col)
|
||||||
|
print(f"ken-tau for {name}: {tau}")
|
||||||
|
print(f"p-value for {name}: {p}")
|
||||||
|
|
||||||
|
if p > 0.05:
|
||||||
|
print("statistically insignificant\n")
|
||||||
|
else:
|
||||||
|
print("statistically significant\n")
|
||||||
|
|
||||||
|
|
||||||
|
analyze_absence("gpa", dataset[:, 2])
|
||||||
|
analyze_absence("math", dataset[:, 3])
|
||||||
|
analyze_absence("slovak", dataset[:, 4])
|
||||||
|
analyze_absence("english", dataset[:, 5])
|
Loading…
x
Reference in New Issue
Block a user