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
18582b61
Commit
18582b61
authored
Nov 29, 2012
by
Vik Paruchuri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add in dogstatsd hooks for machine learning
parent
1c06c0f7
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
1 deletions
+13
-1
create.py
+7
-0
grade.py
+6
-1
No files found.
create.py
View file @
18582b61
...
...
@@ -10,6 +10,9 @@ sys.path.append(one_up_path)
import
model_creator
import
util_functions
from
statsd
import
statsd
@statsd.timed
(
'open_ended_assessment.machine_learning.creator.time'
)
def
create
(
text
,
score
,
prompt_string
,
model_path
):
results
=
{
'errors'
:
[],
'success'
:
False
,
'cv_kappa'
:
0
,
'cv_mean_absolute_error'
:
0
}
...
...
@@ -29,5 +32,9 @@ def create(text,score,prompt_string,model_path):
except
:
results
[
'errors'
]
.
append
(
"could not write model to: {0}"
.
format
(
model_path
))
#Count number of successful/unsuccessful creations
statsd
.
increment
(
"open_ended_assessment.machine_learning.creator_count"
,
tags
=
[
"success:{0}"
.
format
(
results
[
'success'
])])
return
results
grade.py
View file @
18582b61
...
...
@@ -10,6 +10,7 @@ import pickle
import
os
import
numpy
import
logging
from
statsd
import
statsd
base_path
=
os
.
path
.
dirname
(
__file__
)
sys
.
path
.
append
(
base_path
)
...
...
@@ -25,7 +26,7 @@ log = logging.getLogger(__name__)
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
}
...
...
@@ -87,6 +88,10 @@ def grade(grader_path,grader_config,submission,sandbox=None):
#If error, success is False.
results
[
'success'
]
=
False
#Count number of successful/unsuccessful gradings
statsd
.
increment
(
"open_ended_assessment.machine_learning.grader_count"
,
tags
=
[
"success:{0}"
.
format
(
results
[
'success'
])])
return
results
...
...
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