classifier/classifier.py
def create_submission(featureType, preds, images):
    ''' 
    Creates submission csv for the particular feature type
    ------------------------------
    Parameters
    ----------
    featureType : str
        type of features being used

    preds : ndarray
        predicted probabilities for each class

    images : ndarray
        1-D array of image filepaths

    '''

    print('Creating submission')
    if(type(preds) is not list):
        preds = preds.transpose()
    c0, c1, c2, c3, c4, c5, c6, c7, c8, c9 = preds
    submission_data = pd.DataFrame({    
        'img':  [x.split('/')[-1] for x in images],
        'c0': c0,
        'c1': c1,
        'c2': c2,
        'c3': c3,
        'c4': c4,
        'c5': c5,
        'c6': c6,
        'c7': c7,
        'c8': c8,
        'c9': c9,
    })
    
    fileName = '{}/{}_submission.csv'.format('submissions', featureType)
    
    submission_data[['img', 'c0', 'c1', 'c2', 'c3',
         'c4', 'c5', 'c6', 'c7', 'c8', 'c9']].to_csv(fileName, index=False)
 
    Creates submission csv for the particular feature type
    ------------------------------
    Parameters
    ----------
    featureType : str
        type of features being used

    preds : ndarray
        predicted probabilities for each class

    images : ndarray
        1-D array of image filepaths

    
Creates submission csv for the particular feature type
Parameters

featureType : str
type of features being used

preds : ndarray
predicted probabilities for each class

images : ndarray
1-D array of image filepaths
Creates submission csv for the particular feature type Parameters featureType : str type of features being used preds : ndarray predicted probabilities for each class images : ndarray 1 - D array of image filepaths
def create_submission(featureType, preds, images):
    print('Creating submission')
    if(type(preds) is not list):
        preds = preds.transpose()
    c0, c1, c2, c3, c4, c5, c6, c7, c8, c9 = preds
    submission_data = pd.DataFrame({    
        'img':  [x.split('/')[-1] for x in images],
        'c0': c0,
        'c1': c1,
        'c2': c2,
        'c3': c3,
        'c4': c4,
        'c5': c5,
        'c6': c6,
        'c7': c7,
        'c8': c8,
        'c9': c9,
    })
    fileName = '{}/{}_submission.csv'.format('submissions', featureType)
    submission_data[['img', 'c0', 'c1', 'c2', 'c3',
         'c4', 'c5', 'c6', 'c7', 'c8', 'c9']].to_csv(fileName, index=False)
def create_submission ( featureType , preds , images ) : print ( 'Creating submission' ) if ( type ( preds ) is not list ) : preds = preds . transpose ( ) c0 , c1 , c2 , c3 , c4 , c5 , c6 , c7 , c8 , c9 = preds submission_data = pd . DataFrame ( { 'img' : [ x . split ( '/' ) [ - 1 ] for x in images ] , 'c0' : c0 , 'c1' : c1 , 'c2' : c2 , 'c3' : c3 , 'c4' : c4 , 'c5' : c5 , 'c6' : c6 , 'c7' : c7 , 'c8' : c8 , 'c9' : c9 , } ) fileName = '{}/{}_submission.csv' . format ( 'submissions' , featureType ) submission_data [ [ 'img' , 'c0' , 'c1' , 'c2' , 'c3' , 'c4' , 'c5' , 'c6' , 'c7' , 'c8' , 'c9' ] ] . to_csv ( fileName , index = False )
Creates submission csv for the particular feature type
Parameters
Creates submission csv for the particular feature type Parameters
''' 
    Creates submission csv for the particular feature type
    ------------------------------
    Parameters
    ----------
    featureType : str
        type of features being used

    preds : ndarray
        predicted probabilities for each class

    images : ndarray
        1-D array of image filepaths

    '''
featureType
preds
images