@@ -137,16 +137,17 @@ def get(self, prediction_id=None, action=None):
137137 if action == 'download' :
138138 pred_path = self ._get_prediction (prediction_id ).file .uri
139139 fset , data = featurize .load_featureset (pred_path )
140- result = pd .DataFrame ({'ts_name' : fset .index ,
141- 'label' : data ['labels' ],
142- 'prediction' : data ['preds' ]},
143- columns = ['ts_name' , 'label' , 'prediction' ])
140+ result = pd .DataFrame ({'label' : data ['labels' ]},
141+ index = fset .index )
144142 if len (data .get ('pred_probs' , [])) > 0 :
145- result ['probability' ] = data ['pred_probs' ].max (axis = 1 ).values
143+ result = pd .concat ((result , data ['pred_probs' ]), axis = 1 )
144+ else :
145+ result ['prediction' ] = data ['preds' ]
146+ result .index .name = 'ts_name'
146147 self .set_header ("Content-Type" , 'text/csv; charset="utf-8"' )
147148 self .set_header ("Content-Disposition" , "attachment; "
148149 "filename=cesium_prediction_results.csv" )
149- self .write (result .to_csv (index = False ))
150+ self .write (result .to_csv (index = True ))
150151 else :
151152 if prediction_id is None :
152153 predictions = [prediction
0 commit comments