src/random_forest.py
def configure_spark(exec_mem, driver_mem, result_mem):
    '''
    This function configures spark. It accepts as input the memory to be allocated
    to each executor, memory to be allocated to the driver and memory to be allocated
    for the output.

    Argument 1(String) : Memory to be allocated to the executors
    Argument 2(String) : Memory to be allocated to the driver
    Argument 3(String) : Max memory to be allocated for the result

    '''
    conf = pyspark.SparkConf().setAppName('Malware Classification')
    conf = (conf.setMaster('local[*]')
       .set('spark.executor.memory', exec_mem)
       .set('spark.driver.memory', driver_mem)
       .set('spark.driver.maxResultSize', result_mem))
    sc = pyspark.SparkContext(conf=conf)
    Spark = SparkSession(sc)
    return sc, Spark

    This function configures spark. It accepts as input the memory to be allocated
    to each executor, memory to be allocated to the driver and memory to be allocated
    for the output.

    Argument 1(String) : Memory to be allocated to the executors
    Argument 2(String) : Memory to be allocated to the driver
    Argument 3(String) : Max memory to be allocated for the result

    
This function configures spark. It accepts as input the memory to be allocated
to each executor, memory to be allocated to the driver and memory to be allocated
for the output.

Argument 1(String) : Memory to be allocated to the executors
Argument 2(String) : Memory to be allocated to the driver
Argument 3(String) : Max memory to be allocated for the result
This function configures spark . It accepts as input the memory to be allocated to each executor memory to be allocated to the driver and memory to be allocated for the output . Argument 1 ( String ) : Memory to be allocated to the executors Argument 2 ( String ) : Memory to be allocated to the driver Argument 3 ( String ) : Max memory to be allocated for the result
def configure_spark(exec_mem, driver_mem, result_mem):
    conf = pyspark.SparkConf().setAppName('Malware Classification')
    conf = (conf.setMaster('local[*]')
       .set('spark.executor.memory', exec_mem)
       .set('spark.driver.memory', driver_mem)
       .set('spark.driver.maxResultSize', result_mem))
    sc = pyspark.SparkContext(conf=conf)
    Spark = SparkSession(sc)
    return sc, Spark
def configure_spark ( exec_mem , driver_mem , result_mem ) : conf = pyspark . SparkConf ( ) . setAppName ( 'Malware Classification' ) conf = ( conf . setMaster ( 'local[*]' ) . set ( 'spark.executor.memory' , exec_mem ) . set ( 'spark.driver.memory' , driver_mem ) . set ( 'spark.driver.maxResultSize' , result_mem ) ) sc = pyspark . SparkContext ( conf = conf ) Spark = SparkSession ( sc ) return sc , Spark
This function configures spark.
This function configures spark .
'''
    This function configures spark. It accepts as input the memory to be allocated
    to each executor, memory to be allocated to the driver and memory to be allocated
    for the output.

    Argument 1(String) : Memory to be allocated to the executors
    Argument 2(String) : Memory to be allocated to the driver
    Argument 3(String) : Max memory to be allocated for the result

    '''
exec_mem
driver_mem
result_mem