Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Lucas Miranda
deepOF
Commits
fdc34db0
Commit
fdc34db0
authored
Jul 04, 2020
by
lucas_miranda
Browse files
Implemented shuffle parameter in preprocessing; shuffled validation data in model_training.py
parent
70b60e20
Changes
2
Hide whitespace changes
Inline
Side-by-side
model_training.py
View file @
fdc34db0
...
...
@@ -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
,
),
}
...
...
source/preprocess.py
View file @
fdc34db0
...
...
@@ -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
):
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment