Skip to content

Commit

Permalink
added CSV commands
Browse files Browse the repository at this point in the history
  • Loading branch information
adithya8 committed Apr 26, 2021
1 parent 30261e7 commit ce80bef
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion models/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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**

Expand All @@ -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)

0 comments on commit ce80bef

Please sign in to comment.