original_docstring: 
          predict using a trained single pass model
          
docstring: predict using a trained single pass model
docstring_tokens: predict using a trained single pass model
code: def single_predict(self, notes, model, pair_type, evalu=False, predict_prob=False):
          '''
          predict using a trained single pass model
          '''
  
          XL, XR, _labels, pair_index = self._get_test_input(notes, pair_type)
  
          # get expected length of model input
          model_input_len = model.input_shape[0][2]
  
          if model_input_len > XL.shape[2]:
              # pad input matrix to fit expected length
              filler = np.ones((1, 1, model_input_len))
              XL, _ = Network._pad_to_match_dimensions(XL, filler, 2, pad_left=True)
              XR, _ = Network._pad_to_match_dimensions(XR, filler, 2, pad_left=True)
          else:
              XL = Network._strip_to_length(XL, model_input_len, 2)
              XR = Network._strip_to_length(XR, model_input_len, 2)
  
          print 'Predicting...'
          labels = model.predict_classes([XL, XR])
          if predict_prob:
              probs = model.predict_proba([XL, XR])
          else:
              probs = None
  
          # format of pair_index: {(note_index, (e1, e2)) : index}
          return labels, probs, pair_index
code_tokens: def single_predict ( self , notes , model , pair_type , evalu = False , predict_prob = False ) : XL , XR , _labels , pair_index = self . _get_test_input ( notes , pair_type ) model_input_len = model . input_shape [ 0 ] [ 2 ] if model_input_len > XL . shape [ 2 ] : filler = np . ones ( ( 1 , 1 , model_input_len ) ) XL , _ = Network . _pad_to_match_dimensions ( XL , filler , 2 , pad_left = True ) XR , _ = Network . _pad_to_match_dimensions ( XR , filler , 2 , pad_left = True ) else : XL = Network . _strip_to_length ( XL , model_input_len , 2 ) XR = Network . _strip_to_length ( XR , model_input_len , 2 ) print 'Predicting...' labels = model . predict_classes ( [ XL , XR ] ) if predict_prob : probs = model . predict_proba ( [ XL , XR ] ) else : probs = None return labels , probs , pair_index
short_docstring: predict using a trained single pass model
short_docstring_tokens: predict using a trained single pass model
comment: '''
          predict using a trained single pass model
          '''$SEP$# get expected length of model input$SEP$# pad input matrix to fit expected length$SEP$# format of pair_index: {(note_index, (e1, e2)) : index}