This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app_infos = [] | |
for ap in tqdm(app_packages): | |
info = app(ap, lang='en', country='us') | |
del info['comments'] | |
app_infos.append(info) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app_packages = [ | |
'com.anydo', | |
'com.todoist', | |
'com.ticktick.task', | |
'com.habitrpg.android.habitica', | |
'cc.forestapp', | |
'com.oristats.habitbull', | |
'com.levor.liferpgtasks', | |
'com.habitnow', | |
'com.microsoft.todos', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import pandas as pd | |
from tqdm import tqdm | |
import seaborn as sns | |
import matplotlib.pyplot as plt | |
from pygments import highlight | |
from pygments.lexers import JsonLexer | |
from pygments.formatters import TerminalFormatter |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
y_pred = model.predict(X_test) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
model.evaluate(X_test, y_test) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
history = model.fit( | |
X_train, y_train, | |
epochs=20, | |
batch_size=32, | |
validation_split=0.1, | |
shuffle=False | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
model = keras.Sequential() | |
model.add( | |
keras.layers.Bidirectional( | |
keras.layers.LSTM( | |
units=128, | |
input_shape=[X_train.shape[1], X_train.shape[2]] | |
) | |
) | |
) | |
model.add(keras.layers.Dropout(rate=0.5)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
enc = OneHotEncoder(handle_unknown='ignore', sparse=False) | |
enc = enc.fit(y_train) | |
y_train = enc.transform(y_train) | |
y_test = enc.transform(y_test) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
print(X_train.shape, y_train.shape) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TIME_STEPS = 200 | |
STEP = 40 | |
X_train, y_train = create_dataset( | |
df_train[['x_axis', 'y_axis', 'z_axis']], | |
df_train.activity, | |
TIME_STEPS, | |
STEP | |
) |