models/train_classifier.py
def load_data(database_filepath):
    '''This function loads the prepared data from a supplied database filepath.
    
    Then, it defines the independent variable (X) and the dependent variable (Y) respectively.   
    
    If the input is invalid or the data does not exist, this function will raise an error.
    
    INPUT:
    database_filepath --> the location of the SQLite file where the prepared data is stored
    
    OUTPUT:
    X --> This is defined as a set of the message column from the dataframe
    Y --> This is defined as a set of all the categorical columns from the dataframe
    Y.columns --> This is defined as a list of all categorical columns from the dataframe
    '''
    
    #First load the dataset from the database
    engine = create_engine('sqlite:///DisasterResponse.db')
    df = pd.read_sql_table('categorised_messages', engine)
    
    #Now define the X and Y variables and print both including the columns of Y to obtain a list of all categories
    X = df.message
    Y = df.drop(['id', 'message', 'original', 'genre'], axis=1)
    category_names = Y.columns
    
    return X, Y, category_names
This function loads the prepared data from a supplied database filepath.
    
    Then, it defines the independent variable (X) and the dependent variable (Y) respectively.   
    
    If the input is invalid or the data does not exist, this function will raise an error.
    
    INPUT:
    database_filepath --> the location of the SQLite file where the prepared data is stored
    
    OUTPUT:
    X --> This is defined as a set of the message column from the dataframe
    Y --> This is defined as a set of all the categorical columns from the dataframe
    Y.columns --> This is defined as a list of all categorical columns from the dataframe
    
This function loads the prepared data from a supplied database filepath.
Then, it defines the independent variable (X) and the dependent variable (Y) respectively.

If the input is invalid or the data does not exist, this function will raise an error.

-> the location of the SQLite file where the prepared data is stored


This function loads the prepared data from a supplied database filepath . Then it defines the independent variable ( X ) and the dependent variable ( Y ) respectively . If the input is invalid or the data does not exist this function will raise an error . - > the location of the SQLite file where the prepared data is stored
def load_data(database_filepath):
    engine = create_engine('sqlite:///DisasterResponse.db')
    df = pd.read_sql_table('categorised_messages', engine)
    X = df.message
    Y = df.drop(['id', 'message', 'original', 'genre'], axis=1)
    category_names = Y.columns
    return X, Y, category_names
def load_data ( database_filepath ) : engine = create_engine ( 'sqlite:///DisasterResponse.db' ) df = pd . read_sql_table ( 'categorised_messages' , engine ) X = df . message Y = df . drop ( [ 'id' , 'message' , 'original' , 'genre' ] , axis = 1 ) category_names = Y . columns return X , Y , category_names
This function loads the prepared data from a supplied database filepath.
This function loads the prepared data from a supplied database filepath .
'''This function loads the prepared data from a supplied database filepath.
    
    Then, it defines the independent variable (X) and the dependent variable (Y) respectively.   
    
    If the input is invalid or the data does not exist, this function will raise an error.
    
    INPUT:
    database_filepath --> the location of the SQLite file where the prepared data is stored
    
    OUTPUT:
    X --> This is defined as a set of the message column from the dataframe
    Y --> This is defined as a set of all the categorical columns from the dataframe
    Y.columns --> This is defined as a list of all categorical columns from the dataframe
    ''' #First load the dataset from the database #Now define the X and Y variables and print both including the columns of Y to obtain a list of all categories
database_filepath