model.py
def OLS_model(X, y, X_v, y_v):
    '''
    This function creates, fits, and evaluates an OLS using linear regression model.
    '''
    # create the model object
    lm = LinearRegression(normalize=True)

    # fit the model to our training data.
    lm.fit(X, y)

    # predict on train
    lm_pred = lm.predict(X)
    # compute root mean squared error
    lm_rmse = sqrt(mean_squared_error(y, lm_pred))

    # predict on validate
    lm_pred_v = lm.predict(X_v)
    # compute root mean squared error
    lm_rmse_v = sqrt(mean_squared_error(y_v, lm_pred_v))

    print("RMSE for OLS using Linear Regression\n\nOn train data:\n", round(lm_rmse, 6), '\n\n', 
        "On validate data:\n", round(lm_rmse_v, 6))

    return lm_pred, lm_rmse, lm_pred_v, lm_rmse_v

    This function creates, fits, and evaluates an OLS using linear regression model.
    
This function creates, fits, and evaluates an OLS using linear regression model.
This function creates fits and evaluates an OLS using linear regression model .
def OLS_model(X, y, X_v, y_v):
    lm = LinearRegression(normalize=True)
    lm.fit(X, y)
    lm_pred = lm.predict(X)
    lm_rmse = sqrt(mean_squared_error(y, lm_pred))
    lm_pred_v = lm.predict(X_v)
    lm_rmse_v = sqrt(mean_squared_error(y_v, lm_pred_v))
    print("RMSE for OLS using Linear Regression\n\nOn train data:\n", round(lm_rmse, 6), '\n\n', 
        "On validate data:\n", round(lm_rmse_v, 6))
    return lm_pred, lm_rmse, lm_pred_v, lm_rmse_v
def OLS_model ( X , y , X_v , y_v ) : lm = LinearRegression ( normalize = True ) lm . fit ( X , y ) lm_pred = lm . predict ( X ) lm_rmse = sqrt ( mean_squared_error ( y , lm_pred ) ) lm_pred_v = lm . predict ( X_v ) lm_rmse_v = sqrt ( mean_squared_error ( y_v , lm_pred_v ) ) print ( "RMSE for OLS using Linear Regression\n\nOn train data:\n" , round ( lm_rmse , 6 ) , '\n\n' , "On validate data:\n" , round ( lm_rmse_v , 6 ) ) return lm_pred , lm_rmse , lm_pred_v , lm_rmse_v
This function creates, fits, and evaluates an OLS using linear regression model.
This function creates fits and evaluates an OLS using linear regression model .
'''
    This function creates, fits, and evaluates an OLS using linear regression model.
    ''' # create the model object # fit the model to our training data. # predict on train # compute root mean squared error # predict on validate # compute root mean squared error
X
y
X_v
y_v