#NEWLINE# def predict( self , x , nc , significance = None ) : #NEWLINE# #INDENT# 'Constructs prediction intervals for a set of test examples.\n\n\t\tPredicts the output of each test pattern using the underlying model,\n\t\tand applies the (partial) inverse nonconformity function to each\n\t\tprediction, resulting in a prediction interval for each test pattern.\n\n\t\tParameters\n\t\t----------\n\t\tx : numpy array of shape [n_samples, n_features]\n\t\t\tInputs of patters for which to predict output values.\n\n\t\tsignificance : float\n\t\t\tSignificance level (maximum allowed error rate) of predictions.\n\t\t\tShould be a float between 0 and 1. If ``None``, then intervals for\n\t\t\tall significance levels (0.01, 0.02, ..., 0.99) are output in a\n\t\t\t3d-matrix.\n\n\t\tReturns\n\t\t-------\n\t\tp : numpy array of shape [n_samples, 2] or [n_samples, 2, 99}\n\t\t\tIf significance is ``None``, then p contains the interval (minimum\n\t\t\tand maximum boundaries) for each test pattern, and each significance\n\t\t\tlevel (0.01, 0.02, ..., 0.99). If significance is a float between\n\t\t\t0 and 1, then p contains the prediction intervals (minimum and\n\t\t\tmaximum\tboundaries) for the set of test patterns at the chosen\n\t\t\tsignificance level.\n\t\t' #NEWLINE# prediction = self . _underlying_predict ( x ) #NEWLINE# if significance : #NEWLINE# #INDENT# return self . inverse_err_func ( prediction , nc , significance ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# significance = np . arange ( 0.01 , 1.0 , 0.01 ) #NEWLINE# return np . dstack ( [ self . inverse_err_func ( prediction , nc , s ) for s in significance ] )