A proposed approach is compared with the approaches described in Collaborative Recurrent Autoencoder: Recommend while Learning to Fill in the Blanks and in Large-Scale Off-Target Identification Using Fast and Accurate Dual Regularized One-Class Collaborative Filtering and Its Application to Drug Repurposing.
- First, install docker using these instructions.
- Build the docker image by running
make build
. This make take several minutes. - To run experiments, type
make notebook
. This starts a jupyter notebook server onhttp://localhost:9999
from preprocessing import TextPreprocessor
from models import BlockCoordinateAscent
from metrics import recall_lift
prep = TextPreprocessor(glove_components=300, min_df=5, max_df=0.4)
processed_articles = prep.fit(articles, window=10, epochs=100)
embedded_articles = prep.idf_embed(processed_articles)
model = BlockCoordinateAscent(train_ones, embedded_articles_idf)
model.fit(n_epochs=5)
predictions = model.predict() # filling the missing values in the recommendation matrix
test_metrics = recall_lift(predictions, train_ones, test_ones, 300)
print(test_metrics.recall)
- Unit tests