Commit fdc34db0 authored by lucas_miranda's avatar lucas_miranda
Browse files

Implemented shuffle parameter in preprocessing; shuffled validation data in model_training.py

parent 70b60e20
......@@ -294,6 +294,7 @@ input_dict_val = {
random_state=42,
filter="gaussian",
sigma=55,
shuffle=True,
),
"dists": distances2.preprocess(
window_size=11,
......@@ -302,6 +303,7 @@ input_dict_val = {
random_state=42,
filter="gaussian",
sigma=55,
shuffle=True,
),
"angles": angles2.preprocess(
window_size=11,
......@@ -310,6 +312,7 @@ input_dict_val = {
random_state=42,
filter="gaussian",
sigma=55,
shuffle=True,
),
"coords+dist": coords_distances2.preprocess(
window_size=11,
......@@ -318,6 +321,7 @@ input_dict_val = {
random_state=42,
filter="gaussian",
sigma=55,
shuffle=True,
),
"coords+angle": coords_angles2.preprocess(
window_size=11,
......@@ -326,6 +330,7 @@ input_dict_val = {
random_state=42,
filter="gaussian",
sigma=55,
shuffle=True,
),
"coords+dist+angle": coords_dist_angles2.preprocess(
window_size=11,
......@@ -334,6 +339,7 @@ input_dict_val = {
random_state=42,
filter="gaussian",
sigma=55,
shuffle=True,
),
}
......
......@@ -472,6 +472,7 @@ class table_dict(dict):
sigma=None,
shift=0,
standard_scaler=True,
shuffle=False,
):
"""Builds a sliding window. If desired, splits train and test and
Z-scores the data using sklearn's standard scaler"""
......@@ -532,8 +533,15 @@ class table_dict(dict):
if filter == "gaussian":
X_test = X_test * g.reshape(1, window_size, 1)
if shuffle:
X_train = np.random.choice(X_train, X_train.shape[0], replace=False)
X_test = np.random.choice(X_test, X_test.shape[0], replace=False)
return X_train, X_test
if shuffle:
X_train = np.random.choice(X_train, X_train.shape[0], replace=False)
return X_train
def random_projection(self, n_components=None, sample=1000):
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment