{
  "schemaVersion": 1,
  "id": "2.1.2",
  "title": "低碳生活行为影响因素数据清洗和标注流程设计",
  "durationMinutes": 20,
  "category": "数据清洗与标注",
  "scenario": "在应对气候变化的背景下，了解和促进低碳生活行为变得越来越重要。现要求根据提供的“大学生低碳生活行为的影响因素数据集”，选择合适的特征，开发一个预测大学生低碳生活行为的模型。提供的数据集样本数据包含300多个关于大学生低碳生活行为的自变量和因变量。自变量为主观规范、知觉行为控制、低碳行为态度，中介变量为行为意愿，因变量为低碳生活行为。同时，性别、生源地、月生活费作为控制变量进行研究。在开发预测模型之前，首先要对数据进行数据清洗和标注。补全2.1.2.ipynb代码。完成下面的数据预处理任务，并设计一套标注流程规范：\n\n（1）正确加载数据集，并显示前五行的数据；\n\n（2）检查数据集中的缺失值，使用删除包含缺失值的行的办法处理，记录缺失值处理后的数据行数；\n\n（3）检查数据集中的重复值并删除所有重复值，并记录删除的行数；\n\n（4）对数值型数据进行标准化处理，确保数据在同一量纲下进行分析；\n\n（5）根据业务需求和数据特性，选择对低碳生活行为预测最有用的特征，将“低碳行为积极性”设为目标变量并标注。选择以下特征：\n\n1.您的性别○男性 ○女性\n\n2.您的年级○大一 ○大二 ○大三 ○大四\n\n3.您的生源地○农村 ○城镇（乡镇） ○地县级城市 ○省会城市及直辖市\n\n4.您的月生活费○≦1,000元 ○1,001-2,000元 ○2,001-3,000元 ○≧3,001元\n\n5.您进行过绿色低碳的相关生活方式吗?\n\n6.您觉得“低碳”，与你的生活关系密切吗？\n\n7.低碳生活是否会成为未来的主流生活方式？\n\n8.您是否认为低碳生活会提高您的生活质量？\n\n（6）对数据进行划分（8:2）；\n\n（7）保存处理后的数据，并命名为：2.1.2_cleaned_data.csv，保存到考生文件夹；\n\n（8）制定数据清洗和标注规范，将答案写到答题卷文件中，答题卷文件命名为“2.1.2.docx”，保存到考生文件夹；\n\n（9）将以上代码以及运行结果，以html格式保存并命名为2.1.2.html，保存到考生文件夹，考生文件夹命名为“准考证号+身份证后6位”。",
  "skillRequirements": "（1）能够结合人工智能技术要求和业务特征，设计数据清洗和标注流程；\n\n（2）能够结合人工智能技术要求和业务特征，制定数据清洗和标注规范。",
  "qualityIndicators": "（1）数据预处理步骤完整，方法选择合理；\n\n（2）代码实现正确，结果符合预期。",
  "tasks": [
    {
      "id": "code-fill",
      "type": "code-fill",
      "title": "补全代码任务",
      "instructions": "依据公开题面和附件补全代码空位；仅检查完成度与提交格式，不公开标准内容。",
      "codeBlocks": [
        "import pandas as pd\n#读取一个Excel文件，并将读取到的数据存储在变量data中\ndata = __________\n#打印出数据集的前5行\nprint(data.head())\n\n#处理数据集中的缺失值\ninitial_row_count = __________   #处理前的数据行数\ndata = __________                #删除缺失值所在行\nfinal_row_count = __________     #处理后的数据行数\nprint(f'处理后数据行数: {final_row_count}, 删除的行数: {initial_row_count - final_row_count}')\n\n#删除重复行\ndata = __________\n\nfrom sklearn.preprocessing import StandardScaler\nnumerical_features = ['4.您的月生活费○≦1,000元   ○1,001-2,000元   ○2,001-3,000元   ○≧3,001元']\nscaler = StandardScaler()\ndata[numerical_features] = __________\n\n#选择特征\nselected_features = [__________]\nX = __________\n\n# 创建目标变量\ny = __________\n\nfrom sklearn.model_selection import train_test_split\n# 数据划分（测试集取20%）\nX_train, X_test, y_train, y_test = __________(__________, random_state=42)\n\n# 合并处理后得数据，并将其保存（保存中不用额外创建索引）\ncleaned_data = __________(__________, axis=1)\n__________('2.1.2_cleaned_data.csv', __________)",
        ""
      ],
      "blanks": [
        {
          "id": "blank-1",
          "block": 1,
          "placeholder": "__________",
          "gradingMode": "completion-and-format-only"
        },
        {
          "id": "blank-2",
          "block": 1,
          "placeholder": "__________",
          "gradingMode": "completion-and-format-only"
        },
        {
          "id": "blank-3",
          "block": 1,
          "placeholder": "__________",
          "gradingMode": "completion-and-format-only"
        },
        {
          "id": "blank-4",
          "block": 1,
          "placeholder": "__________",
          "gradingMode": "completion-and-format-only"
        },
        {
          "id": "blank-5",
          "block": 1,
          "placeholder": "__________",
          "gradingMode": "completion-and-format-only"
        },
        {
          "id": "blank-6",
          "block": 1,
          "placeholder": "__________",
          "gradingMode": "completion-and-format-only"
        },
        {
          "id": "blank-7",
          "block": 1,
          "placeholder": "__________",
          "gradingMode": "completion-and-format-only"
        },
        {
          "id": "blank-8",
          "block": 1,
          "placeholder": "__________",
          "gradingMode": "completion-and-format-only"
        },
        {
          "id": "blank-9",
          "block": 1,
          "placeholder": "__________",
          "gradingMode": "completion-and-format-only"
        },
        {
          "id": "blank-10",
          "block": 1,
          "placeholder": "__________",
          "gradingMode": "completion-and-format-only"
        },
        {
          "id": "blank-11",
          "block": 1,
          "placeholder": "__________",
          "gradingMode": "completion-and-format-only"
        },
        {
          "id": "blank-12",
          "block": 1,
          "placeholder": "__________",
          "gradingMode": "completion-and-format-only"
        },
        {
          "id": "blank-13",
          "block": 1,
          "placeholder": "__________",
          "gradingMode": "completion-and-format-only"
        },
        {
          "id": "blank-14",
          "block": 1,
          "placeholder": "__________",
          "gradingMode": "completion-and-format-only"
        },
        {
          "id": "blank-15",
          "block": 1,
          "placeholder": "__________",
          "gradingMode": "completion-and-format-only"
        }
      ]
    },
    {
      "id": "2-1-response",
      "type": "rubric-response",
      "title": "清洗与标注说明",
      "instructions": "说明清洗、标注、复核及输出质量。",
      "sections": [
        {
          "id": "response",
          "label": "作答内容"
        }
      ],
      "rubric": [
        {
          "id": "criterion-1",
          "label": "缺失、重复和异常处理合理",
          "weight": 25
        },
        {
          "id": "criterion-2",
          "label": "标注规则一致且可追溯",
          "weight": 25
        },
        {
          "id": "criterion-3",
          "label": "包含抽检或质量复核机制",
          "weight": 25
        },
        {
          "id": "criterion-4",
          "label": "输出满足题面质量指标",
          "weight": 25
        }
      ]
    },
    {
      "id": "artifact-submission",
      "type": "artifact-submission",
      "title": "选择结果文件",
      "instructions": "文件仅在本机选择并校验，不上传，也不持久化文件内容。",
      "items": [
        {
          "id": "artifact-1",
          "label": "提交文件：2.1.2_cleaned_data.csv",
          "filename": "2.1.2_cleaned_data.csv",
          "extensions": [
            ".csv"
          ],
          "minCount": 1,
          "maxCount": 1,
          "maxSize": 104857600
        },
        {
          "id": "artifact-2",
          "label": "提交文件：2.1.2.docx",
          "filename": "2.1.2.docx",
          "extensions": [
            ".docx"
          ],
          "minCount": 1,
          "maxCount": 1,
          "maxSize": 104857600
        },
        {
          "id": "artifact-3",
          "label": "提交文件：2.1.2.html",
          "filename": "2.1.2.html",
          "extensions": [
            ".html"
          ],
          "minCount": 1,
          "maxCount": 1,
          "maxSize": 104857600
        }
      ]
    }
  ],
  "attachments": [
    {
      "name": "2.1.2.docx",
      "url": "assets/2.1.2/2.1.2.docx",
      "size": 14676,
      "sha256": "c841ad8584405dcf6fbca0ecc25e9344215b220e560377f61cc7f27d6b32dccf",
      "mime": "application/vnd.openxmlformats-officedocument.wordprocessingml.document"
    },
    {
      "name": "2.1.2.ipynb",
      "url": "assets/2.1.2/2.1.2.ipynb",
      "size": 2280,
      "sha256": "94369c7458f5ab484dccdae527c3ee1dde8a5b2da5c9a3d11134cd610beb710e",
      "mime": "application/x-ipynb+json"
    },
    {
      "name": "2.1.2.md",
      "url": "assets/2.1.2/2.1.2.md",
      "size": 2997,
      "sha256": "dc966b8d071bd5e95ebfd4a938486b16a9a90546d2fcff331fcf899843bfdd9d",
      "mime": "text/markdown"
    },
    {
      "name": "大学生低碳生活行为的影响因素数据集.xlsx",
      "url": "assets/2.1.2/大学生低碳生活行为的影响因素数据集.xlsx",
      "size": 63152,
      "sha256": "aa3ccf118a49b8b5492b8701b374d8eb5afe516ae10d0a164c41371107120322",
      "mime": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
    }
  ],
  "grading": {
    "mode": "completion-and-format-only"
  },
  "review": {
    "status": "approved",
    "notice": "由公开题面通用生成，未使用答案树。",
    "conflicts": []
  },
  "contentVersion": "c0e7209b6254e2ee"
}
