Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Naundorf
HPC_Vehicle_Classification
Commits
4b17b010
Commit
4b17b010
authored
Jun 18, 2022
by
Naundorf
Browse files
Update KI-KNN
parent
c501e5f9
Pipeline
#6556
failed with stage
in 2 minutes and 19 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
KI-KNN
View file @
4b17b010
...
...
@@ -48,6 +48,22 @@ metrics=[constants.ACCURACY_METRICS])
print
(
model
.
summary
())
return
model
def
preprocessing_csv_data
():
print
(
"Reading Features... "
)
data
=
pd
.
read_csv
(
constants
.
FEATURES_CSV_NAME
)
data
.
head
()
#
Dropping
unnecessary
columns
(
Column
Filename
is
dropped
)
data
=
data
.
drop
([
'filename'
],
axis
=
1
)
data
.
head
()
return
data
#
Extracting
classes
/
label
column
as
y
from
csv
and
converting
string
labels
to
numbers
using
LabelEncoder
def
encode_labels
(
data
):
list
=
data
.
iloc
[:,
-
1
]
encoder
=
LabelEncoder
()
target_labels
=
encoder
.
fit_transform
(
list
)
return
target_labels
,
encoder
def
train_and_save_model
(
model
,
X_train
,
y_train
,
X_test
,
y_test
):
logdir
=
constants
.
LOG_DIR_PATH
tensorboard_callback
=
keras
.
callbacks
.
TensorBoard
(
log_dir
=
logdir
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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