Algorithm module
PodcastRecommendation
__init__(self, uri, auth, x_path=None, y_path=None, verbose=False)
special
Creates object. Reads files to train Logistic Regression model.
| Parameters: |
|
|---|
adamic_adar(self, user_id, podcast_id)
Generates data from Adamic Adar metric
| Parameters: |
|
|---|
| Returns: |
|
|---|
build_cat(self, row)
Builds relations in categories_sample dataset
| Parameters: |
|
|---|
build_graph(self, cat_path=None, rtg_path=None, delete_all=True, verbose=False)
Builds graph in neo4j
| Parameters: |
|
|---|
build_rtg(self, row)
Builds relations in ratings_sample dataset
| Parameters: |
|
|---|
close(self)
Closes driver.
create_IsA(self, podcast_id, category)
Creates an IsA relationship
| Parameters: |
|
|---|
create_category(self, category, category_id)
Creates category
| Parameters: |
|
|---|
create_podcast(self, podcast_id, title)
Creates a podcast
| Parameters: |
|
|---|
create_rtg(self, user_id, podcast_id, rating)
Create rating relationship
| Parameters: |
|
|---|
create_user(self, user_id)
Creates user
| Parameters: |
|
|---|
delete_IsA(self, podcast_id, category)
Deletes IsA relationship
| Parameters: |
|
|---|
delete_all(self)
Deletes all elements in the graph
delete_cat(self, category)
Deletes category
| Parameters: |
|
|---|
delete_podcast(self, podcast_id)
Deletes podcast
| Parameters: |
|
|---|
delete_rtg(self, user_id, podcast_id)
Deletes rating relationship
| Parameters: |
|
|---|
delete_user(self, user_id)
Deletes user
| Parameters: |
|
|---|
gen_data(self, df)
Generates data for podcast recommendation
| Parameters: |
|
|---|
| Returns: |
|
|---|
gen_data_row(self, row)
Helper for gen_data
| Parameters: |
|
|---|
| Returns: |
|
|---|
gen_df(self, user_id)
Generates df with podcasts of interest
| Parameters: |
|
|---|
| Returns: |
|
|---|
gen_podcasts(self, user_id)
Helper for gen_df. Uses paths (user)-[*3]->(podcast)
| Parameters: |
|
|---|
| Returns: |
|
|---|
get_cat_based(self, user_id, podcast_id)
Generates data from paths (user)->(podcast)->(category)<-(podcast)
| Parameters: |
|
|---|
| Returns: |
|
|---|
get_user_based(self, user_id, podcast_id)
Generates data from paths (user)->(podcast)<-(user)->(podcast)
| Parameters: |
|
|---|
| Returns: |
|
|---|
recommend(self, user_id)
Generates podcast recommendation for user
| Parameters: |
|
|---|
| Returns: |
|
|---|
resource_allocation(self, user_id, podcast_id)
Generates data from resource allocation metric
| Parameters: |
|
|---|
| Returns: |
|
|---|