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
889b5bb3
Commit
889b5bb3
authored
Jun 06, 2013
by
Vik Paruchuri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix confidence generation
parent
1708ba59
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
ease/grade.py
+4
-2
No files found.
ease/grade.py
View file @
889b5bb3
...
@@ -175,14 +175,16 @@ def get_confidence_value(algorithm,model,grader_feats,score, scores):
...
@@ -175,14 +175,16 @@ def get_confidence_value(algorithm,model,grader_feats,score, scores):
"""
"""
min_score
=
min
(
numpy
.
asarray
(
scores
))
min_score
=
min
(
numpy
.
asarray
(
scores
))
max_score
=
max
(
numpy
.
asarray
(
scores
))
max_score
=
max
(
numpy
.
asarray
(
scores
))
if
algorithm
==
util_functions
.
AlgorithmTypes
.
classification
:
if
algorithm
==
util_functions
.
AlgorithmTypes
.
classification
and
hasattr
(
model
,
"predict_proba"
)
:
#If classification, predict with probability, which gives you a matrix of confidences per score point
#If classification, predict with probability, which gives you a matrix of confidences per score point
raw_confidence
=
model
.
predict_proba
(
grader_feats
)[
0
,(
float
(
score
)
-
float
(
min_score
))]
raw_confidence
=
model
.
predict_proba
(
grader_feats
)[
0
,(
float
(
score
)
-
float
(
min_score
))]
#TODO: Normalize confidence somehow here
#TODO: Normalize confidence somehow here
confidence
=
raw_confidence
confidence
=
raw_confidence
el
se
:
el
if
hasattr
(
model
,
"predict"
)
:
raw_confidence
=
model
.
predict
(
grader_feats
)[
0
]
raw_confidence
=
model
.
predict
(
grader_feats
)[
0
]
confidence
=
max
(
float
(
raw_confidence
)
-
math
.
floor
(
float
(
raw_confidence
)),
math
.
ceil
(
float
(
raw_confidence
))
-
float
(
raw_confidence
))
confidence
=
max
(
float
(
raw_confidence
)
-
math
.
floor
(
float
(
raw_confidence
)),
math
.
ceil
(
float
(
raw_confidence
))
-
float
(
raw_confidence
))
else
:
confidence
=
0
return
confidence
return
confidence
...
...
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