Machine Learning in Action: User Addition Prediction Challenge

这篇具有很好参考价值的文章主要介绍了Machine Learning in Action: User Addition Prediction Challenge。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

Contest type: Data mining, two classification.

User addition prediction is a key step in analyzing user usage scenarios and predicting user growth, which is helpful for subsequent product and application iterative upgrades.

The data set consists of about 620,000 training sets and 200,000 test sets, including 13 fields.

In the preceding command, uuid is the unique identifier of the sample, eid is the ID of the access behavior, and udmap is the behavior attribute. key1 to key9 indicates different behavior attributes, such as project name and project id, common_ts indicates the occurrence time of the application access record (ms timestamp), and other fields x1 to x8 are user-related attributes. Fields are processed anonymously. The target field indicates the predicted target, that is, whether a new user is added.

The contest is a typical data mining contest, which requires manual feature extraction and model construction, and feature differences will bring great differences in scores.

Here's the Baseline.

import pandas as pd
import numpy as np

train_data = pd.read_csv('用户新增预测挑战赛公开数据/train.csv')
test_data = pd.read_csv('用户新增预测挑战赛公开数据/test.csv')

train_data['common_ts'] = pd.to_datetime(train_data['common_ts'], unit='ms')
test_data['common_ts'] = pd.to_datetime(test_data['common_ts'], unit='ms')
def udmap_onethot(d):
    v = np.zeros(9)
    if d == 'unknown':
        return v
    
    d = eval(d)
    for i in range(1, 10):
        if 'key' + str(i) in d:
            v[i-1] = d['key' + str(i)]
            
    return v

train_udmap_df = pd.DataFrame(np.vstack(train_data['udmap'].apply(udmap_onethot)))
test_udmap_df = pd.DataFrame(np.vstack(test_data['udmap'].apply(udmap_onethot)))

train_udmap_df.columns = ['key' + str(i) for i in range(1, 10)]
test_udmap_df.columns = ['key' + str(i) for i in range(1, 10)]
train_data = pd.concat([train_data, train_udmap_df], axis=1)
test_data = pd.concat([test_data, test_udmap_df], axis=1)
train_data['eid_freq'] = train_data['eid'].map(train_data['eid'].value_counts())
test_data['eid_freq'] = test_data['eid'].map(train_data['eid'].value_counts())

train_data['eid_mean'] = train_data['eid'].map(train_data.groupby('eid')['target'].mean())
test_data['eid_mean'] = test_data['eid'].map(train_data.groupby('eid')['target'].mean())
train_data['udmap_isunknown'] = (train_data['udmap'] == 'unknown').astype(int)
test_data['udmap_isunknown'] = (test_data['udmap'] == 'unknown').astype(int)
train_data['common_ts_hour'] = train_data['common_ts'].dt.hour
test_data['common_ts_hour'] = test_data['common_ts'].dt.hour
import lightgbm as lgb
from sklearn.linear_model import LogisticRegression
from sklearn.tree import DecisionTreeClassifier

clf = DecisionTreeClassifier()
clf.fit(
    train_data.drop(['udmap', 'common_ts', 'uuid', 'target'], axis=1),
    train_data['target']
)
pd.DataFrame({
    'uuid': test_data['uuid'],
    'target': clf.predict(test_data.drop(['udmap', 'common_ts', 'uuid'], axis=1))
}).to_csv('submit.csv', index=None)


Evaluation index:
The evaluation criteria of this competition is f1_score, the higher the score, the better the effect.

Machine Learning in Action: User Addition Prediction Challenge,机器学习,人工智能

 
Operational configuration requirements
- When running, select the CPU2 core 8G or V100 16G configuration, free configuration can run perfectly.
- The total running time takes 1 to 5 minutes. Please wait patiently.

Machine Learning in Action: User Addition Prediction Challenge,机器学习,人工智能

 Machine Learning in Action: User Addition Prediction Challenge,机器学习,人工智能

 

Machine Learning in Action: User Addition Prediction Challenge,机器学习,人工智能

 

Provide corresponding AI capabilities and solutions for different industries and different scenarios, empower developers' products and applications, help developers solve relevant practical problems through AI, and realize that products can listen, speak, see, recognize, understand and think.文章来源地址https://www.toymoban.com/news/detail-647608.html

到了这里,关于Machine Learning in Action: User Addition Prediction Challenge的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • 【Machine Learning】Other Stuff

    本笔记基于清华大学《机器学习》的课程讲义中有关机器学习的此前未提到的部分,基本为笔者在考试前一两天所作的Cheat Sheet。内容较多,并不详细,主要作为复习和记忆的资料。 max ⁡ δ ∈ Δ L o s s ( f θ ( x + δ ) , y ) max_{deltain Delta}Loss(f_theta(x+delta),y) max δ ∈ Δ ​ L

    2024年01月20日
    浏览(20)
  • [FL]Adversarial Machine Learning (1)

    Reading Alleviates Anxiety [Simba的阅读障碍治疗计划:#1] Reading Notes for (NIST AI 100-2e2023)[https://csrc.nist.gov/pubs/ai/100/2/e2023/final]. A Taxonomy and Terminology of Attacks and Mitigations There are two broad classes of AI systems, based on their capabilities: Predictive AI (PredAI) and Generative AI (GenAI). However, despite the signifcan

    2024年02月02日
    浏览(18)
  • [Machine Learning] 损失函数和优化过程

    在统计学习的框架中,我们通常试图找到一个函数或概念,这个函数可以很好地解释或拟合给定的数据。这通常通过最小化某种风险或损失来实现。为了找到一个好的模型,我们尝试在预定义的假设空间 H H H 中找到一个函数,该函数在训练数据上的经验风险 (Empirical Risk) 最小

    2024年02月12日
    浏览(21)
  • [Machine Learning] 领域适应和迁移学习

    在机器学习中,我们的目标是找到一个假设或模型,它可以很好地描述或预测数据。当我们基于训练集训练模型时,我们的目的是让模型能够捕获到数据中的主要模式。然而,为了确保模型不仅仅是对训练数据进行记忆,而是真正理解了数据的结构,我们需要在测试集上评估

    2024年02月08日
    浏览(24)
  • [Machine Learning] decision tree 决策树

    (为了节约时间,后面关于机器学习和有关内容哦就是用中文进行书写了,如果有需要的话,我在目前手头项目交工以后,用英文重写一遍) (祝,本文同时用于比赛学习笔记和机器学习基础课程) 俺前两天参加了一个ai类的比赛,其中用到了一种名为baseline的模型来进行一

    2024年02月11日
    浏览(21)
  • Azure Machine Learning - 视频AI技术

    Azure AI 视频索引器是构建在 Azure 媒体服务和 Azure AI 服务(如人脸检测、翻译器、Azure AI 视觉和语音)基础之上的一个云应用程序,是 Azure AI 服务的一部分。 有了 Azure 视频索引器,就可以使用 Azure AI 视频索引器视频和音频模型从视频中提取见解。 Azure AI 视频索引器通过运行

    2024年01月20日
    浏览(20)
  • 【Machine Learning 系列】一文带你详解什么是强化学习(Reinforcement Learning)

    机器学习主要分为三类:有监督学习、无监督学习和强化学习。在本文中,我们将介绍强化学习(Reinforcement Learning)的原理、常见算法和应用领域。 强化学习(Reinforcement Learning)是机器学习中一种重要的学习范式,其目标是通过与环境的交互来学习如何做出最优的决策。 强化

    2024年02月14日
    浏览(26)
  • 机器学习 深度学习资料 资源machine learning

    Kaggle入门,看这一篇就够了 - 知乎 (zhihu.com) https://zhuanlan.zhihu.com/p/25686876 day1-1.什么是机器学习_哔哩哔哩_bilibili day1-1.什么是机器学习是10天学会机器学习从入门到深度学习的第1集视频,该合集共计62集,视频收藏或关注UP主,及时了解更多相关视频内容。 https://www.bilibili.com

    2024年02月21日
    浏览(27)
  • Azure Machine Learning - 聊天机器人构建

    本文介绍如何部署和运行适用于 Python 的企业聊天应用示例。 此示例使用 Python、Azure OpenAI 服务和 Azure AI 搜索中的检索扩充生成(RAG)实现聊天应用,以获取虚构公司员工福利的解答。 关注TechLead,分享AI全维度知识。作者拥有10+年互联网服务架构、AI产品研发经验、团队管理

    2024年01月19日
    浏览(23)
  • 选择和训练模型(Machine Learning 研习之十一)

    当您看到本文标题时,不禁感叹,总算是到了 训练模型 这一节了。 是啊,在之前的文章中,我们对数据进行了探索,以及对一个训练集和一个测试集进行了采样,也编写了一个 预处理 管道来自动清理,准备您的数据用于 机器学习 算法,然而现在,我们可以选择并训练模型

    2024年01月18日
    浏览(22)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包