【数据分析】基于大数据的化妆品数据可视化分析系统 | 选题推荐 大数据可视化大屏 毕业项目 文档指导 Hadoop SPark java Python

44 阅读5分钟

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

基于大数据的化妆品数据可视化分析系统介绍

基于大数据的化妆品数据可视化分析平台是一个集数据采集、存储、处理和可视化展示于一体的综合性分析系统。该平台采用Hadoop+Spark作为大数据处理核心,利用HDFS分布式文件系统存储海量化妆品相关数据,通过Spark SQL进行高效的数据清洗和分析计算。系统后端基于Django框架构建,前端采用Vue+ElementUI+Echarts技术栈,为用户提供直观友好的交互界面。平台涵盖品牌产品数量分析、品类平均价格分析、品类平均评分分析、化妆品品类分布、品类敏感肌专注度、热门化妆品成分分析、化妆品价格区间分布、价格评分聚类分析、价格评分相关性分析以及化妆品评分分布分析等15个核心功能模块。系统通过Pandas和NumPy进行数据预处理,结合Echarts强大的可视化能力,将复杂的化妆品市场数据转化为清晰易懂的图表和报告,帮助用户深入理解化妆品行业的发展趋势、价格规律、品牌竞争格局和消费者偏好,为相关决策提供数据支撑。

基于大数据的化妆品数据可视化分析系统演示视频

演示视频

基于大数据的化妆品数据可视化分析系统演示图片

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

基于大数据的化妆品数据可视化分析系统代码展示

from pyspark.sql import SparkSession
from pyspark.sql.functions import col, count, avg, sum, when, desc, asc
from pyspark.ml.clustering import KMeans
from pyspark.ml.feature import VectorAssembler
import pandas as pd
import numpy as np
from django.http import JsonResponse
from django.views.decorators.http import require_http_methods
import json

spark = SparkSession.builder.appName("CosmeticsAnalysis").config("spark.sql.adaptive.enabled", "true").config("spark.sql.adaptive.coalescePartitions.enabled", "true").getOrCreate()

@require_http_methods(["GET"])
def brand_product_count_analysis(request):
    df = spark.read.format("jdbc").option("url", "jdbc:mysql://localhost:3306/cosmetics_db").option("dbtable", "cosmetics_products").option("user", "root").option("password", "123456").load()
    brand_counts = df.groupBy("brand_name").agg(count("product_id").alias("product_count")).orderBy(desc("product_count"))
    top_brands = brand_counts.limit(20).collect()
    brand_distribution = df.groupBy("brand_name", "category").agg(count("product_id").alias("count")).collect()
    brand_avg_price = df.groupBy("brand_name").agg(avg("price").alias("avg_price")).collect()
    result_data = []
    for row in top_brands:
        brand_name = row["brand_name"]
        product_count = row["product_count"]
        category_info = [item for item in brand_distribution if item["brand_name"] == brand_name]
        avg_price_info = [item for item in brand_avg_price if item["brand_name"] == brand_name]
        avg_price = avg_price_info[0]["avg_price"] if avg_price_info else 0
        result_data.append({"brand_name": brand_name, "product_count": product_count, "avg_price": round(avg_price, 2), "categories": len(category_info)})
    market_share = df.groupBy("brand_name").agg(sum("sales_volume").alias("total_sales")).orderBy(desc("total_sales")).limit(10).collect()
    return JsonResponse({"status": "success", "brand_counts": result_data, "market_share": [{"brand": row["brand_name"], "sales": row["total_sales"]} for row in market_share]})

@require_http_methods(["GET"])  
def category_price_analysis(request):
    df = spark.read.format("jdbc").option("url", "jdbc:mysql://localhost:3306/cosmetics_db").option("dbtable", "cosmetics_products").option("user", "root").option("password", "123456").load()
    category_stats = df.groupBy("category").agg(avg("price").alias("avg_price"), count("product_id").alias("product_count"), sum("sales_volume").alias("total_sales")).collect()
    price_ranges = df.withColumn("price_range", when(col("price") < 50, "低价位").when((col("price") >= 50) & (col("price") < 200), "中价位").when((col("price") >= 200) & (col("price") < 500), "高价位").otherwise("奢侈品")).groupBy("category", "price_range").agg(count("product_id").alias("count")).collect()
    category_trends = df.groupBy("category", "launch_year").agg(avg("price").alias("yearly_avg_price")).orderBy("category", "launch_year").collect()
    result_categories = []
    for row in category_stats:
        category = row["category"]
        avg_price = round(row["avg_price"], 2)
        product_count = row["product_count"]
        total_sales = row["total_sales"]
        price_distribution = [item for item in price_ranges if item["category"] == category]
        trend_data = [item for item in category_trends if item["category"] == category]
        result_categories.append({"category": category, "avg_price": avg_price, "product_count": product_count, "total_sales": total_sales, "price_distribution": price_distribution, "trends": trend_data})
    high_value_categories = df.filter(col("price") > 300).groupBy("category").agg(count("product_id").alias("luxury_count")).collect()
    return JsonResponse({"status": "success", "category_analysis": result_categories, "luxury_categories": [{"category": row["category"], "count": row["luxury_count"]} for row in high_value_categories]})

@require_http_methods(["POST"])
def price_rating_cluster_analysis(request):
    df = spark.read.format("jdbc").option("url", "jdbc:mysql://localhost:3306/cosmetics_db").option("dbtable", "cosmetics_products").option("user", "root").option("password", "123456").load()
    feature_df = df.select("product_id", "price", "rating", "review_count").filter((col("price").isNotNull()) & (col("rating").isNotNull()) & (col("review_count").isNotNull()))
    assembler = VectorAssembler(inputCols=["price", "rating", "review_count"], outputCol="features")
    feature_vector_df = assembler.transform(feature_df)
    kmeans = KMeans(k=4, seed=42, featuresCol="features", predictionCol="cluster")
    model = kmeans.fit(feature_vector_df)
    clustered_df = model.transform(feature_vector_df)
    cluster_stats = clustered_df.groupBy("cluster").agg(avg("price").alias("avg_price"), avg("rating").alias("avg_rating"), avg("review_count").alias("avg_reviews"), count("product_id").alias("product_count")).collect()
    cluster_centers = model.clusterCenters()
    cluster_products = clustered_df.select("product_id", "price", "rating", "review_count", "cluster").collect()
    result_clusters = []
    for i, row in enumerate(cluster_stats):
        cluster_id = row["cluster"]
        center = cluster_centers[cluster_id]
        cluster_info = {"cluster_id": cluster_id, "avg_price": round(row["avg_price"], 2), "avg_rating": round(row["avg_rating"], 2), "avg_reviews": round(row["avg_reviews"], 2), "product_count": row["product_count"], "center_price": round(center[0], 2), "center_rating": round(center[1], 2), "center_reviews": round(center[2], 2)}
        result_clusters.append(cluster_info)
    cluster_distribution = {}
    for product in cluster_products:
        cluster_id = product["cluster"]
        if cluster_id not in cluster_distribution:
            cluster_distribution[cluster_id] = []
        cluster_distribution[cluster_id].append({"product_id": product["product_id"], "price": product["price"], "rating": product["rating"], "review_count": product["review_count"]})
    return JsonResponse({"status": "success", "clusters": result_clusters, "cluster_distribution": cluster_distribution, "total_products": feature_df.count()})

基于大数据的化妆品数据可视化分析系统文档展示

在这里插入图片描述

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