Skip to content

Instantly share code, notes, and snippets.

@MariaLavrovskaya
Last active June 14, 2019 11:39
Show Gist options
  • Save MariaLavrovskaya/96f902dc9a7c057f569862a0425c4bd2 to your computer and use it in GitHub Desktop.
Save MariaLavrovskaya/96f902dc9a7c057f569862a0425c4bd2 to your computer and use it in GitHub Desktop.
#importing the libraries
import pandas as pd
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
import seaborn as sns
import statsmodels.api as sm
%matplotlib inline
from sklearn.model_selection import train_test_split
from sklearn.linear_model import LinearRegression
from sklearn.feature_selection import RFE
from sklearn.linear_model import RidgeCV, LassoCV, Ridge, Lasso
import statsmodels.api as sm
import pyreadr
from sklearn.metrics import mean_squared_error, r2_score
from sklearn.metrics import explained_variance_score
from sklearn import metrics
from sklearn.preprocessing import StandardScaler
#Importing the dataset
result = pyreadr.read_r('Movies.RData') # also works for Rds
print(result.keys())
df = pd.DataFrame(result['movies'], columns=result['movies'].keys() )
df.shape
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment