Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Carlos-Francisco Méndez-Cruz
/
lcg-bioinfoI-bionlp
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
Carlos-Francisco Méndez-Cruz
2018-09-28 05:03:54 -0500
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
f18f366c5ab2bfb2e835f2345d5d3a3d6478045f
f18f366c
1 parent
e9b4885b
Training, crossvalidation and testing dataset
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 additions
and
5 deletions
clasificacion-automatica/binding-thrombin-dataset/imb-training-testing-binding-thrombin.py
clasificacion-automatica/binding-thrombin-dataset/imb-training-testing-binding-thrombin.py
View file @
f18f366
...
...
@@ -210,15 +210,14 @@ if __name__ == "__main__":
print
(
" Done!"
)
y_pred
=
myClassifier
.
predict
(
X_test
)
best_parameters
=
myClassifier
.
best_estimator_
.
get_params
()
print
(
" Done!"
)
print
(
"Saving report..."
)
with
open
(
os
.
path
.
join
(
args
.
outputReportPath
,
args
.
outputReportFile
),
mode
=
'w'
,
encoding
=
'utf8'
)
as
oFile
:
oFile
.
write
(
'********** EVALUATION REPORT **********
\n
'
)
oFile
.
write
(
'Reduction: {}
\n
'
.
format
(
args
.
reduction
))
oFile
.
write
(
'Classifier: {}
\n
'
.
format
(
args
.
myClassifier
))
oFile
.
write
(
'Kernel: {}
\n
'
.
format
(
args
.
kernel
))
oFile
.
write
(
'Training score: {}
\n
'
.
format
(
myClassifier
.
score
()))
oFile
.
write
(
'Accuracy: {}
\n
'
.
format
(
accuracy_score
(
y_test
,
y_pred
)))
oFile
.
write
(
'Precision: {}
\n
'
.
format
(
precision_score
(
y_test
,
y_pred
,
average
=
'weighted'
)))
oFile
.
write
(
'Recall: {}
\n
'
.
format
(
recall_score
(
y_test
,
y_pred
,
average
=
'weighted'
)))
...
...
@@ -227,9 +226,6 @@ if __name__ == "__main__":
oFile
.
write
(
str
(
confusion_matrix
(
y_test
,
y_pred
))
+
'
\n
'
)
oFile
.
write
(
'Classification report:
\n
'
)
oFile
.
write
(
classification_report
(
y_test
,
y_pred
)
+
'
\n
'
)
oFile
.
write
(
'Best parameters:
\n
'
)
for
param
in
sorted
(
best_parameters
.
keys
()):
oFile
.
write
(
"
\t
%
s:
%
r
\n
"
%
(
param
,
best_parameters
[
param
]))
print
(
" Done!"
)
print
(
"Training and testing done in:
%
fs"
%
(
time
()
-
t0
))
...
...
Please
register
or
login
to post a comment