Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
ease
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
ease
Commits
026dee57
Commit
026dee57
authored
Jun 07, 2013
by
Vik Paruchuri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
explicit int conversions
parent
61936085
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletions
+5
-1
ease/util_functions.py
+5
-1
No files found.
ease/util_functions.py
View file @
026dee57
...
@@ -345,6 +345,8 @@ def quadratic_weighted_kappa(rater_a, rater_b, min_rating=None, max_rating=None)
...
@@ -345,6 +345,8 @@ def quadratic_weighted_kappa(rater_a, rater_b, min_rating=None, max_rating=None)
Returns a float corresponding to the kappa correlation
Returns a float corresponding to the kappa correlation
"""
"""
assert
(
len
(
rater_a
)
==
len
(
rater_b
))
assert
(
len
(
rater_a
)
==
len
(
rater_b
))
rater_a
=
[
int
(
a
)
for
a
in
rater_a
]
rater_b
=
[
int
(
b
)
for
b
in
rater_b
]
if
min_rating
is
None
:
if
min_rating
is
None
:
min_rating
=
min
(
rater_a
+
rater_b
)
min_rating
=
min
(
rater_a
+
rater_b
)
if
max_rating
is
None
:
if
max_rating
is
None
:
...
@@ -383,6 +385,8 @@ def confusion_matrix(rater_a, rater_b, min_rating=None, max_rating=None):
...
@@ -383,6 +385,8 @@ def confusion_matrix(rater_a, rater_b, min_rating=None, max_rating=None):
assert
(
len
(
rater_a
)
==
len
(
rater_b
))
assert
(
len
(
rater_a
)
==
len
(
rater_b
))
rater_a
=
[
int
(
a
)
for
a
in
rater_a
]
rater_a
=
[
int
(
a
)
for
a
in
rater_a
]
rater_b
=
[
int
(
b
)
for
b
in
rater_b
]
rater_b
=
[
int
(
b
)
for
b
in
rater_b
]
min_rating
=
int
(
min_rating
)
max_rating
=
int
(
max_rating
)
if
min_rating
is
None
:
if
min_rating
is
None
:
min_rating
=
min
(
rater_a
)
min_rating
=
min
(
rater_a
)
if
max_rating
is
None
:
if
max_rating
is
None
:
...
@@ -391,7 +395,7 @@ def confusion_matrix(rater_a, rater_b, min_rating=None, max_rating=None):
...
@@ -391,7 +395,7 @@ def confusion_matrix(rater_a, rater_b, min_rating=None, max_rating=None):
conf_mat
=
[[
0
for
i
in
range
(
num_ratings
)]
conf_mat
=
[[
0
for
i
in
range
(
num_ratings
)]
for
j
in
range
(
num_ratings
)]
for
j
in
range
(
num_ratings
)]
for
a
,
b
in
zip
(
rater_a
,
rater_b
):
for
a
,
b
in
zip
(
rater_a
,
rater_b
):
conf_mat
[
a
-
min_rating
][
b
-
min_rating
]
+=
1
conf_mat
[
int
(
a
-
min_rating
)][
int
(
b
-
min_rating
)
]
+=
1
return
conf_mat
return
conf_mat
...
...
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