Code Required on github for comprehensive Learning path to become a data scientist in 2018 course

python
analyticsvidhya
github

#1

Hello,

@analyticsvidhya

I am doing the following course from Analytics Vidhya: A comprehensive Learning path to become a data scientist in 2018

However the code snippets provided are jumbled up,difficult to decipher Can i request you to upload all the code snippets on github or point to me to a location where they might already be posted (on github)

Thanks,

Mohit


#2

Hi @mohitlearns,

Can you specify which particular topic are you referring to?


#3

well, I am currently at running through the regression model …thats where its all jumbled up.


#4

Hi @mohitlearns

The codes arent available on github. I have set the code for the first section in the correct format. Have a look below

# importing basic libraries
import numpy as np 
import pandas as pd 
from pandas import Series, DataFrame 
from sklearn.model_selection import train_test_split 

#load train test files
train = pd.read_csv('Train.csv') 
test = pd.read_csv('test.csv') 

# importing linear regression from sklearn 
from sklearn.linear_model import LinearRegression 
lreg = LinearRegression() 

#splitting into training and cv for cross validation 
X = train.loc[:,['Outlet_Establishment_Year','Item_MRP']] 
x_train, x_cv, y_train, y_cv = train_test_split(X,train.Item_Outlet_Sales) 

#training the model 
lreg.fit(x_train,y_train) 

#predicting on cv 
pred = lreg.predict(x_cv) 

#calculating mse 
mse = np.mean((pred - y_cv)**2) 

You can refer the following link