src/random_forest.py
def rddToDf_training(dat_rdd):
    '''
    This function converts rdd of the training files to the data frame and returns the dataframe.
    Arg1(rdd) : rdd to be converted to dataframe.
    '''
    #converting the rdd to dataframe with labels
    print('*********** inside to convert into dataframe *********************')
    print('*********** inside to convert into dataframe *********************')
    print('*********** inside to convert into dataframe *********************')

    final_df = dat_rdd.map(lambda line : Row(data = line[1][1],label = line[1][0], filename = line[0])).toDF()
    return final_df

    This function converts rdd of the training files to the data frame and returns the dataframe.
    Arg1(rdd) : rdd to be converted to dataframe.
    
This function converts rdd of the training files to the data frame and returns the dataframe.
Arg1(rdd) : rdd to be converted to dataframe.
This function converts rdd of the training files to the data frame and returns the dataframe . Arg1 ( rdd ) : rdd to be converted to dataframe .
def rddToDf_training(dat_rdd):
    print('*********** inside to convert into dataframe *********************')
    print('*********** inside to convert into dataframe *********************')
    print('*********** inside to convert into dataframe *********************')
    final_df = dat_rdd.map(lambda line : Row(data = line[1][1],label = line[1][0], filename = line[0])).toDF()
    return final_df
def rddToDf_training ( dat_rdd ) : print ( '*********** inside to convert into dataframe *********************' ) print ( '*********** inside to convert into dataframe *********************' ) print ( '*********** inside to convert into dataframe *********************' ) final_df = dat_rdd . map ( lambda line : Row ( data = line [ 1 ] [ 1 ] , label = line [ 1 ] [ 0 ] , filename = line [ 0 ] ) ) . toDF ( ) return final_df
This function converts rdd of the training files to the data frame and returns the dataframe.
This function converts rdd of the training files to the data frame and returns the dataframe .
'''
    This function converts rdd of the training files to the data frame and returns the dataframe.
    Arg1(rdd) : rdd to be converted to dataframe.
    ''' #converting the rdd to dataframe with labels
dat_rdd