src.components package

Submodules

src.components.ingredients_clustering_page module

class src.components.ingredients_clustering_page.IngredientsClusteringConfig(matrix_path=PosixPath('data/ingredients_cooccurrence_matrix.csv'), ingredients_list_path=PosixPath('data/ingredients_list.csv'), n_ingredients=40, n_clusters=4, tsne_perplexity=30)[source]

Bases : object

Configuration pour l’analyse de clustering d’ingrédients.

matrix_path

Chemin vers la matrice de co-occurrence précalculée.

ingredients_list_path

Chemin vers la liste des ingrédients.

n_ingredients

Nombre d’ingrédients à analyser (de la matrice 300x300).

n_clusters

Nombre de clusters à créer avec K-means.

tsne_perplexity

Paramètre de perplexité pour la visualisation t-SNE.

ingredients_list_path: Path = PosixPath('data/ingredients_list.csv')
matrix_path: Path = PosixPath('data/ingredients_cooccurrence_matrix.csv')
n_clusters: int = 4
n_ingredients: int = 40
tsne_perplexity: int = 30
class src.components.ingredients_clustering_page.IngredientsClusteringPage(matrix_path='data/ingredients_cooccurrence_matrix.csv', ingredients_list_path='data/ingredients_list.csv')[source]

Bases : object

Page Streamlit pour l’analyse de clustering des ingrédients.

Cette classe charge une matrice de co-occurrence PRÉCALCULÉE et effectue le clustering et la visualisation en temps réel.

matrix_path

Chemin vers la matrice de co-occurrence précalculée.

ingredients_list_path

Chemin vers la liste des ingrédients.

logger

Instance du logger pour le suivi des opérations.

render_clusters(clusters, ingredient_names, n_clusters)[source]

Affiche les clusters d’ingrédients.

Type renvoyé:

None

render_cooccurrence_analysis(ingredient_names, matrix)[source]

Affiche l’analyse de co-occurrence interactive.

Type renvoyé:

None

render_sidebar()[source]

Affiche la sidebar avec les paramètres de clustering.

Type renvoyé:

dict[str, int | bool]

Renvoie:

Dictionnaire contenant les paramètres sélectionnés.

render_sidebar_statistics(clusters, ingredient_names)[source]

Affiche les statistiques dans la sidebar.

Type renvoyé:

None

render_tsne_visualization(tsne_data)[source]

Affiche la visualisation t-SNE.

Type renvoyé:

None

run()[source]

Point d’entrée principal de la page.

Type renvoyé:

None

src.components.popularity_analysis_page module

class src.components.popularity_analysis_page.PopularityAnalysisConfig(interactions_path, recipes_path)[source]

Bases : object

interactions_path: Path
recipes_path: Path
class src.components.popularity_analysis_page.PopularityAnalysisPage(interactions_path, recipes_path)[source]

Bases : object

run()[source]

Module contents