Git Product home page Git Product logo

sparkify's Introduction

Sparkify项目

本项目为Udacity Nano Degree 最终的实战通关项目,下方为项目相关文件和源码链接:

## 要使用此项目,请首先使用以下命令在你的设备上克隆repo

git init
git clone [链接]

项目简介

本项目使用Spark来分析探索某数字音乐服务平台Sparkify(类似于网易云音乐和QQ音乐的音乐平台)2016年10月1日-2016年12月1日期间用户在该平台上的行为数据。通过对用户行为和用户信息的探索性分析,提取提取可能对预测用户是否流失有帮助的相关特征,从而建立流失用户预测模型。

常用工具及使用版本

  • numpy --<1.16.5>
  • pandas --<0.25.1>
  • matplotlib.pyplot --<3.1.1>
  • seaborn --<0.9.0>
  • pyspark --<3.0.0>

数据集

为了快速分析建模,该项目使用的是完整数据集(12GB)的迷你集medium-sparkify-event-data.json(128MB),分析完成后,再将项目整个流程部署到Amazon云。

数据属性

变量名称 所属类型 说明
artist 音乐信息 歌手名称
auth 网页信息 用户进入平台的方式
firstName 用户信息 用户的名
gender 用户信息 用户性别:F为女,M为男
itemInSession 网页信息 会话顺序
lastName 用户信息 用户的姓氏
length 音乐信息 音乐时长(秒)
level Event 用户等级:free为免费用户,paid为付费用户
location 会话信息 用户在会话期间所属位置
method 网页信息 HTTP method ,GET 或者 PUT
page 网页信息 用户行为类型
registration 用户信息 用户注册时间
sessionId 会话信息 会话编号
song 音乐信息 歌曲名称
status 网页信息 HTTP状态编码. 2xx=Successful, 3xx=Redirection, 4xx=Client Error.
ts 网页信息 用户行为发生的时间
userAgent 会话信息 网络环境,所属浏览器
userId 用户信息 用户编码,具有唯一性

问题定义

本项目着力解决的问题是如何精准地预测哪些用户存在流失风险,从而在这些用户离开前通过一些激励方式留住用户。要解决这一问题,需要建立机器学习模型,通过Spark分析数据,进行特征工程,传入历史数据对模型进行训练,从而预测该用户是流失还是留存,所以本项目是一个关于二分类问题。

数据分析流程

  • 评估和清理数据
  • 探索性数据分析
    • 定义流失和留存
    • 分类探索流失和留存用户在各个变量上的数据分布(使用可视化工具,如matplotlib.pyplot, seaborn)
    • 提取可能对预测用户是否流失有帮助的相关特征
  • 特征工程
  • 建模
    • 拆分数据,将数据分成训练集,验证集和测试集
    • 数据预处理
    • 模型选择
    • 网格化调参
    • 评估结果
  • 反思和总结

评估指标

考虑到流失用户约占整体用户数量22%,流失用户和留存用户在用户数量上差异过大,选择F1score,即precision和recall的调和平均数作为模型的评估指标,选择F1score作为评估指标的原因请看项目第5部分建模篇。

隐私

项目中的个人隐私信息,如姓名、具体地址将不用作主要分析

sparkify's People

Contributors

novelan avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.