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
f48373e3
Commit
f48373e3
authored
Dec 06, 2012
by
Vik Paruchuri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add in support for returning ml confidence
parent
0b1b7f2f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
1 deletions
+11
-1
grade.py
+11
-1
No files found.
grade.py
View file @
f48373e3
...
...
@@ -29,7 +29,7 @@ TEMPORARY_WANTS_CONFIG=True
@statsd.timed
(
'open_ended_assessment.machine_learning.grader.time'
)
def
grade
(
grader_path
,
grader_config
,
submission
,
sandbox
=
None
):
results
=
{
'errors'
:
[],
'tests'
:
[],
'score'
:
0
,
'feedback'
:
""
,
'success'
:
False
}
results
=
{
'errors'
:
[],
'tests'
:
[],
'score'
:
0
,
'feedback'
:
""
,
'success'
:
False
,
'confidence'
:
0
}
has_error
=
False
...
...
@@ -59,6 +59,16 @@ def grade(grader_path,grader_config,submission,sandbox=None):
results
[
'errors'
]
.
append
(
"Could not extract features and score essay."
)
has_error
=
True
#Try to determine confidence level
try
:
min_score
=
min
(
grader_data
[
'score'
])
raw_confidence
=
grader_data
[
'model'
]
.
predict_proba
(
grader_feats
)[
0
,(
results
[
'score'
]
-
min_score
)]
#TODO: Normalize confidence somehow here
results
[
'confidence'
]
=
raw_confidence
except
:
#If there is an error getting confidence, it is not a show-stopper, so just log
log
.
exception
(
"Problem generating confidence value"
)
if
not
has_error
:
if
(
len
(
feedback
[
'prompt_overlap'
])
>
4
):
...
...
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