#NEWLINE# def map_predict( interface , state , label , inp ) : #NEWLINE# #INDENT# import numpy as np #NEWLINE# ( A , b ) = ( 0 , 0 ) #NEWLINE# out = interface . output ( 0 ) #NEWLINE# for row in inp : #NEWLINE# #INDENT# row = row . strip ( ) . split ( state [ 'delimiter' ] ) #NEWLINE# if ( len ( row ) > 1 ) : #NEWLINE# #INDENT# x_id = ( '' if ( state [ 'id_index' ] == ( - 1 ) ) else row [ state [ 'id_index' ] ] ) #NEWLINE# x = np . array ( ( [ 1 ] + [ ( 0 if ( v in state [ 'missing_vals' ] ) else float ( v ) ) for ( i , v ) in enumerate ( row ) if ( i in state [ 'X_indices' ] ) ] ) ) #NEWLINE# out . add ( x_id , ( np . dot ( x , state [ 'thetas' ] ) , ) )