{ "cells": [ { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "# 1.5 实践方式\n", "课程中的课后作业大都可以通过两种方式完成,一种是通过Kaggle平台,一种是通过自建环境完成。\n", "比较建议通过Kaggle平台完成,因为课程所有的代码,数据集都已经部署在了此平台上,且此平台提供免费的算力,仅仅只需要浏览器就可完成所有的课程作业,比较适合初学者\n", "而自建环境则意味着,你需要自己构建代码的运行环境,下载对应的数据集,完成相应的作业,适合希望进一步学习Python的同学" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "## 实践方式一: Kaggle(建议采用)\n", "课程所有的数据,代码都部署到了 kaggle 平台上。使用此方式参与到课程学习中无需下载数据,配置Python运行环境。所有的代码均可通过网页浏览学习,编辑运行。但此方式需要注册Kaggle账号,注册过程比较麻烦,Kaggle使用过程中有任何疑问可与课程助教联系。\n", "以此种方式完成实践需要完成以下五个步骤:" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "### 1.注册Kaggle账号\n", "进入Kaggle平台,链接如下,点击按钮Register\n", "\n", "https://www.kaggle.com/account/login?phase=startRegisterTab" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "![1](images/kaggle1.png)" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "选择使用邮箱注册或者采用谷歌账号注册。采用邮箱注册时,会遇到一个问题无法接收到Google的人机验证小程序,即Captcha must be filled out。" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "![2](images/kaggle2.png)" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "这里需要借用一下下列的知乎教程,将Google的人机验证小程序重定向到可以访问的网站,使得我们可以通过验证。\n", "\n", "https://zhuanlan.zhihu.com/p/607977683\n", "\n", "此教程中需要的文件(Header Editor.crx)和重定向规则(HE-GoogleRedirect.json)都已放到师大云盘中, 如果你的浏览器是Edge,请在浏览器的拓展程序商店中搜索Header Editor\n", "\n", "https://www.azurezeng.com/static/HE-GoogleRedirect.json\n", "\n", "https://pan.bnu.edu.cn/l/XFUh1k\n", "\n", "如果你的浏览器是Chrome,不允许添加离线的拓展程序,请参考下面的简书文档。\n", "\n", "https://www.jianshu.com/p/a1248c522899\n", "\n", "完成上述重定向后,Google的人机验证小程序即可出现,可继续通过邮箱注册。" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "![3](images/kaggle3.png)" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "### 2.加入课程实践" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "回到课程Kaggle的主界面,在登陆的状态下点击右上角黑色按钮**Join Competition**,以homework3中土地覆盖分类为例\n", "\n", "https://www.kaggle.com/competitions/prors-hw" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "![4](images/kaggle4.png)" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "先后浏览Overview,Data,Code了解实践相关内容,选学部分可不看。" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "### 3.创建自己的Notebook" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "课程的代码模版如下面的链接所示,同样也可以通过课程主界面的**Code**栏目进入,大家可以直接点击网页右上角的**Copy & Edit**进行复制并编辑。\n", "https://www.kaggle.com/code/haozeshi/prors-luc-cla" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "![5](images/kaggle5.png)" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "进入后可直接在网页中基于课程提供的代码模版编辑,调试,运行代码,输出结果。" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "![6](images/kaggle6.png)" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "### 4.保存Notebook与输出结果\n", "运行完成后,点击右上角的黑色按钮**Save Version**保存Notebook,建议采用**Quick save**,一定勾选保存**Always save output when creating a Quick Save**。" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "![7](images/kaggle7.png)" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "### 5.提交结果与评分\n", "回到Notebook,来到**Notebook**的**Data**界面,选中**submission.csv**提交自己的预测结果便可获取自己的预测得分。" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "![8](images/kaggle8.png)\n", "![9](images/kaggle9.png)\n", "![10](images/kaggle10.png)" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "## 实践方式二:自建环境" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "适合已经配置好环境,或者想要学习Python语言的同学。课程所有的数据,代码都已经上传到师大云盘 ,需要大家自己下载运行,师大云盘其内容同kaggle一致。有任何配置上的问题可与本课程的助教联系。\n", "\n", "师大云盘链接如下:\n", "\n", "https://pan.bnu.edu.cn/l/XFUh1k\n", "\n", "实践方式2和实践方式1的主要差别在与第3步、第4步,即Notebook将在你本地电脑上运行,最终预测的结果仍需提交到Kaggle之中,所以还是建议采用方式一进行实践。\n", "\n", "关于Python环境的配置与搭建,大家可以参考此文档\n", "\n", "https://www.jianshu.com/p/ef1ae10ba950\n", "\n", "安装好Anaconda后启动Notebook即可,\n", "\n", "最终预测的结果需提交到Kaggle之中,注册提交方式可参考实践方式一中第1,2,5步\n", "\n", "即进入Kaggle\n", "\n", "https://www.kaggle.com/competitions/prors-hw\n", "\n" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "点击右上角 Sign in,根据提示完成 Kaggle 注册。然后点击 Join Competition然后点击 Submit Predictions 。" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "![11](images/kaggle11.png)" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "vscode": { "languageId": "plaintext" } }, "outputs": [], "source": [ "上传预测结果,并得到评分 。\t注意预测结果的格式需与提供的模版一致。\n" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "![12](images/kaggle12.png)" ] } ], "metadata": { "language_info": { "name": "python" }, "orig_nbformat": 4 }, "nbformat": 4, "nbformat_minor": 2 }