💖💖作者:计算机毕业设计小途
💙💙个人简介:曾长期从事计算机专业培训教学,本人也热爱上课教学,语言擅长Java、微信小程序、Python、Golang、安卓Android等,开发项目包括大数据、深度学习、网站、小程序、安卓、算法。平常会做一些项目定制化开发、代码讲解、答辩教学、文档编写、也懂一些降重方面的技巧。平常喜欢分享一些自己开发中遇到的问题的解决办法,也喜欢交流技术,大家有技术代码这一块的问题可以问我!
💛💛想说的话:感谢大家的关注与支持!
💜💜
网站实战项目
安卓/小程序实战项目
大数据实战项目
深度学习实战项目
目录
- 食谱菜谱数据可视化与分析系统介绍
- 食谱菜谱数据可视化与分析系统演示视频
- 食谱菜谱数据可视化与分析系统演示图片
- 食谱菜谱数据可视化与分析系统代码展示
- 食谱菜谱数据可视化与分析系统文档展示
食谱菜谱数据可视化与分析系统介绍
基于大数据的食谱菜谱数据可视化与分析系统,主要是把网上常见的食谱菜谱信息收集起来,借助Hadoop和Spark做一批量处理,再用Spark SQL、Pandas、NumPy这些工具做统计和指标计算,最后把结果用图表方式展示出来。系统提供Python+Django和Java+Spring Boot两个版本,前端用Vue、ElementUI、Echarts配合HTML、CSS、JavaScript和jQuery完成页面展示与交互,数据库用MySQL存放用户、菜肴、食材、互动等数据。功能上包括系统首页、数据大屏、用户管理、菜肴信息管理、分类结构分析、烹饪难度分析、食材搭配分析、热度互动分析、制作流程分析、风味洞察分析、个人信息和修改密码。用户可以在后台维护菜肴信息,也能在前台查看不同分类的菜谱数量占比、常见食材搭配、烹饪难度分布、热度互动情况和风味特点,让原本零散的菜谱数据变得更容易观察和比较。整个系统没有堆太多花哨功能,主要是把大数据处理流程和可视化分析串起来,适合作为计算机专业毕业设计来理解和实现。
食谱菜谱数据可视化与分析系统演示视频
点击观看项目演示视频
食谱菜谱数据可视化与分析系统演示图片
食谱菜谱数据可视化与分析系统代码展示
spark=SparkSession.builder.appName("RecipeBigDataAnalysis").master("local[*]").config("spark.sql.shuffle.partitions","4").getOrCreate()defcategory_structure_analysis(request):jdbc_url="jdbc:mysql://localhost:3306/recipe_db"recipe_df=spark.read.format("jdbc").option("url",jdbc_url).option("dbtable","recipe_info").option("user","root").option("password","123456").load()recipe_df=recipe_df.na.fill({"category_name":"未分类","view_count":0,"collect_count":0,"comment_count":0})recipe_df=recipe_df.filter(F.col("recipe_id").isNotNull())recipe_df=recipe_df.filter(F.col("category_name")!="")category_df=recipe_df.groupBy("category_name").agg(F.count("recipe_id").alias("recipe_count"),F.sum("view_count").alias("view_total"),F.sum("collect_count").alias("collect_total"),F.sum("comment_count").alias("comment_total"))total_count=category_df.agg(F.sum("recipe_count").alias("total")).collect()[0]["total"]category_df=category_df.withColumn("ratio",F.round(F.col("recipe_count")/total_count*100,2))category_df=category_df.withColumn("hot_score",F.round(F.col("view_total")*0.5+F.col("collect_total")*0.3+F.col("comment_total")*0.2,2))category_df=category_df.orderBy(F.desc("hot_score"))rows=category_df.collect()chart_data=[]forrowinrows:item={"category":row["category_name"],"count":row["recipe_count"],"ratio":row["ratio"],"hotScore":row["hot_score"]}chart_data.append(item)returnJsonResponse({"code":200,"msg":"分类结构分析成功","data":chart_data})defingredient_pair_analysis(request):jdbc_url="jdbc:mysql://localhost:3306/recipe_db"ingredient_df=spark.read.format("jdbc").option("url",jdbc_url).option("dbtable","recipe_ingredient").option("user","root").option("password","123456").load()ingredient_df=ingredient_df.na.fill({"ingredient_name":"未知食材","recipe_id":0})ingredient_df=ingredient_df.filter(F.col("ingredient_name")!="")ingredient_df=ingredient_df.filter(F.col("recipe_id")>0)ingredient_df=ingredient_df.select("recipe_id","ingredient_name").distinct()self_join_df=ingredient_df.alias("a").join(ingredient_df.alias("b"),F.col("a.recipe_id")==F.col("b.recipe_id"))self_join_df=self_join_df.filter(F.col("a.ingredient_name")<F.col("b.ingredient_name"))pair_df=self_join_df.groupBy(F.col("a.ingredient_name").alias("ingredient_a"),F.col("b.ingredient_name").alias("ingredient_b")).agg(F.count("a.recipe_id").alias("pair_count"))pair_df=pair_df.filter(F.col("pair_count")>=2)pair_df=pair_df.orderBy(F.desc("pair_count"))top_rows=pair_df.limit(50).collect()result=[]forrowintop_rows:result.append({"ingredientA":row["ingredient_a"],"ingredientB":row["ingredient_b"],"pairCount":row["pair_count"]})returnJsonResponse({"code":200,"msg":"食材搭配分析成功","data":result})defhot_interaction_analysis(request):jdbc_url="jdbc:mysql://localhost:3306/recipe_db"interaction_df=spark.read.format("jdbc").option("url",jdbc_url).option("dbtable","recipe_interaction").option("user","root").option("password","123456").load()interaction_df=interaction_df.na.fill({"view_count":0,"collect_count":0,"comment_count":0,"share_count":0,"score":0})interaction_df=interaction_df.filter(F.col("recipe_id").isNotNull())interaction_df=interaction_df.filter(F.col("view_count")>=0)interaction_df=interaction_df.filter(F.col("comment_count")>=0)interaction_df=interaction_df.filter(F.col("score")>=0)interaction_df=interaction_df.withColumn("hot_score",F.round(F.col("view_count")*0.4+F.col("collect_count")*0.25+F.col("comment_count")*0.2+F.col("share_count")*0.1+F.col("score")*0.05,2))hot_df=interaction_df.groupBy("recipe_id").agg(F.max("hot_score").alias("final_score"),F.sum("view_count").alias("total_view"),F.sum("collect_count").alias("total_collect"))hot_df=hot_df.orderBy(F.desc("final_score"))top_rows=hot_df.limit(100).collect()result=[]forrowintop_rows:item={"recipeId":row["recipe_id"],"hotScore":row["final_score"],"totalView":row["total_view"],"totalCollect":row["total_collect"]}result.append(item)returnJsonResponse({"code":200,"msg":"热度互动分析成功","data":result})食谱菜谱数据可视化与分析系统文档展示
💖💖作者:计算机毕业设计小途
💙💙个人简介:曾长期从事计算机专业培训教学,本人也热爱上课教学,语言擅长Java、微信小程序、Python、Golang、安卓Android等,开发项目包括大数据、深度学习、网站、小程序、安卓、算法。平常会做一些项目定制化开发、代码讲解、答辩教学、文档编写、也懂一些降重方面的技巧。平常喜欢分享一些自己开发中遇到的问题的解决办法,也喜欢交流技术,大家有技术代码这一块的问题可以问我!
💛💛想说的话:感谢大家的关注与支持!
💜💜
网站实战项目
安卓/小程序实战项目
大数据实战项目
深度学习实战项目