写点什么

AI 颠覆数据分析!Google 最新 AI 产品 Data Science Agent 让你秒变数据科学家

作者:小鲸数据
  • 2025-03-12
    俄罗斯
  • 本文字数:5425 字

    阅读完需:约 18 分钟

AI颠覆数据分析!Google最新AI产品Data Science Agent让你秒变数据科学家

曾经,一度被认为很难在短时间内,被 AI 改造的岗位:数据分析,如今这一领域的基础性工作已被 AI 攻下。


最近,Google 宣布将 Data Science Agent 推广至年满 18 岁的 Colab 用户以及部分国家和语言地区。Google 也在扩展与大学的合作,希望通过将简单的自然语言描述转换成完整且可运行的 Colab 笔记本,帮助研究实验室在数据处理和分析方面节省时间。


全文主要讨论两个内容:


  • 通过对 Data Science Agent 的简单介绍,让读者有个基本的认识。

  • 直接通过一个真实数据分析项目:”2025 年世界大学排名“,展示 Data Science Agent 的实战效果。


用户阅读本文主要收益:


  • 2025 年最新的世界大学排名分析与发现

  • Data Science Agent 的基础了解和应用

  • 了解完整的实战数据分析项目

Data Science Agent

Data Science Agent 在 HuggingFace 的 DABStep 基准测试(DABStep: Data Agent Benchmark for Multi-step Reasoning) 中取得了第 4 名,表现优于基于 GPT 4.0 的 ReAct agents、Deepseek、Claude 3.5 Haiku 和 Llama 3.3 70B 等模型。

工作流程拆解

  • 从空白开始: 打开一个空白的 Colab 笔记本。

  • 添加数据: 上传您的数据文件。

  • 描述目标: 在 Gemini 侧边栏中描述您想进行的分析或需要的原型(例如,“可视化趋势”、“构建并优化预测模型”、“填充缺失值”、“选择最佳统计方法”)。

  • 见证 Data Science Agent 的自动化过程: 静待生成必要的代码、导入库以及可在 Colab 中执行的分析结果。

带来的价值

  • 完整的可运行 Colab 笔记本: 不仅仅是代码片段,而是可以直接执行的完整笔记本

  • 可修改的解决方案: 轻松定制和扩展生成的代码,以满足您的特定需求。

  • 可共享的结果: 借助 Colab 标准分享功能,与团队成员进行协作。

  • 节省时间: 将更多精力集中在从数据中获取洞察,而不是在环境设置和模板代码上浪费时间。


作为数据科学的从业人员,自然要实际的体验一把。

实战:2025 世界大学排名

这里从 Kaggle 上选取 2025 年最新一期的世界大学排名数据集。接下来我们不做任何的预先操作,这里我们直接将数据集丢给 Data Science Agent,然后让其全权代理我们进行数据分析的全过程。

用户操作:简单丝滑

操作过程:用户与 Data Science Agent 的交互,只需要把数据集上传,然后简单描述下需要做哪些分析即可。接着就直接等待 Agent 的处理结果即可。



结果可以很清晰的看到,数据分析过程完整的、标准的 7 步骤,涵盖了从需求分析到最终结论呈现的完整过程。

分析过程:有板有眼

过程角度看,Data Science Agent 和真实分析项目过程基本一致。从规划到分析、再到最后总结与洞察,Data Science Agent 表现惊艳。


Plan


* data_loading: Load the data from "/tmp/QS World University Rankings 2025.csv" into a pandas DataFrame.* data_exploration: Explore the data to understand its structure, including the number of rows and columns, data types of each column, and summary statistics for numerical columns. Identify any missing values or inconsistencies.* data_cleaning: Handle missing values appropriately (e.g., imputation or removal). Address any inconsistencies or errors in the data.* data_analysis: Analyze the ranking distribution across different regions and countries. Calculate the average scores for various metrics (e.g., Academic Reputation, Employer Reputation, Faculty Student Ratio). Identify top-performing universities based on overall score and individual metrics.* data_visualization: Create visualizations to represent the findings from the data analysis. Examples include: a histogram of overall scores, bar charts comparing average scores across regions, and a scatter plot showing the relationship between academic reputation and employer reputation. Visualize the top 10 universities by overall score.* finish_task: Summarize the key findings from the data exploration, cleaning, analysis, and visualization steps. Provide a concise report on the overall trends and insights derived from the QS World University Rankings 2025 data.
复制代码


规划这一步,可以看到常见的数据处理动作,包括了数据加载、探索、清洗、分析、可视化,最终将以上各步骤的结果进行汇总总结。


Data loading


    df = pd.read_csv('/tmp/QS World University Rankings 2025.csv', encoding='utf-8')
复制代码


使用 Python 的 Pandas 库来执行数据的加载任务。


Data exploration


数据探索的是数据分析项目中非常基础,同时也是非常重要的一步,充分了解数据集基本盘之后,才能为后续的数据清洗提供方案,为后续的分析提供建模的基础。


import pandas as pd
# Data shapeprint("Shape of the DataFrame:", df.shape)
# Data typesprint("\nData types of each column:\n", df.dtypes)
# Summary statistics for numerical columnsprint("\nSummary statistics for numerical columns:\n", df.describe())
# Missing valuesprint("\nMissing values per column:\n", df.isnull().sum())
# Duplicate rowsprint("\nNumber of duplicate rows:", df.duplicated().sum())
# Unique values in categorical columnscategorical_cols = ['location code', 'location', 'size', 'focus', 'research', 'status']for col in categorical_cols: print(f"\nUnique values in '{col}':\n{df[col].value_counts()}")
复制代码


通过检查数据集的规格、数据类型、字段汇总统计、缺失值、分类字段的唯一值等,充分了解数据集的情况。


这里简单给出两个初步的观察,更多更详细的观察参见后面的 Summary 部分。


  • 上榜的大学共计 1503 所,拥有 29 个评价维度。

  • 上榜大学数量按国家汇总 Top5 分别是:美国(197)、英国(90)、中国大陆(71)、日本(49)、德国(48)。


Data Cleaning


在数据行业有句”古话“,数据的质量决定分析的上限。这一步对数据分析的过程至关重要。


通用的做法就是缺失值的处理,比如给到均值、根据模式填充类别。


Data analysis + Data visualization


分析和可视化是一个紧密相连的过程,这里两个阶段就放一起讨论。


这一步是数据科学领域中最核心的一步。这里先介绍下数据集字段的含义,方便后续讲解分析思路。


关键字段解读:


  1. rank display: 机构在某个排名系统中的显示排名。这可能是综合排名或某个特定领域的排名。

  2. institution: 机构的名称,通常是大学或高等教育机构的名称。

  3. location code: 机构所在地区的代码,可能是国家代码、州代码或其他地理标识符。

  4. location: 机构所在的具体地理位置,通常是城市或国家。

  5. size: 机构的规模,可能包括学生人数、教职工人数或校园面积等。

  6. focus: 机构的教育重点或特色,例如研究型大学、文理学院、技术学院等。

  7. research: 机构的研究活动水平,可能包括研究经费、发表论文数量等。

  8. status: 机构的状态,可能是公立、私立、非营利等。

  9. ar score: 学术声誉(Academic Reputation)得分,反映机构在学术界的声誉。

  10. er score: 雇主声誉(Employer Reputation)得分,反映机构毕业生在就业市场的声誉。

  11. fsr score: 师生比(Faculty/Student Ratio)得分,反映教学资源的充足程度。

  12. cpf score: 国际教师比例(International Faculty Ratio)得分,反映教师的国际化程度。

  13. ifr score: 国际学生比例(International Student Ratio)得分,反映学生的国际化程度。

  14. isr score: 研究影响力(Impact of Research)得分,反映机构研究成果的影响力。

  15. irn score: 国际合作(International Research Network)得分,反映机构在国际合作研究中的参与度。

  16. ger score: 毕业生就业率(Graduate Employment Rate)得分,反映毕业生就业情况。

  17. SUS SCORE: 可持续发展(Sustainability)得分,反映机构在可持续发展方面的表现。

  18. Overall Score: 综合得分,反映机构在所有评估指标上的总体表现。


可以看到,这边数据集重点收集了学校的基本信息,以及其他关键指标,如在学术、就业、国际化、影响力、可持续发展等方面的表现。相当有价值的一份数据集。如果你想自己亲自探索,文末附有地址。


重要分析点:


1、在综合指标和其他各项指标下,表现优异的大学有哪些?


STDOUTTop 10 Universities by Overall Score:                                           institution  Overall Score0         Massachusetts Institute of Technology (MIT)          100.01                             Imperial College London           98.52                                University of Oxford           96.93                                  Harvard University           96.84                             University of Cambridge           96.75                                 Stanford University           96.16  ETH Zurich - Swiss Federal Institute of Technology           93.97              National University of Singapore (NUS)           93.78                                                 UCL           91.69        California Institute of Technology (Caltech)           90.9
复制代码


这里以综合指标为例,给出示例分析。


不出意外,麻省理工、剑桥、哈佛、帝国理工、斯坦福这些耳熟能详的大学依然常年霸榜。有点意外的是,加州理工学院这次进入了前 10。


2、不同指标之间的相关性是怎样的?



这里以学术成就和雇主声誉为例,给出指标之间相关性的分析。


可以看出,来自学术水平越高大学的学生,其在就业市场上来自雇主的评价也越好。


可能你会好奇,学校老师的国际化比例和学生的就业率存在着关系,如果不是看到可视化的图,真不敢相信这两者之间什么关系都没有。



更多内容,这里就不过多展开,接下来我们重点讨论下 Data Science Agent 的结论部分。

结论分析:可圈可点

1. Q&ANo questions were posed in the data analysis task.
2. Data Analysis Key FindingsRegional Performance Discrepancies: Significant variations in average scores across different regions were observed. Oceania showed high average scores for metrics like 'cpf score' and 'Overall Score', while Africa exhibited lower averages. (Specific numbers are present in the output of the data analysis step).Top University Performance: MIT, Oxford, and Harvard consistently ranked highly across overall score, academic reputation, and employer reputation. (The analysis provided the top 10 lists for each metric).Potential Metric Correlations: Visual inspection of scatter plots suggested potential relationships between Academic Reputation and Employer Reputation, as well as between Overall Score and both Academic and Employer Reputation. The code, however, does not compute formal correlation coefficients.3. Insights or Next StepsDeep Dive into Regional Differences: Further investigate the factors contributing to the observed regional disparities in university performance. Consider exploring socioeconomic factors, research funding, and educational policies within each region.Correlation Analysis: Quantify the relationships between different metrics using correlation coefficients (e.g., Pearson, Spearman). This will provide stronger evidence of the observed trends in the scatter plots.
复制代码


这里一个开始,作者并没有给出具体的问题,而是让 Data Science Agent 自行分析,看到它的总结部分第一部分为空,当然在 Data Science Agent 中继续追问。


数据分析关键的发现点部分:


  • 区域间大学的绩效差异显著:非洲表现较低,欧美表现出众,普遍学业比较卷的亚洲位列排中流。

  • 优秀的学校一直在线:传统名校、藤校,在各项指标中一直保持靠前位置。

  • 潜在指标相关性较高:不同指标之间如学术声誉和雇主声誉之间的潜在关系。


洞察和下一步部分:


  • 地区间差异的深入研究:可以进一步到结合社会经济因素、资金、教育政策等因素,身躯的分析大学的地区差异点。

  • 相关性分析:使用统计学的量化分析方法:相关性系数法,如 Pearson、Spearman,定量的研究不同量化指标间的相关关系,为基于图得到的观察提供更有利证据。

最后

整个数据分析的过程体验下来,相当顺畅。把问题和数据集给到 Data Science Agent 之后,几分钟后便按照科学严谨的数据分析过程,把分析的结论和洞察展现给用户。


这个过程中,作者既没有给 Data Science Agent 数据集的 scheme(字段)信息,也没有给出具体的分析任务,它依然给出了不错的结果。且在后续的基于自然语言的交互过程中,其能够很便捷的基于语义理解,给出问题分析、代码生成、运行结果。大大节省了数据科学和分析人员的时间,可以让时间更多的分配在基于结论的深入分析和拿到结果之后的项目推进,而这些恰恰是数据分析工作最有价值的部分。


相比基于自动化平台(Coze 或者 Dify)搭建分析工作流而言,Data Science Agent 极大得降低的自动化数据分析的门槛。果然把 AI 拿下代码编程领域之后,就开始了对各行各业进行 Agent 化。而数据分析领域的 Agent 化只是开始。


如果你想了解更多:Data Science Agent


如果你需要数据集:QS World 2025


如果你想自己亲自体验:Colab

发布于: 刚刚阅读数: 4
用户头像

小鲸数据

关注

公众号:小鲸数据 2018-10-20 加入

专注于商业、数据、AI,提供数字化、经营分析、数据治理等领域的咨询与交流。

评论

发布
暂无评论
AI颠覆数据分析!Google最新AI产品Data Science Agent让你秒变数据科学家_AI_小鲸数据_InfoQ写作社区