Skip to main content

Podcast recommendation algorithm in Neo4j

Project description

PodcastRecommendation

0.1.4

Podcast Recommendation Algorithm

Instalar

python3 -m pip install podcast-recommendation
pip install podcast-recommendation
pip install podcast-recommendation==0.1.4

Uso

Import

from podcast_recommendation.algorithm import PodcastRecommendation

Crear objeto

Para utilizarlo debe tener una DataBase abierta en Neo4j con el plugin de Data Science db

pr = PodcastRecommendation('bolt://localhost:7687', ('neo4j', 'password'), verbose=True)
Reading x_train
Reading y_train
Training model
Training complete

Generar grafo

pr.build_graph(verbose=True)
Reading categories
Reading ratings
Creating categories, categories and IsA
Creating users, categories and ratings
Build complete

Se genera un grafo como el siguiente: grafo

Generar recomendaciones

Para recomendar podcast al usuario 6C561484AED5C02

pr.recommend(user_id='6C561484AED5C02')
                          podcast_id     proba
47  b4c3c3ebdd76e284f7d9fa358ac82030  0.999225
31  c9add5e9e81a4b3ca963adab5b87083f  0.999216
30  a37fb116709bfdb2dd58ea4f784cb815  0.999042
42  a3a535f66c7e8004e7dc54c2b2829a9e  0.999038
43  b70d658c901897359bb848cf876cbcbc  0.998779
...

Eliminar el grafo

pr.delete_all()

Eliminar rating

Eliminar rating entre usuario 6C561484AED5C02 y podcast a3a535f66c7e8004e7dc54c2b2829a9e

pr.delete_rtg(user_id='6C561484AED5C02', podcast_id='a3a535f66c7e8004e7dc54c2b2829a9e')

Crear rating

Crear rating de 5 entre usuario 6C561484AED5C02 y podcast a3a535f66c7e8004e7dc54c2b2829a9e

pr.create_rtg(user_id='6C561484AED5C02', podcast_id='a3a535f66c7e8004e7dc54c2b2829a9e', rating=5)

Crear usuario

Crear usuario de id A1A1A1A1A1A1A1

pr.create_user(user_id='A1A1A1A1A1A1A1')

Crear podcast

Crear podcast de id a1a1a1a1a1a1a1a1a1a1a1

pr.create_podcast(podcast_id='a1a1a1a1a1a1a1a1a1a1a1')

Crear categoria

Crear categoria de nombre cat e id 99

pr.create_category(category='cat', category_id=99)

Crear relación IsA

Crear relación podcast de id a1a1a1a1a1a1a1a1a1a1a1 IsA categoria de nombre cat

pr.create_IsA(podcast_id='a1a1a1a1a1a1a1a1a1a1a1', category='cat')

Cerrar driver

pr.close()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

podcast_recommendation-0.1.6.tar.gz (44.6 kB view details)

Uploaded Source

Built Distribution

podcast_recommendation-0.1.6-py3-none-any.whl (45.5 kB view details)

Uploaded Python 3

File details

Details for the file podcast_recommendation-0.1.6.tar.gz.

File metadata

File hashes

Hashes for podcast_recommendation-0.1.6.tar.gz
Algorithm Hash digest
SHA256 948ca207f75f34ddf75c62b584dafcf052961d5d2f38b2e98a1008df8bb92655
MD5 18f1a759b8f6bc4dce3ff614f2b70efa
BLAKE2b-256 01fdd766aa7c63e5a8050f0317f81825e76f11e34504d8682150492bb26a33eb

See more details on using hashes here.

File details

Details for the file podcast_recommendation-0.1.6-py3-none-any.whl.

File metadata

File hashes

Hashes for podcast_recommendation-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 7cccaf3f580af7fd8699bf88c1b4859b840ce0dff28d0e6fd4b1ed55bb43d124
MD5 958b619d7b32909de987a85480fb8bf5
BLAKE2b-256 3342b0ac6d5c77172415e685ffe27743e492798709a0d3d3a56bd66bad632a26

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page