Skip to content

Instantly share code, notes, and snippets.

@securetorobert
Last active July 12, 2018 00:45
Show Gist options
  • Save securetorobert/99ef19b2566805cc28ee187d86ccad73 to your computer and use it in GitHub Desktop.
Save securetorobert/99ef19b2566805cc28ee187d86ccad73 to your computer and use it in GitHub Desktop.
Required imports for regularization tutorials
#imports
import numpy as np
import pandas as pd
import math
from sklearn.model_selection import train_test_split
from sklearn.linear_model import LinearRegression
from sklearn.linear_model import Ridge
from sklearn.linear_model import Lasso
from sklearn.linear_model import ElasticNet
from sklearn.metrics import mean_squared_error
from sklearn.preprocessing import PolynomialFeatures
from sklearn.pipeline import Pipeline
from sklearn.preprocessing import StandardScaler
import matplotlib.pyplot as plt
import seaborn as sns
sns.set()
%matplotlib inline
#import training dataset
train_df = pd.read_csv('train.csv', index_col='ID')
#see the columns in our data
train_df.info()
# take a look at the head of the dataset
train_df.head()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment