⚡ Adds ses owanova
This commit is contained in:
parent
d3d9ebfbe2
commit
95d0625f4e
@ -3,7 +3,7 @@ import numpy as np
|
|||||||
from analyze import analyze
|
from analyze import analyze
|
||||||
|
|
||||||
dataset = np.load("clean.npy")
|
dataset = np.load("clean.npy")
|
||||||
print(f"dataset shape: {dataset.shape}, analyzing column 7 (living)")
|
print(f"dataset shape: {dataset.shape}, analyzing column 8 (living)")
|
||||||
print("\t0 - with family")
|
print("\t0 - with family")
|
||||||
print("\t1 - with family member")
|
print("\t1 - with family member")
|
||||||
print("\t2 - alone / roomates")
|
print("\t2 - alone / roomates")
|
||||||
@ -13,7 +13,7 @@ print("")
|
|||||||
|
|
||||||
|
|
||||||
def analyze_living(name: str, col: np.ndarray):
|
def analyze_living(name: str, col: np.ndarray):
|
||||||
occupation_col = dataset[:, 7]
|
occupation_col = dataset[:, 8]
|
||||||
analyze(name, [
|
analyze(name, [
|
||||||
col[occupation_col == 0],
|
col[occupation_col == 0],
|
||||||
col[occupation_col == 1],
|
col[occupation_col == 1],
|
||||||
|
@ -3,7 +3,7 @@ import numpy as np
|
|||||||
from analyze import analyze
|
from analyze import analyze
|
||||||
|
|
||||||
dataset = np.load("clean.npy")
|
dataset = np.load("clean.npy")
|
||||||
print(f"dataset shape: {dataset.shape}, analyzing column 6 (occupation)")
|
print(f"dataset shape: {dataset.shape}, analyzing column 7 (occupation)")
|
||||||
print("\t0 - work hours / week >= 10")
|
print("\t0 - work hours / week >= 10")
|
||||||
print("\t1 - work hours / week < 10")
|
print("\t1 - work hours / week < 10")
|
||||||
print("\t2 - sport")
|
print("\t2 - sport")
|
||||||
@ -14,7 +14,7 @@ print("")
|
|||||||
|
|
||||||
|
|
||||||
def analyze_occupation(name: str, col: np.ndarray):
|
def analyze_occupation(name: str, col: np.ndarray):
|
||||||
occupation_col = dataset[:, 6]
|
occupation_col = dataset[:, 7]
|
||||||
analyze(name, [
|
analyze(name, [
|
||||||
col[occupation_col == 0],
|
col[occupation_col == 0],
|
||||||
col[occupation_col == 1],
|
col[occupation_col == 1],
|
||||||
|
25
analyze_ses.py
Normal file
25
analyze_ses.py
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
import numpy as np
|
||||||
|
|
||||||
|
from analyze import analyze
|
||||||
|
|
||||||
|
dataset = np.load("clean.npy")
|
||||||
|
print(f"dataset shape: {dataset.shape}, analyzing column 6 (ses)")
|
||||||
|
print("\t0 - lower class")
|
||||||
|
print("\t1 - middle class")
|
||||||
|
print("\t2 - upper class")
|
||||||
|
print("")
|
||||||
|
|
||||||
|
|
||||||
|
def analyze_ses(name: str, col: np.ndarray):
|
||||||
|
sex_col = dataset[:, 6]
|
||||||
|
analyze(name, [
|
||||||
|
col[sex_col == 0],
|
||||||
|
col[sex_col == 1],
|
||||||
|
col[sex_col == 2]
|
||||||
|
])
|
||||||
|
|
||||||
|
|
||||||
|
analyze_ses("gpa", dataset[:, 2])
|
||||||
|
analyze_ses("math", dataset[:, 3])
|
||||||
|
analyze_ses("slovak", dataset[:, 4])
|
||||||
|
analyze_ses("english", dataset[:, 5])
|
Loading…
x
Reference in New Issue
Block a user