Set more parameters as user-specified constants.
parent
cad28c3fe8
commit
b756ed5feb
|
@ -73,18 +73,21 @@ model_input["target"].value_counts()
|
|||
|
||||
# %% jupyter={"outputs_hidden": false, "source_hidden": false}
|
||||
# bins = [-10, 0, 10] # bins for z-scored targets
|
||||
bins = [-1, 0, 4] # bins for stressfulness (0-4) target
|
||||
BINS = [-1, 0, 4] # bins for stressfulness (0-4) target
|
||||
print("BINS: ", BINS)
|
||||
model_input["target"], edges = pd.cut(
|
||||
model_input.target, bins=bins, labels=["low", "high"], retbins=True, right=True
|
||||
model_input.target, bins=BINS, labels=["low", "high"], retbins=True, right=True
|
||||
) # ['low', 'medium', 'high']
|
||||
model_input["target"].value_counts(), edges
|
||||
model_input = model_input[model_input["target"] != "medium"]
|
||||
print(model_input["target"].value_counts())
|
||||
REMOVE_MEDIUM = True
|
||||
if ("medium" in model_input["target"]) and REMOVE_MEDIUM:
|
||||
model_input = model_input[model_input["target"] != "medium"]
|
||||
print(model_input["target"].value_counts())
|
||||
|
||||
model_input["target"] = (
|
||||
model_input["target"].astype(str).apply(lambda x: 0 if x == "low" else 1)
|
||||
)
|
||||
|
||||
model_input["target"].value_counts()
|
||||
|
||||
# %% jupyter={"outputs_hidden": false, "source_hidden": false}
|
||||
# UnderSampling
|
||||
if UNDERSAMPLING:
|
||||
|
|
Loading…
Reference in New Issue