Skip to content

Instantly share code, notes, and snippets.

View erichooi's full-sized avatar

ERIC KHOO JIUN HOOI erichooi

  • Johor, Malaysia
View GitHub Profile
fig, axes = plt.subplots(16, 4)
fig.set_figheight(60)
fig.set_figwidth(20)
fig.subplots_adjust(hspace=0.4, wspace=0.4)
for i in range(len(data.columns)):
row = i // 4
column = i % 4
sns.stripplot(x="label", y=data.columns[i], data=data, ax=axes[row, column]).set_title("{} VS label".format(data.columns[i]))
data = pd.DataFrame()
for col in _data.columns:
if col != "bookingID" and col != "label":
temp = _data.groupby("bookingID")[col].agg(["mean", "sum", "max", "min"])
data[col + "_mean"] = temp["mean"]
data[col + "_sum"] = temp["sum"]
data[col + "_max"] = temp["max"]
data[col + "_min"] = temp["min"]
@erichooi
erichooi / LSTM_backpropagation.py
Created August 28, 2018 03:46
Implementation of Backpropogation of an LSTM
import numpy as np
def sigmoid(x):
return 1 / (1 + np.exp(-x))
Wa = np.array([0.45, 0.25]).reshape(1, 2)
Wi = np.array([0.95, 0.8]).reshape(1, 2)
Wf = np.array([0.7, 0.45]).reshape(1, 2)
Wo = np.array([0.6, 0.4]).reshape(1, 2)