ChatGPT-Powered Data Analysis on Customer Click

STAT7008课程大作业解析和实现思路。

Posted by Sunny on 2024-11-13
Words 574 and Reading Time 2 Minutes
Viewed Times

ChatGPT-Powered Data Analysis on Customer Click

Bacis Requirements

This project involves building a simple data analysis tool that leverages ChatGPT for interactive data exploration. It will involves data science and API usage, focusing on creating a user-friendly application. In this project,
we want to do the Clickstream analysis with the help of ChatGPT.

You are expected to:

  1. Develop a Basic Web Application using Flask:
    1. Set up a simple Flask app for handling data uploads and ChatGPT interactions.
    2. Implement basic user authentication with login functionality.
  2. Integrate ChatGPT API:
    1. Connect to the ChatGPT API(or passing the message to the ChatGPT web) for processing user queries related to data analysis.
    2. Allow users to ask questions about datasets and receive insights.
  3. Data Upload and Processing:
    1. Enable users to upload datasets in CSV format.
    2. Use Pandas for basic data operations like summary statistics and data cleaning.
  4. Interactive Data Visualization:
    1. Provide simple visualizations using libraries like Matplotlib or Plotly.
    2. Update charts based on user input and ChatGPT suggestions.
  5. Security and User Experience:
    1. Ensure secure data handling with basic validation.
    2. Implement a user-friendly interface with clear instructions.
  6. Data Analysis Summary: After the data analysis, it requires to answer some basic questions about the Customer, for example:
  • How often the same customer revisiting the store (online or physical), how often the same customer revisiting the store (online or physical)
  • How is the customers’ sentiment according to the consumer’s comments/comment scores on products in social media dataset.
  • The customers’ shopping behaviors based on their clickstream (e.g. visit frequency, visit location and duration, web browsing/location
    history, purchasing items, demographics, etc.)
  • Which kind of product of the customer will buy in the near future

Project Analysis

Datasets: Clickstream

Steps:

  1. user registration and login
  2. clickstream data upload
  3. data analysis using Python
  4. simple visualizations using Python
  5. answer some basic questions besed on the result of data analysis by integrating ChatGPT API

Questions:

  1. “Ensure secure data handling with basic validation”是什么意思?

技术栈:

  • 前端:Vue框架 + Axios(http库)
  • 后端:Flask框架 + MySQL数据库

HTTP客户端:实际上就是前端,使用Axios和Vue框架集成

HTTP服务器端:Flask框架 + MySQL数据库

进阶:Running Flask on Kubernetes

Axios是一个前端库,主要用于在浏览器中发送HTTP请求。它可以让你通过JavaScript与后端服务器进行通信,获取数据或提交信息。

Yarn是一个JavaScript包管理工具。管理和JavaScript相关的包。类似于Python中的pip,也是一个包管理工具。其实还是使用npm包进行安装。

Node是什么?Node.js是一个开源的、跨平台的 JavaScript运行时环境。可以说,JavaScript借助Node.js的编译器在机器上运行。

用户登录和注册

登录:用户名username 和 密码password
注册:用户名username 和 密码password 和 邮箱email

密码存储时,需要对原始密码进行加密,下面是加密用的包
from werkzeug.security import generate_password_hash, check_password_hash