Sacred & pymongo install + data normalization fix

This commit is contained in:
MatOgr 2022-05-11 19:10:26 +02:00
parent a6daa1b902
commit 041339a0f3
2 changed files with 9 additions and 3 deletions

View File

@ -3,4 +3,6 @@ pandas
numpy numpy
sklearn sklearn
torch torch
matplotlib matplotlib
sacred
pymongo

View File

@ -6,7 +6,10 @@ cols = list(pd.read_csv("data/avocado.csv", nrows=1))
# print("###\n", cols, "\n###") # print("###\n", cols, "\n###")
avocados = pd.read_csv( avocados = pd.read_csv(
"data/avocado.csv").rename(columns={"Unnamed: 0": 'Week'}) "data/avocado.csv").rename(columns={"Unnamed: 0": 'Week'})
avocados.describe(include="all") print(avocados.describe(include="all"))
avg_prices = avocados['AveragePrice']
avocados.drop(['AveragePrice'], axis=1, inplace=True)
# * Retrieve the target column # * Retrieve the target column
# y = avocados.AveragePrice # y = avocados.AveragePrice
@ -43,7 +46,8 @@ print(all_cols)
# avocados = pd.concat([avocados, ohe_df], axis=1) # avocados = pd.concat([avocados, ohe_df], axis=1)
# * Time for normalization # * Time for normalization
mM = MinMaxScaler() mM = MinMaxScaler()
avocados_normed = pd.DataFrame(mM.fit_transform(avocados.values), columns=all_cols) avocados_normed = pd.concat([avg_prices, pd.DataFrame(
mM.fit_transform(avocados.values), columns=all_cols)], axis=1)
print(avocados_normed.head()) print(avocados_normed.head())