From ce80befd9a6419ef755365b204aeecdbeab05980 Mon Sep 17 00:00:00 2001 From: Adithya Ganesan Date: Sun, 25 Apr 2021 20:02:11 -0400 Subject: [PATCH] added CSV commands --- models/README.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/models/README.md b/models/README.md index a079888..9a758a7 100644 --- a/models/README.md +++ b/models/README.md @@ -11,7 +11,7 @@ Here is an example showing how: with open("model.pickle", "rb") as f: model = pickle.load(f)["clusterModels"]["noOutcome"] #user embeddings are stored in a variable calles user_emb - user_emb = model.transform(user_emb) + transformed_user_emb = model.transform(user_emb) ### **Using pickle files through DLATK** @@ -20,3 +20,11 @@ If the user embeddings have been generated using [DLATK](https://github.com/DLAT python dlatkInterface.py -d {database-name} -t {table-name} -g {group-name} -f {user-embeddings-table-name} --transform_to_feats {dimred-table-name} --load --pickle {path-to-pickle-file} +### **Using CSVs through python** + +If you are using the CSVs, here is an example for how to use it: + + import numpy as np + model = np.loadtxt("model.csv", delimiter=",") + #shape of model: (x, 768) + transformed_user_emb = np.dot(user_emb, model.T)