- Import Required Packages In Matplotlib Inline In From Pathlib Import Path Import Pandas As Pd From Sklearn Mo 1 (90.93 KiB) Viewed 21 times
Import required packages In [ ]: %matplotlib inline In [ ]: from pathlib import Path import pandas as pd from sklearn.mo
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
Import required packages In [ ]: %matplotlib inline In [ ]: from pathlib import Path import pandas as pd from sklearn.mo
Import required packages In [ ]: %matplotlib inline In [ ]: from pathlib import Path import pandas as pd from sklearn.model_selection import train_test_split from sklearn.linear_model import LinearRegression, Lasso, Ridge, LassoCV, BayesianRidge H import statsmodels.formula.api as sm. import matplotlib.pylab as plt Load the dataset In []: flight_df = pd.read_excel('Airfares.xlsx', sheet_name='data') flight_df.shape from dmba import regressionSummary, exhaustive_search from dmba import backward_elimination, forward_selection, stepwise_selection from dmba import adjusted_r2_score, AIC_score, BIC_score In [ ]: M Prep ssing 1.Conduct preprocessing below using FARE as dependent variable and the following variables as independent variables: COUPON, NEW, VACATION, SW, HI, S_INCOME, E_INCOME, S_POP, E_POP, SLOT, GATE, DISTANCE, PAX. At the end of preprocessing, all independent variables should be in a dataframe named X and the dependent variable should be in a Series object(i.e., single-dimension dataframe) named y. 2. Check the missing values. Drop them if needed.