text_plain_output_1.png
from matplotlib import style

from subprocess import check_output

import numpy as np # linear algebra

import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)

import numpy as np
import pandas as pd
from matplotlib import pyplot as plt
from matplotlib import style
style.use('ggplot')
from sklearn.preprocessing import Imputer
from sklearn.linear_model import LinearRegression
from sklearn.preprocessing import scale
from collections import Counter
import seaborn as sns
from sklearn.preprocessing import LabelEncoder, OneHotEncoder
from subprocess import check_output
train = pd.read_csv('../input/training-set/Train_A102.csv')
test = pd.read_csv('../input/test-a102csv/Test_A102 (1).csv')
test['Item_Outlet_Sales'] = np.nan
combined_set = train.append(test)
combined_set.replace('', np.NaN)
combined_meanset = combined_set.copy(deep=True)
combined_meanset['Item_Weight'].fillna(value=12.792854, inplace=True)
combined_medianset = combined_set.copy(deep=True)
combined_medianset['Item_Weight'].fillna(value=12.6, inplace=True)
combined_set['Item_Weight'].fillna(value=12.6, inplace=True)
train.plot.density()
combined_set['Outlet_Size'].fillna(value='Medium', inplace=True)
combined_set['Item_Outlet_Sales'].fillna(value=-999, inplace=True)
X = train.iloc[:, 0:].values
item_outlet_sales = X[:, 11]
Outliers = item_outlet_sales > 6501
combined_set['Item_Fat_Content'] = combined_set['Item_Fat_Content'].replace({'low fat': 'LF', 'Low Fat': 'LF', 'Regular': 'reg'})

combined_mean_modelset = combined_set.copy(deep=True)
combined_mean_modelset['Item_Outlet_Sales'] = combined_mean_modelset['Item_Outlet_Sales'].replace(to_replace=-999, value=2181.3)

X = combined_mean_modelset.iloc[:, :-1].values
Y = combined_mean_modelset.iloc[:, 11].values

X = pd.DataFrame(X)
X.dtypes