Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
inovisao
pynovisao
Commits
2056b1bb
Commit
2056b1bb
authored
Oct 01, 2016
by
Alessandro dos Santos Ferreira
Browse files
Pynovisao - Corrigindo verificacao de python-weka-wrapper
parent
3878d015
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
9 deletions
+8
-9
src/classification/__init__.py
src/classification/__init__.py
+4
-5
src/pynovisao.py
src/pynovisao.py
+4
-4
No files found.
src/classification/__init__.py
View file @
2056b1bb
from
.classifier
import
Classifier
from
.weka_classifiers
import
WekaClassifiers
try
:
import
weka.core.jvm
as
jvm
jvm
.
start
()
weka_is_defined
=
True
from
.weka_classifiers
import
WekaClassifiers
except
:
w
eka
_is_defined
=
Fals
e
W
eka
Classifiers
=
Non
e
__all__
=
[
"classifier"
,
"weka_classifiers"
]
...
...
@@ -18,8 +17,8 @@ from util.config import Config
_classifier_list
=
OrderedDict
(
[
[
"weka_classifiers"
,
Config
(
WekaClassifiers
().
get_name
(),
weka_is_defined
,
bool
,
meta
=
WekaClassifiers
,
hidden
=
not
weka_is_defined
)]
,
[
"invalid"
,
Config
(
"Invalid"
,
True
,
bool
,
meta
=
None
,
hidden
=
Tru
e
)]
[
"weka_classifiers"
,
Config
(
"Invalid"
if
WekaClassifiers
is
None
else
WekaClassifiers
().
get_name
()
,
WekaClassifiers
is
not
None
,
bool
,
meta
=
WekaClassifiers
,
hidden
=
WekaClassifiers
is
Non
e
)]
]
)
def
get_classifier_config
():
...
...
src/pynovisao.py
View file @
2056b1bb
...
...
@@ -281,7 +281,7 @@ class Act(object):
self
.
tk
.
append_log
(
"%s"
,
'
\n
'
.
join
([
extraction
.
_extractor_list
[
extractor
].
label
for
extractor
in
extraction
.
_extractor_list
if
extraction
.
_extractor_list
[
extractor
].
value
==
True
]))
output_file
,
run_time
=
fextractor
.
extract_all
(
self
.
dataset
,
"train
n
ing"
)
output_file
,
run_time
=
fextractor
.
extract_all
(
self
.
dataset
,
"training"
)
self
.
tk
.
append_log
(
"
\n
Output file saved in %s"
,
output_file
)
self
.
tk
.
append_log
(
"Time elapsed: %0.3f seconds"
,
run_time
)
...
...
@@ -345,14 +345,14 @@ class Act(object):
list_segments
=
self
.
segmenter
.
get_list_segments
()
if
self
.
classifier
.
must_train
():
self
.
tk
.
append_log
(
"Creating train
n
ing data... (%0.3f seconds)"
,
(
TimeUtils
.
get_time
()
-
start_time
))
self
.
tk
.
append_log
(
"Creating training data... (%0.3f seconds)"
,
(
TimeUtils
.
get_time
()
-
start_time
))
fextractor
=
FeatureExtractor
(
self
.
extractors
)
output_file
,
run_time
=
fextractor
.
extract_all
(
self
.
dataset
,
"train
n
ing"
,
overwrite
=
False
)
output_file
,
run_time
=
fextractor
.
extract_all
(
self
.
dataset
,
"training"
,
overwrite
=
False
)
self
.
tk
.
append_log
(
"Training classifier... (%0.3f seconds)"
,
(
TimeUtils
.
get_time
()
-
start_time
))
self
.
classifier
.
train
(
self
.
dataset
,
"train
n
ing"
)
self
.
classifier
.
train
(
self
.
dataset
,
"training"
)
self
.
_image
=
self
.
_const_image
...
...
Write
Preview
Markdown
is supported
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