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
C
clowdflows
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Alain Shakour
clowdflows
Commits
a2cc7e77
Commit
a2cc7e77
authored
Dec 02, 2014
by
Anze Vavpetic
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added weka `apply classifier get instances` and `get attribute values` widgets
parent
0e12851e
Changes
2
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
503 additions
and
250 deletions
+503
-250
workflows/weka/db/package_data.json
workflows/weka/db/package_data.json
+479
-249
workflows/weka/library.py
workflows/weka/library.py
+24
-1
No files found.
workflows/weka/db/package_data.json
View file @
a2cc7e77
This diff is collapsed.
Click to expand it.
workflows/weka/library.py
View file @
a2cc7e77
import
StringIO
import
arff
from
services.webservice
import
WebService
def
weka_statistics
(
input_dict
):
summary
=
input_dict
[
'summary'
]
class_index
=
int
(
input_dict
[
'classIndex'
])
...
...
@@ -29,3 +34,21 @@ def weka_statistics(input_dict):
output_dict
[
'fp_rate'
]
=
fp_rate
output_dict
[
'f'
]
=
f
return
output_dict
def
weka_get_attr_list
(
input_dict
):
'''
Returns attribute values for a single attribute from the dataset. Defaults to the last attribute.
E.g., useful for calculating classification statistics.
'''
arff_file
=
input_dict
[
'arff_file'
]
attr_name
=
input_dict
.
get
(
'attr_name'
,
None
)
attr_list
=
[]
for
row
in
arff
.
loads
(
arff_file
):
if
attr_name
:
attr
=
getattr
(
row
,
attr_name
)
else
:
# Default to last row value
attr
=
row
[
len
(
row
)
-
1
]
attr_list
.
append
(
attr
)
return
{
'attr_list'
:
attr_list
}
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