【数据分析】基于大数据的豆瓣读书数据分析与可视化系统 | 大数据可视化大屏 选题推荐 大数据毕设实战项目 Hadoop SPark java Python

47 阅读6分钟

💖💖作者:计算机毕业设计江挽 💙💙个人简介:曾长期从事计算机专业培训教学,本人也热爱上课教学,语言擅长Java、微信小程序、Python、Golang、安卓Android等,开发项目包括大数据、深度学习、网站、小程序、安卓、算法。平常会做一些项目定制化开发、代码讲解、答辩教学、文档编写、也懂一些降重方面的技巧。平常喜欢分享一些自己开发中遇到的问题的解决办法,也喜欢交流技术,大家有技术代码这一块的问题可以问我! 💛💛想说的话:感谢大家的关注与支持! 💜💜 网站实战项目 安卓/小程序实战项目 大数据实战项目 深度学习实战项目

基于大数据的豆瓣读书数据分析与可视化系统介绍

基于大数据的豆瓣读书数据分析与可视化系统是一个面向图书数据深度挖掘的综合性平台,该系统采用Hadoop分布式存储架构结合Spark计算引擎处理海量豆瓣读书数据,通过HDFS实现数据的分布式存储与管理,利用Spark SQL进行高效的数据查询与统计分析。系统后端提供Django和Spring Boot两种技术方案,前端基于Vue框架配合ElementUI组件库搭建交互界面,运用Echarts图表库实现多维度数据可视化呈现。系统涵盖八大功能模块,包括系统首页展示、个人信息管理、用户权限管理、豆瓣读书数据的增删改查,以及作者维度分析、书籍特征分析、内容价值分析和出版社维度分析四大核心数据挖掘模块。通过Pandas和NumPy进行数据预处理与统计计算,将分析结果以柱状图、折线图、饼图等多种图表形式直观展现,帮助用户从作者产出、书籍评分分布、内容质量评估、出版社市场表现等多个角度洞察图书市场规律,为读者选书和出版决策提供数据支撑,MySQL数据库存储系统运行所需的用户信息与配置数据。

基于大数据的豆瓣读书数据分析与可视化系统演示视频

演示视频

基于大数据的豆瓣读书数据分析与可视化系统演示图片

在这里插入图片描述 在这里插入图片描述 在这里插入图片描述 在这里插入图片描述 在这里插入图片描述 在这里插入图片描述 在这里插入图片描述 在这里插入图片描述

基于大数据的豆瓣读书数据分析与可视化系统代码展示

from pyspark.sql import SparkSession
from pyspark.sql.functions import col, count, avg, desc, when, sum as spark_sum
import pandas as pd
import numpy as np

spark = SparkSession.builder.appName("DoubanBookAnalysis").config("spark.sql.warehouse.dir", "/user/hive/warehouse").config("spark.executor.memory", "2g").config("spark.driver.memory", "1g").getOrCreate()

def author_dimension_analysis(hdfs_path):
    df = spark.read.format("csv").option("header", "true").option("inferSchema", "true").load(hdfs_path)
    df_cleaned = df.filter(col("author").isNotNull() & (col("author") != ""))
    author_book_count = df_cleaned.groupBy("author").agg(count("book_id").alias("book_count")).orderBy(desc("book_count"))
    top_authors = author_book_count.limit(20)
    author_avg_rating = df_cleaned.groupBy("author").agg(avg("rating").alias("avg_rating"), count("book_id").alias("total_books")).filter(col("total_books") >= 3).orderBy(desc("avg_rating"))
    top_rated_authors = author_avg_rating.limit(15)
    author_stats = df_cleaned.groupBy("author").agg(count("book_id").alias("book_count"), avg("rating").alias("avg_rating"), spark_sum("comment_count").alias("total_comments")).orderBy(desc("total_comments"))
    most_discussed_authors = author_stats.limit(10)
    author_productivity = df_cleaned.groupBy("author").agg(count("book_id").alias("productivity_score"), avg(col("pages")).alias("avg_pages")).filter(col("productivity_score") >= 2)
    result_dict = {"top_productive_authors": top_authors.toPandas().to_dict(orient="records"), "top_rated_authors": top_rated_authors.toPandas().to_dict(orient="records"), "most_discussed_authors": most_discussed_authors.toPandas().to_dict(orient="records"), "author_productivity_distribution": author_productivity.toPandas().to_dict(orient="records")}
    return result_dict

def book_feature_analysis(hdfs_path):
    df = spark.read.format("csv").option("header", "true").option("inferSchema", "true").load(hdfs_path)
    df_filtered = df.filter(col("rating").isNotNull() & col("pages").isNotNull())
    rating_distribution = df_filtered.groupBy(when(col("rating") >= 9.0, "9.0-10.0").when((col("rating") >= 8.0) & (col("rating") < 9.0), "8.0-8.9").when((col("rating") >= 7.0) & (col("rating") < 8.0), "7.0-7.9").when((col("rating") >= 6.0) & (col("rating") < 7.0), "6.0-6.9").otherwise("6.0以下").alias("rating_range")).agg(count("book_id").alias("count")).orderBy("rating_range")
    pages_distribution = df_filtered.groupBy(when(col("pages") < 200, "0-200页").when((col("pages") >= 200) & (col("pages") < 400), "200-400页").when((col("pages") >= 400) & (col("pages") < 600), "400-600页").when((col("pages") >= 600) & (col("pages") < 800), "600-800页").otherwise("800页以上").alias("pages_range")).agg(count("book_id").alias("count"), avg("rating").alias("avg_rating")).orderBy("pages_range")
    rating_pages_correlation = df_filtered.select("rating", "pages").toPandas()
    correlation_value = np.corrcoef(rating_pages_correlation["rating"], rating_pages_correlation["pages"])[0, 1]
    high_rated_books = df_filtered.filter(col("rating") >= 8.5).select("book_name", "author", "rating", "pages", "publisher").orderBy(desc("rating")).limit(30)
    low_rated_books = df_filtered.filter(col("rating") < 6.0).select("book_name", "author", "rating", "pages", "publisher").orderBy("rating").limit(20)
    avg_pages_by_rating = df_filtered.groupBy(when(col("rating") >= 9.0, "优秀").when((col("rating") >= 7.0) & (col("rating") < 9.0), "良好").when((col("rating") >= 5.0) & (col("rating") < 7.0), "一般").otherwise("较差").alias("quality_level")).agg(avg("pages").alias("avg_pages"), count("book_id").alias("book_count"))
    result_data = {"rating_distribution": rating_distribution.toPandas().to_dict(orient="records"), "pages_distribution": pages_distribution.toPandas().to_dict(orient="records"), "rating_pages_correlation": round(correlation_value, 4), "high_rated_books_sample": high_rated_books.toPandas().to_dict(orient="records"), "low_rated_books_sample": low_rated_books.toPandas().to_dict(orient="records"), "avg_pages_by_quality": avg_pages_by_rating.toPandas().to_dict(orient="records")}
    return result_data

def content_value_analysis(hdfs_path):
    df = spark.read.format("csv").option("header", "true").option("inferSchema", "true").load(hdfs_path)
    df_valid = df.filter(col("rating").isNotNull() & col("comment_count").isNotNull() & (col("comment_count") > 0))
    df_valid = df_valid.withColumn("value_score", col("rating") * col("comment_count") / 100)
    high_value_books = df_valid.orderBy(desc("value_score")).select("book_name", "author", "rating", "comment_count", "value_score").limit(25)
    rating_comment_groups = df_valid.groupBy(when(col("rating") >= 9.0, "9.0+高分").when((col("rating") >= 8.0) & (col("rating") < 9.0), "8.0-8.9").when((col("rating") >= 7.0) & (col("rating") < 8.0), "7.0-7.9").otherwise("7.0以下").alias("rating_level")).agg(avg("comment_count").alias("avg_comments"), count("book_id").alias("book_count"), spark_sum("comment_count").alias("total_comments"))
    comment_distribution = df_valid.groupBy(when(col("comment_count") < 100, "0-100评论").when((col("comment_count") >= 100) & (col("comment_count") < 500), "100-500评论").when((col("comment_count") >= 500) & (col("comment_count") < 1000), "500-1000评论").when((col("comment_count") >= 1000) & (col("comment_count") < 5000), "1000-5000评论").otherwise("5000+评论").alias("comment_range")).agg(count("book_id").alias("count"), avg("rating").alias("avg_rating")).orderBy("comment_range")
    popularity_quality_matrix = df_valid.withColumn("popularity_level", when(col("comment_count") >= 1000, "高热度").when((col("comment_count") >= 100) & (col("comment_count") < 1000), "中等热度").otherwise("低热度")).withColumn("quality_level", when(col("rating") >= 8.0, "高质量").when((col("rating") >= 6.5) & (col("rating") < 8.0), "中等质量").otherwise("低质量")).groupBy("popularity_level", "quality_level").agg(count("book_id").alias("count"))
    rating_comment_corr_data = df_valid.select("rating", "comment_count").toPandas()
    correlation_coefficient = np.corrcoef(rating_comment_corr_data["rating"], rating_comment_corr_data["comment_count"])[0, 1]
    underrated_books = df_valid.filter((col("rating") >= 8.5) & (col("comment_count") < 500)).select("book_name", "author", "rating", "comment_count").orderBy(desc("rating")).limit(15)
    result_output = {"high_value_books": high_value_books.toPandas().to_dict(orient="records"), "rating_comment_statistics": rating_comment_groups.toPandas().to_dict(orient="records"), "comment_distribution_analysis": comment_distribution.toPandas().to_dict(orient="records"), "popularity_quality_matrix": popularity_quality_matrix.toPandas().to_dict(orient="records"), "rating_comment_correlation": round(correlation_coefficient, 4), "underrated_books_list": underrated_books.toPandas().to_dict(orient="records")}
    return result_output

基于大数据的豆瓣读书数据分析与可视化系统文档展示

在这里插入图片描述

💖💖作者:计算机毕业设计江挽 💙💙个人简介:曾长期从事计算机专业培训教学,本人也热爱上课教学,语言擅长Java、微信小程序、Python、Golang、安卓Android等,开发项目包括大数据、深度学习、网站、小程序、安卓、算法。平常会做一些项目定制化开发、代码讲解、答辩教学、文档编写、也懂一些降重方面的技巧。平常喜欢分享一些自己开发中遇到的问题的解决办法,也喜欢交流技术,大家有技术代码这一块的问题可以问我! 💛💛想说的话:感谢大家的关注与支持! 💜💜 网站实战项目 安卓/小程序实战项目 大数据实战项目 深度学习实战项目