SCC361 Artificial Intelligence Coursework 1 – Data Preparation and ClassificationR

3天干完6个月的活,Claude把模型搬上AMD 一条挺刺激的消息:Anthropic 给投资人的材料里有一张幻灯片,写着它的 Claude Mythos Preview 只花了大约​,就摸清了怎么让另一个 Claude 模型在 AMD 的 MI355X 上跑起来。同一处还写了个对照数字:过去给一块新芯片做推理适配,通常要几十名工程师、​。3 天对 6 个月,这个比值太扎眼,当天中文互联网上就冒出一堆「英伟达的护城河塌了」的说法。我把能翻到的材料都翻了一遍,越看越觉得,塌掉的那一小块是真的,可塌的位置和很多人想的不一样。 阅读详情

Java Python SCC361            Artificial  Intelligence

Coursework 1 - Data Preparation and Classification

Date Released: Friday,  18th   October 2024

Date Due: Friday 8th   November 2024

This coursework is worth 20 % of your overall mark

1. Introduction

In this coursework, you are required to carryout a mini research project in Machine Learning classification. This will take the form. of supervised image classification on the CIFAR-10 dataset. You will be required to load the data, select target classes, create training and testing subsets, and use    these to train several machine learning models and perform. inference on the testing data. You will   be required to evaluate and compare the results, using this to determine the most suitable model.

The submission will include the code as a single .m file, a 1-page extended abstract and a data file as  a .mat file, containing your indices and result measures. An abstract template is included for use and an example abstract accepted by a conference is included for reference.

2. Dataset

The CIFAR-10 dataset contains 60,000 images in 10 classes along with labels showing the object that they represent. The dataset is contained in the file cifar-10-data.mat. This is 174MB but we    will not use the whole set for training and testing. This mat file contains:

•    A 60000x32x32x3 variable data holding the images.

•    A 60000x1 variable labels holding the corresponding image labels.

•    A 10x1 variable label_names showing the categorical names of each indexed label.

Each image is of size 32 x 32 x 3 pixels. Since the first dimension of the data variable is the image index, to view an example image, you should use the squeeze command. E.g.

imagesc(squeeze(data(120,:,:,:)));

Figure 1 - Example Data from CIFAR-10

3. Data Preparation

Data Loading: To use the images with your method effectively, you will need to load the data into MATLAB, and convert the images to a double data type once imported.

Image Visualisation: Produce a 1-row and 4-column array of figures (Hint: the subplot command will be useful here), showing randomly-chosen examples and including the corresponding labels as the subfigure titles. Save this figure as a portable network graphic (png) file and use it in your report to  show what your data looks like.

Class Selection: Since we have a lot of data, we will only work with three classes. Select these three classes pseudo-randomly using the randperm command with a Mersenne Twister. You must use your student ID as a seed for the random number generator. You will find the rng function useful for this. For example, if my ID is 200212365, I would use classes 6 (dog), 9 (ship) and 10 (truck). Store this list in a 3x1 vector called “classes”; you will need to submit this along with your code. Extract the data corresponding to these classes, while preserving the original order. Do not forget to ensure that your labels vector needs to correspond to your image data so this will also need to be extracted. You should now have a data matrix of size 18000x32x32x3 and a labels vector of size 18000x1.

Training and Testing Split: For this task, we will use a 50-50 pseudo-randomly-selected training-

testing split. Split your dataset into training and testing subsets, each containing 50% of the data.

Use your student ID again as a seed for a Mersenne Twister random number generator and the randperm command to select half of your images (i.e. 9000 images) for your training set. Note that  you will need to set the seed each time you want to use it. Store the index resulting from randperm as a 9000x1 vector called “training_index”; you will need to submit this along with your code. Now, use this index to extract your training images and labels; the remaining 9000 images and labels should be set aside for testing. Be careful to ensure that the labels still correspond to the correct images.

Data Format: As in week 3, the image data needs to reshaped into a suitable format for training and testing and you will need four matrices: in this case, you should have a 9000x3072 matrix each for your training and testing data, and a 9000x1 matrix each for your training and testing labels.

Check your label distribution to examine the representation of each class in training and testing. You can comment on this in your report but must not change the data split.

4. Model Training and Evaluation

4.1. Model Training with K-Nearest Neighbour

In this section, you will be required to classify the test data using your own implementation of k-nearest neighbour (see Week 3 Lab for reference). This should be carried out separately using two different distance metrics to provide one set of results per distance metric:

1.    L2-distance, also known as Euclidean distance.

2.   Another distance metric of your choice but not an Lp-distance. For example, you could use Bray-Curtis or Cosine Distance.

Be sure to save the prediction results and computation times for evaluation and comparison later.

4.2. Model Training with Existing Models

It is important to compare with existing models and we often do this by implementing the author’s code. We will use some existing classification algorithms that are already implemented in MATLAB.

You will need to train and compare any two classification algorithms implemented in MATL SCC361 Artificial Intelligence Coursework 1 – Data Preparation and ClassificationR AB, not    including KNN. It is sufficient for this coursework to use the models’ default parameters but you are  welcome tooptimise these parameters to improve performance. Please note that, given the dataset size, the models make take several minutes to run.

Table 1 shows some examples of classification algorithms in MATLAB and their function names as implemented in MATLAB’s Statistics and Machine Learning ToolboxTM. You may find it useful to have a look at this MATLAB documentation page on Supervised Learning Workflow and Algorithms for some ideas on how to structure your solution and select your algorithms. You are encouraged to make use of the suggestions on this page but feel free to explore further.

Table 1: MATLAB Classification of Algorithms and their function Names

Algorithm

Function

SVM for Multiclass

fitcecoc()

Decision Tree

fitctree()

Ensembles

fitcensemble()

4.3. Evaluation

It is important to evaluate methods from multiple points of view. For this work, please evaluate the models in terms of their accuracy, confusion matrix and the time taken to train and test. These can  then be presented and discussed in your report to select the most suitable model for your problem. Please name the corresponding variables according using the format “modelname_measure”, e.g.    “knnL2_accuracy”, “SVM_timetaken”, “decisiontree_confusionmatrix” . You will need to submit

these in a data file.

Accuracy is measured by comparing the predictions from your models to the test labels in the dataset. Accuracy can be calculated as

The time taken to train the models can be computed using the tic and toc commands.

5. Report

As part of this coursework, you are asked to write a 1-page report in the form. of an Extended Abstract, which is acommon way of submitting work to a conference or workshop. A template is provided in the file SCC361-CW1-Report-Template.docx and an example abstract accepted at BioMedEng23 is included in Example-ExtendedAbstract-BioMedEng23.docx.

The report must include the following sections:

1. Introduction: This should be a paragraph, describing the problem that you aresolving and potential uses for it.

2. Data and Preparation: Describe the content of the dataset and the data preparation method. Please include the figure that you generated in Section 3.

3. Methodology: Describe the model training and evaluation methods used, including your   reasons for choosing the models. You should briefly describe each method but you do not need to give a detailed technical description.

4. Results: This should include presentation of your results in a table and the confusion matrices as figures, along with your error analysis and observations

5. Conclusion: In this section, you should identify the model that you would recommend for use with your problem and justify your reasoning.

Most conference submissions will not permit you to change the margins, font or font size. Beyond the report title, please use the font Arial at size 10.

Ordinarily, in a paper submission, you would include the names and affiliations of the authors at the top, as in the template. Please do not do this; this submission should be anonymous.

6. Submission

Please submit the data file, code and report on Moodleonor before the deadline of 4pm on Friday, 8th November, 2024. The data file must be submitted as a single file called “cw1.mat” contain only the following variables; you do not need to submit the whole dataset:

• “classes” variable

•    “training_index” variable

•    Accuracy, confusion matrix and time taken measures.

You can do this with the save command, which takes the format

save(‘cw1’,’variable1’,’variable2’,’variable3’ );

You code should be submitted as a single MATLAB script. (.m file), which is running without any errors, structured and includes documentation/ detailed comments.

Your 1-page report should be submitted as a pdf file, without your name.

There will be separate submission points for the data file, code and for the report. If for some reason, you cannot upload your submission, please zip it up and e-mail it to

b.williams6@lancaster.ac.uk and scc-teaching-office@lancaster.ac.uk as soon as possible. You do not need to submit the rest of your data.

Your submission should be anonymous and not include your name in the data file, code or report.

7. Marking

Marks and feedback will be returned by 29th  November 2024. There area total of 20 marks for this coursework and the coursework mark constitutes 20% of your overall mark for this module.

•    10 marks are allocated to correct implementation and results.

•    5 marks are allocated to your code, including appropriate structure and suitable annotation/documentation of your code using comments.

•    5 marks are allocated to your report, with 1 marks per section mentioned above         

如何处理动态语言(Python / JS)的“隐形”调用链? 本文揭示动态语言(Python/JS)中静态AST解析导致调用链“断链”的核心问题,提出通过运行时追踪补全图谱的解决方案。基于Code-Graph-RAG的cgr trace机制,分别利用pytest插件与V8 Profiler捕获真实调用路径,将动态边合并至静态图谱,并在权重体系中提升动态边优先级。实践表明,该方法可显著提升图谱覆盖率,实现“结构+行为”双视角理解代码,为MCP与Rerank系统提供可靠支持。 阅读详情

相关推荐

Playwright: Pytest vs Library vs LibraryAsync:三者如何选?

Python中Playwright的3个Target:Pytest(推荐用于E2E自动化测试,支持报告、并行、重试)、Library(同步脚本,适合爬虫与简单任务,需手动管理浏览器)、LibraryAsync(异步脚本,适用于高并发批量操作)。选择依据:测试项目选Pytest,轻量脚本选Library,高并发场景选LibraryAsync。

SmallBull的博客 228

本地化部署 DeepSeek,构建单细胞与空间转录组 AI 分析平台

本地化部署 DeepSeek,构建单细胞与空间转录组 AI 分析平台

weixin_53637133的博客 187

Qwen2.5-VL模型微调实战:从零到部署的完整流程(附避坑指南)

本文详细介绍了Qwen2.5-VL视觉语言模型从零开始的完整微调与部署流程。内容涵盖使用LLaMA-Factory进行LoRA微调的关键参数配置与避坑指南,以及如何将训练好的模型权重合并,并最终利用vLLM高性能推理引擎进行部署,为开发者提供了一套可落地的实战方案。

oo7890的博客 593

【第 009 讲】全面掌握 Python 注释:注释的定义与作用 | 单行注释 | 三引号与多行注释 | 注释使用的最佳实践

本文系统讲解 Python 注释的完整知识体系:从注释的定义与作用讲起,梳理单行注释的书写位置、临时屏蔽用法与 PEP 8 排版规范,剖析注释被忽略的底层机制;进而说明三引号字符串的本质与嵌套问题;最后给出注释使用的三条实践原则,帮助读者写好可读性高的注释。

大模型全栈工程师 · Thanks_ks 1167

Oracle EBS订单的流程(Order->AR)

基本流程创建订单路径:Order Management > Orders,Returns > Sales Orders填写订单头信息,客户,订单类型,销售人员填写订单体信息,输入物料,数量...然后Book Order,订单Book之后,你会发现订单头的Status的状态变成了“Booked”,订单行的状态为"Awaiting Shipping",记录下来你的订单号,后边的每一步都需要这个订单号。

田攀的日志 4万+

一文带你看懂SAP-HANA的基本架构与原理

创作不易,希望大家一键三连支持!!!♥♥♥创作不易,希望大家一键三连支持!!!♥♥♥创作不易,希望大家一键三连支持!!!♥♥♥。

丷江南南的博客 5082

Python 的 yield from 到底转发了什么:拆开 send、throw 和那个 return 值

很多人把yield from记成「省一层 for 循环的语法糖」。写和写,结果看着一样,于是就当它只是少敲几个字。这个理解会在三个地方翻车:调用方.send()的值送不进去、子生成器return的值拿不到、异常和close()传不下去。yield from真正做的事是,外层生成器退成一个透明通道。本文所有输出来自本机 CPython 3.13.14 实测。yield from不是循环,是委托——nextsendthrowclose四个方向的流量全部直通子生成器,并且子生成器return。

小小张说故事的博客 163

投稿前利用GPT-5.5给论文做一次深度校对,投稿命中率翻倍!

3)一致性:请对比摘要的结论与正文(如果我也提供了正文),确保完全一致。请严格检查结果部分,确保客观性:1)纯粹性检查:标出所有包含“为什么”(解释)或“这意味着什么”(暗示)的主观语句,这些应移至讨论部分。请你帮我评估讨论部分的深度:1)解释与对比:检查每一项主要结果是否都解释了原因,并引用了前人研究进行对比(一致或相悖)。我见过太多人把校对理解为检查错别字了,实际上,校对要看的远不止这个,像逻辑是否连贯、术语是否前后一致、图表有没有被正确引用等等的这些细节,往往决定了文章是秒被拒,还是能顺利进入外审。

智能AI让学术科研更容易 414

AI全栈实战 | 3.9-01 爬虫入门:requests 加 BeautifulSoup 三分钟跑通,但 90% 的人栽在这 4 个“礼貌“问题上

⚠️:本文内容仅用于。请遵守目标站点的服务条款与相关法律法规,不得对目标服务造成负担,不得采集、传播个人隐私数据。技术是中性的,边界在你手里。爬虫的入门技术(requests 发请求 + BeautifulSoup 解析)三分钟就能学会。真正区分"会用爬虫"和"会做爬虫的人"的,是这篇我们跑通"请求→解析→存储"的最小闭环,然后重点把"合规与礼貌"这根弦给你绷上。

源码获取 | 运行部署 | 定制二开修改,如果回复不及时请耐心等待,请见谅。 442

零基础入门simulink1000例--第112例:在 Simulink 中构建一个基本的相控阵雷达波束形成系统仿真模型

摘要:本文详细介绍了使用Simulink实现相控阵雷达波束形成技术的完整流程。从创建Simulink模型、设计天线阵列、信号生成,到波束形成算法实现和结果可视化,涵盖了关键步骤。文章重点讲解了均匀线性阵列的设计、线性调频信号生成、相位偏移计算等核心技术,并提供了MATLAB代码示例。通过Scope或ArrayPlot模块进行结果分析,最终可导出为嵌入式代码部署。该系统展现了电子扫描波束的技术优势,为雷达系统设计提供了有效的仿真方法。

amy_mhd的博客 212

假新闻检测论文分享(25)L-DefenseExplainable Fake News Detection With Large Language Model

现有的假新闻检测工作主要集中在通过深度网络结合多种信息来学习假新闻的潜在特征,如可信度、立场、传播模式、额外知识、域外数据等。尽管他们在探测上取得了成功,但受限于他们的黑箱性质,他们无法提供任何对公众至关重要的理由。为解决这一问题,一些研究致力于可解释假新闻检测(EFND),旨在同时生成准确性预测和解释。许多工作通过注意力机制在相关报道中注意突出特别的单词、短语或句子来提供可解释性。然而,这些工作只发现了对最终预测有高贡献的区域,缺乏直观和可信的解释。

weixin_41964296的博客 732

从一段视频到可漫游的 4D 有声场景:思路拆解与最小复现手记

只需一段手机视频,你就能生成可"走进去"的 4D 有声场景:转头时狗叫声方向随之变化,走近时声音更清晰。本文拆解 Video-to-4DAVScene 的核心思路,手把手带你用几十行 Python 搭出最小管线,把视频中的运动物体变成带空间位置的声源,并附上三个真实踩坑的排障经验,代码可直接跑。🎧

helloagent的博客 246

RT-DETR改进前必看 - Ultralytics调参 1:1还原RT-DETR官方版本实验环境,更方便改进

的项目文件中集成了YOLOv3v5v6v8v9v10rt-detr11以及其中不同大小的模型结构,更方便我们学习和使用。的参数配置在路径下,其中中设置了模型在训练Train验证Val/Test预测Predict可视化Visualize导出Export超参数Hyperparameters、以及跟踪Tracker的相关参数。在调参过程中主要涉及训练Train和超参数Hyperparameters。下面主要介绍一下初始超参数Hyperparameters。

Limiiiing的博客 7976

【每天一个 Python 小案例30】Python 基础知识综合小项目:我的工具盒

作为系列收官,本篇把前 29 篇的知识点合成一个能直接用的命令行工具"我的工具盒":计算器(用 ast 解析表达式,不碰 eval)、单位换算与温度转换(一张换算表 + 特例分支)、记账与分类统计(Decimal + JSON 持久化)、以及用"字典当命令表"把菜单和业务逻辑解耦的主循环。文中对比了 eval 的安全隐患与 ast 白名单的做法,解释了 lambda 闭包在字典里的写法与晚绑定陷阱,并在最后给出整个系列的知识地图,把变量、数据结构、控制流、函数、类、异常、文件、标准库八块内容对应到具体篇目。

xinjiyaya的博客 432

(五)C++自制植物大战僵尸游戏LoadingScene的实现讲解

游戏启动后就会立即切换到游戏加载场景中。只有游戏资源文件加载完成后,才能进入游戏。Loadingscene类继承Cocos2d-x中的Scene父类,表明Loadingscene是一个场景类。切换到LoadingScene场景中,首先会创建该场景,会调用函数,在该函数中调用自己定义的方法实现指定功能。代码文件的位置如下图所示。

尔灵尔亿的博客 2008

C# WinForm 基于DirectShow.dll编写的程序,可边预览边保存视频,音频和图片

基于微软的DirectShow.dll的二次开发1.自动识别连接的摄像头跟麦克风且可以对其进行选择(默认选中第一个)2.可录制wmv和avi两种格式的视频并且都带有音频,avi可以录制的分辨率和帧数进行选择,wmv默认进行了淸晰度优化如不喜欢可去除代码中有相关提示3.可在预览点开之后进行拍照,也可边录制视频边拍照4.添加了视频和音频的压缩功能(酌情使用)这次二次开发发现C#对DirectShow的相关信息太少,这次做完也不敢藏私共享出来,还望大家指正

双路径优化+双容差校准

默认使用向量化路径处理常规数据,当检测到内存非连续或需要极致短路性能时,自动切换至 Numba JIT 路径。“当 CI 宽度中位数为 $W$ 时,实际判定容差为 $10^{-12} + 10^{-9} \times W$"针对表征谱算子 2 的实际输出量纲(例如 $10^{-3}$ 至 $10^3$),调整。准确标记了哪些数组被复制。非短路、静默拷贝风险、量纲耦合容差),本方案重构了核心逻辑。,并完善审计元数据以记录内存拷贝状态。, 确保在不同量纲下判定标准的一致性。,否则需排查上游数据生成逻辑。

2301_77211362的博客 202

Probability and Statistics - 4th edition

Probability and Statistics - 4th edition

yolo 和 deft 算法的区别

你应该是打错了:是,不是 defrat;

曾大强博客 274

汉书HE8,好用的汇编代码编写工具

汉书HE8,好用的汇编代码编写工具早期编写汇编代码所用功能强大

Outlook Express 6 (OE6) for Win7/Win8/Win10

英文版 Outlook Express6.0, 兼容Win7/Win10/WinXP,解压就可用。

两张表合并之后,行数悄悄多了一倍

pandas merge 行数异常膨胀源于右表键不唯一,导致数据静默复制。实测显示,未聚合的右表(756行)与左表合并后行数增至504行,合计膨胀3.5倍,但无报错。validate 参数仅在检查键唯一性时有效,one_to_one 和 many_to_one 可拦截问题,但需结合 duplicated() 前置检查。正确做法为先按键聚合右表,再合并,避免重复。建议合并前后核对行数、合计,并使用 indicator=True 排查匹配情况,确保数据一致性。

patrickstar231的博客 251

蓝桥杯·全国青少年信息素养大赛·电子学会Python/C++考级 备考:莫队算法离线区间查询详解

备赛进行时:第十八届蓝桥杯软件赛报名已于 2026-10-08 10:00 开启、12-18 14:00 截止,省赛定在 2027-04-10(C/C++·Python 程序设计 9:00–13:00);中国电子学会 2026 年 12 月软件编程(C/C++ 一级至十级、Python 一级至六级)考级报名 9/23–12/2 16:00、统考 12-12;全国青少年信息素养大赛 2026—2027 赛季算法应用主题赛也已进入复盘练兵窗口。

IT_Scratch的博客 184

我用 200 行代码写了个“代码屎山检测器“,扫完公司的老项目后我沉默了

这个工具不能帮你把屎山铲平,但至少能让你知道自己面对的是多大的山,也能在代码评审时用数据说话——“这个 PR 把圈复杂度从 12 推到了 18,能不能拆一下?毕竟,不能量化的东西,就没法改进。

xixiaoyunya的博客 272

智慧农业实战:育秧车间秧盘计数与苗情分级的Python实现

首先,建立统一的数据结构,保存每盘秧苗的编号、批次、覆盖度、叶色得分和播种天数。A = "壮苗"B = "合格苗"C = "弱苗"@dataclassdays: int。

荆棘鸟智能的博客 138

Java Arrays.asList 常见坑详解|UnsupportedOperationException、数组联动、基本类型 bug

解析 Arrays.asList 常见开发陷阱,演示 UnsupportedOperationException、底层数组引用共享、基本类型数组问题,区分 Arrays 内部 ArrayList 与 java.util.ArrayList,给出数组转 List 的各种场景正确代码。

weixin_42617033的博客 511

【每天一个 Python 小案例29】Python 实现商品购物车

本篇实现一个购物车:商品目录、加入商品、修改数量、移除商品、查看小计、计算满减与 VIP 折扣、结算扣库存。核心设计是"目录与购物车分离"——目录存商品主数据,购物车只存 {商品编号: 数量};金额一律用 Decimal 并做 ROUND_HALF_UP 舍入。折扣部分讲清阶梯满减的匹配顺序(阈值从高到低、命中即停)与叠加顺序(先满减、后打折),并用一次完整结算演示 706 元如何变成 613.70 元。

xinjiyaya的博客 220

Python的字典

Python字典是存储键值对的数据结构,通过键(key)快速查找对应的值(value)。可使用{}定义,支持增删改查操作:通过dict[key]查询或修改值,get()方法安全获取并设置默认值,del dict[key]删除键值对,keys()、values()和items()用于遍历。items()结合双变量循环可高效遍历所有键值对,提升代码可读性与灵活性。

qq_43010954的博客 199

黄仁勋走了,护城河留下了什么

11 月 12 日,英伟达董事会批准黄仁勋辞去总裁、CEO 和董事职务,即刻生效,CFO 克雷斯出任临时 CEO;股价开盘一度跌 14.35%,收盘只跌 4.34%,市值单日蒸发 1820 亿美元;本文把「创始人走了护城河就没了」这个流行说法拆开——CUDA 还在,但 CUDA 正在被 Claude 三天凿穿,真正决定下一段路的是三个可以核对的东西:治理结构、决策机制、以及下一个百亿美元由谁拍板。

领码SPARK - 以无代码之星火,燎原数字之未来! 187

【AI 开发从入门到进阶 · 09】RAG 实战:用 Embedding + FAISS 从零搭建本地知识库问答(含切分、重排与幻觉控制)

本文系统讲解RAG(检索增强生成)的实现与优化,从为何选择RAG而非提示工程或微调出发,完整演示一条可运行的中文RAG链路:文档加载、递归切分、向量化、FAISS索引构建、混合检索与Prompt生成。重点剖析五大关键环节——切分策略、Embedding选型、混合检索、重排(Rerank)及幻觉控制,并强调分模块评估的重要性。附常见问题排查与生产实践建议,为构建高效、可信的企业知识问答系统提供完整指南。

信息安全领域优质创作者|操作系统领域专家 95
上一篇: program python,java
下一篇: CSC1003 JAVA
priorityqueue3
博客等级 码龄2年 252粉丝 40原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值