src/utils.py
def create_csv_submission(y_pred):
    """
    DESCRIPTION: 
            Creates the final submission file to be uploaded on Kaggle platform
    INPUT: 
            y_pred: List of sentiment predictions. Contains 1 and -1 values
    """
    with open(PRED_SUBMISSION_FILE, 'w') as csvfile:
        fieldnames = ['Id', 'Prediction']
        writer = csv.DictWriter(csvfile, delimiter=",", fieldnames=fieldnames)
        writer.writeheader()
        r1 = 1
        for r2 in y_pred:
            writer.writerow({'Id':int(r1),'Prediction':r2})
            r1 += 1

    DESCRIPTION: 
            Creates the final submission file to be uploaded on Kaggle platform
    INPUT: 
            y_pred: List of sentiment predictions. Contains 1 and -1 values
    
Creates the final submission file to be uploaded on Kaggle platform
INPUT:
y_pred: List of sentiment predictions. Contains 1 and -1 values
Creates the final submission file to be uploaded on Kaggle platform INPUT : y_pred : List of sentiment predictions . Contains 1 and - 1 values
def create_csv_submission(y_pred):
    with open(PRED_SUBMISSION_FILE, 'w') as csvfile:
        fieldnames = ['Id', 'Prediction']
        writer = csv.DictWriter(csvfile, delimiter=",", fieldnames=fieldnames)
        writer.writeheader()
        r1 = 1
        for r2 in y_pred:
            writer.writerow({'Id':int(r1),'Prediction':r2})
            r1 += 1
def create_csv_submission ( y_pred ) : with open ( PRED_SUBMISSION_FILE , 'w' ) as csvfile : fieldnames = [ 'Id' , 'Prediction' ] writer = csv . DictWriter ( csvfile , delimiter = "," , fieldnames = fieldnames ) writer . writeheader ( ) r1 = 1 for r2 in y_pred : writer . writerow ( { 'Id' : int ( r1 ) , 'Prediction' : r2 } ) r1 += 1
DESCRIPTION:
Creates the final submission file to be uploaded on Kaggle platform
INPUT:
y_pred: List of sentiment predictions.
DESCRIPTION : Creates the final submission file to be uploaded on Kaggle platform INPUT : y_pred : List of sentiment predictions .
"""
    DESCRIPTION: 
            Creates the final submission file to be uploaded on Kaggle platform
    INPUT: 
            y_pred: List of sentiment predictions. Contains 1 and -1 values
    """
y_pred