Skip to content

Commit

Permalink
Hacks for displaying errors on failed scorings.
Browse files Browse the repository at this point in the history
  • Loading branch information
lo5 committed May 9, 2014
1 parent 2a87ef3 commit a6c62be
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 10 deletions.
5 changes: 4 additions & 1 deletion client/src/scripts/h2o-proxy.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ Steam.H2OProxy = (_) ->
#TODO error logging / retries, etc.
go error, result
else
go error, result.data
if result.data.response.status is 'error'
go result.data.error, result.data
else
go error, result.data


filterOutUnhandledModels = (models) -> filter models, (model) -> model.state is 'DONE' and model.model_category is 'Binomial'
Expand Down
7 changes: 4 additions & 3 deletions client/src/scripts/scoring-list-view.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Steam.ScoringListView = (_) ->
data:
input: scoring
output: null
title: scoring.frameKey
title: "Scoring on #{scoring.frameKey}"
caption: "#{scoring.model.model_algorithm} (#{scoring.model.response_column_name})"
timestamp: scoring.timestamp
display: -> activateAndDisplayItem self
Expand Down Expand Up @@ -89,7 +89,7 @@ Steam.ScoringListView = (_) ->
#item.time if error.response then error.response.time else 0
item.state 'error'
item.hasFailed yes
item.data.output = error
item.data.output = result
else
#TODO what does it mean to have > 1 metrics
#TODO put this in the comparison table
Expand All @@ -112,7 +112,8 @@ Steam.ScoringListView = (_) ->
jobs = createScoringJobs items
runScoringJobs jobs, ->
for item in items
item.timestamp = (head item.data.output.metrics).scoring_time
unless item.hasFailed()
item.timestamp = (head item.data.output.metrics).scoring_time
activateAndDisplayItem head items
_.scoringsLoaded()
when 'comparison'
Expand Down
17 changes: 11 additions & 6 deletions client/src/scripts/scoring-view.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ Steam.ScoringView = (_, _scoring) ->
_caption = node$ ''
_timestamp = node$ Date.now()
_comparisonTable = node$ null
_hasComparisonTable = lift$ _comparisonTable, (table) -> not isNull table
_modelSummary = nodes$ []
_hasFailed = node$ no
_failure = node$ null

createModelSummary = (model) ->
[
Expand Down Expand Up @@ -35,10 +36,13 @@ Steam.ScoringView = (_, _scoring) ->
_caption "Scoring on #{input.frameKey}"
_modelSummary createModelSummary input.model
apply$ scoring.isReady, scoring.hasFailed, (isReady, hasFailed) ->
if isReady and not hasFailed
#TODO untested
_timestamp (head scoring.data.output.metrics).scoring_time
displayComparisonTable [ scoring ]
if isReady
if hasFailed
_hasFailed yes
_failure scoring.data.output
else
_timestamp (head scoring.data.output.metrics).scoring_time
displayComparisonTable [ scoring ]
when 'comparison'
comparison = item
_tag 'Comparison'
Expand Down Expand Up @@ -303,5 +307,6 @@ Steam.ScoringView = (_, _scoring) ->
timestamp: _timestamp
modelSummary: _modelSummary
comparisonTable: _comparisonTable
hasComparisonTable: _hasComparisonTable
hasFailed: _hasFailed
failure: _failure
template: 'scoring-view'
8 changes: 8 additions & 0 deletions client/src/templates/scoring-view.jade
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,12 @@
.y-summary-value(data-bind='text:value')
// /ko
// /ko
// ko ifnot:hasFailed
div(data-bind='geyser:comparisonTable')
// /ko
// ko if:hasFailed
h2.y-subtitle Scoring Failure
pre(data-bind='json:failure')
// /ko

0 comments on commit a6c62be

Please sign in to comment.