簡體   English   中英

Python:對具有大量變量的月度數據進行聚類分析

[英]Python: Cluster analysis on a monthly data with a lot of variables

我希望你們能幫我解決這個問題,因為我覺得這在我之上。 對你們中的一些人來說,這可能很愚蠢,但我迷路了,我來向你們尋求建議。

我是統計、數據分析和大數據的新手。 我剛開始學習,我需要做一個關於流失預測的項目。 是的,這是一項家庭作業,但我希望你能回答我的一些問題。

我將非常感謝逐步提供初學者級別的答案。

基本上,我有一個非常大的數據集(顯然)來自蜂窩公司 3 個月的客戶活動數據,第 4 個月以攪動或不攪動結束。 每個月都有這些列:

['year',
 'month',
 'user_account_id',
 'user_lifetime',
 'user_intake',
 'user_no_outgoing_activity_in_days',
 'user_account_balance_last',
 'user_spendings',
 'user_has_outgoing_calls',
 'user_has_outgoing_sms',
 'user_use_gprs',
 'user_does_reload',
 'reloads_inactive_days',
 'reloads_count',
 'reloads_sum',
 'calls_outgoing_count',
 'calls_outgoing_spendings',
 'calls_outgoing_duration',
 'calls_outgoing_spendings_max',
 'calls_outgoing_duration_max',
 'calls_outgoing_inactive_days',
 'calls_outgoing_to_onnet_count',
 'calls_outgoing_to_onnet_spendings',
 'calls_outgoing_to_onnet_duration',
 'calls_outgoing_to_onnet_inactive_days',
 'calls_outgoing_to_offnet_count',
 'calls_outgoing_to_offnet_spendings',
 'calls_outgoing_to_offnet_duration',
 'calls_outgoing_to_offnet_inactive_days',
 'calls_outgoing_to_abroad_count',
 'calls_outgoing_to_abroad_spendings',
 'calls_outgoing_to_abroad_duration',
 'calls_outgoing_to_abroad_inactive_days',
 'sms_outgoing_count',
 'sms_outgoing_spendings',
 'sms_outgoing_spendings_max',
 'sms_outgoing_inactive_days',
 'sms_outgoing_to_onnet_count',
 'sms_outgoing_to_onnet_spendings',
 'sms_outgoing_to_onnet_inactive_days',
 'sms_outgoing_to_offnet_count',
 'sms_outgoing_to_offnet_spendings',
 'sms_outgoing_to_offnet_inactive_days',
 'sms_outgoing_to_abroad_count',
 'sms_outgoing_to_abroad_spendings',
 'sms_outgoing_to_abroad_inactive_days',
 'sms_incoming_count',
 'sms_incoming_spendings',
 'sms_incoming_from_abroad_count',
 'sms_incoming_from_abroad_spendings',
 'gprs_session_count',
 'gprs_usage',
 'gprs_spendings',
 'gprs_inactive_days',
 'last_100_reloads_count',
 'last_100_reloads_sum',
 'last_100_calls_outgoing_duration',
 'last_100_calls_outgoing_to_onnet_duration',
 'last_100_calls_outgoing_to_offnet_duration',
 'last_100_calls_outgoing_to_abroad_duration',
 'last_100_sms_outgoing_count',
 'last_100_sms_outgoing_to_onnet_count',
 'last_100_sms_outgoing_to_offnet_count',
 'last_100_sms_outgoing_to_abroad_count',
 'last_100_gprs_usage']

這項作業的最終結果將是 k 均值聚類分析和流失預測模型。

我對這個數據集最頭疼的是:

如何對包含大部分這些變量的月度數據進行聚類分析? 我試圖尋找一個例子,但我找到了一個關於每月分析一個變量或每個月分析多個變量的例子。

我正在使用 Python 和 Spark。

我想只要我知道如何處理幾個月和大量變量,我就可以讓它發揮作用。

謝謝,您的幫助將不勝感激!

PS 代碼示例會不會太多了?

為什么要在這里使用k-means?

  1. k-means 不會對這些數據做任何有意義的事情。 對縮放和屬性類型(例如年、月)過於敏感

  2. 流失預測是一個有監督的問題。 切勿對有監督的問題使用無監督算法。 這意味着您忽略了指導搜索的最有價值的信息。

我已經對這些數據進行了全面研究,但我確實需要有關其出處的信息,如果您能給我任何信息,我會非常高興。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM