src/random_forest.py
def typeCastColumn(countVector_df):
    '''
    This function type casts column of a dataframe to the specified data type,
    and returns the modified dataframe.
    Arg1 : dataframe whose column has to be typecasted.
    Arg2 : name of the column which has to be typecasted.
    Arg3 : Data type to which it has to be type casted.
    '''

    print('************ insdie type casting **************')
    print('************ insdie type casting **************')
    print('************ insdie type casting **************')

    #typecasting the labels to the integer datatype
    final_df = countVector_df.withColumn('label', countVector_df['label'].cast('int'))

    print('************* returning from type casting ************')
    print('************* returning from type casting ************')
    print('************* returning from type casting ************')

    return final_df

    This function type casts column of a dataframe to the specified data type,
    and returns the modified dataframe.
    Arg1 : dataframe whose column has to be typecasted.
    Arg2 : name of the column which has to be typecasted.
    Arg3 : Data type to which it has to be type casted.
    
This function type casts column of a dataframe to the specified data type,
and returns the modified dataframe.
Arg1 : dataframe whose column has to be typecasted.
Arg2 : name of the column which has to be typecasted.
Arg3 : Data type to which it has to be type casted.
This function type casts column of a dataframe to the specified data type and returns the modified dataframe . Arg1 : dataframe whose column has to be typecasted . Arg2 : name of the column which has to be typecasted . Arg3 : Data type to which it has to be type casted .
def typeCastColumn(countVector_df):
    print('************ insdie type casting **************')
    print('************ insdie type casting **************')
    print('************ insdie type casting **************')
    final_df = countVector_df.withColumn('label', countVector_df['label'].cast('int'))
    print('************* returning from type casting ************')
    print('************* returning from type casting ************')
    print('************* returning from type casting ************')
    return final_df
def typeCastColumn ( countVector_df ) : print ( '************ insdie type casting **************' ) print ( '************ insdie type casting **************' ) print ( '************ insdie type casting **************' ) final_df = countVector_df . withColumn ( 'label' , countVector_df [ 'label' ] . cast ( 'int' ) ) print ( '************* returning from type casting ************' ) print ( '************* returning from type casting ************' ) print ( '************* returning from type casting ************' ) return final_df
This function type casts column of a dataframe to the specified data type,
and returns the modified dataframe.
This function type casts column of a dataframe to the specified data type and returns the modified dataframe .
'''
    This function type casts column of a dataframe to the specified data type,
    and returns the modified dataframe.
    Arg1 : dataframe whose column has to be typecasted.
    Arg2 : name of the column which has to be typecasted.
    Arg3 : Data type to which it has to be type casted.
    ''' #typecasting the labels to the integer datatype
countVector_df