Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Carlos-Francisco Méndez-Cruz
/
conditional-random-fields
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
2019-02-14 02:17:05 -0600
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
8ba825f98b6620dc81026ac5f133cad23cf70db5
8ba825f9
1 parent
345303cf
Conditional Random Fields
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
6 deletions
training-validation-v1.py
training-validation-v1.py
View file @
8ba825f
...
...
@@ -212,10 +212,11 @@ if __name__ == "__main__":
# Fixed parameters
crf
=
sklearn_crfsuite
.
CRF
(
algorithm
=
'lbfgs'
,
c1
=
0.1
,
c2
=
0.1
,
max_iterations
=
100
,
all_possible_transitions
=
True
#c1=0.1,
#c2=0.1,
max_iterations
=
100
#,
#all_possible_transitions=True
)
# Original: labels = list(crf.classes_)
...
...
@@ -237,9 +238,10 @@ if __name__ == "__main__":
oFile
.
write
(
"********** TRAINING AND TESTING REPORT **********
\n
"
)
oFile
.
write
(
"Training file: "
+
options
.
trainingFile
+
'
\n
'
)
oFile
.
write
(
'
\n
'
)
oFile
.
write
(
"Model: {}"
.
format
(
crf
))
#oFile.write('best params:' + str(crf.best_params_) + '\n')
oFile
.
write
(
'best CV score:'
+
str
(
crf
.
best_score_
)
+
'
\n
'
)
oFile
.
write
(
'model size: {:0.2f}M
\n
'
.
format
(
crf
.
best_estimator_
.
size_
/
1000000
))
#
oFile.write('best CV score:' + str(crf.best_score_) + '\n')
#
oFile.write('model size: {:0.2f}M\n'.format(crf.best_estimator_.size_ / 1000000))
print
(
"Training done in:
%
fs"
%
(
time
()
-
t0
))
t0
=
time
()
...
...
Please
register
or
login
to post a comment