更高效的支持向量机算法实现及其在手写数字识别中的应用——04手动实现使用SMO的Kernel SVM

大数据机器学习课程第二次实验项目

作者

叶璨铭 (2024214500) ycm24@mails.tsinghua.edu.cn

发布于

2024年11月11日星期一

清华深研院-横

本文是更高效的支持向量机算法实现及其在手写数字识别中的应用系列文章第04篇——手动实现使用SMO的Kernel SVM。


source

0.1 KernelSupportVectorClassifier

 KernelSupportVectorClassifier
                                (config:thu_big_data_ml.svm.kernel_hpo.Sup
                                portVectorClassifierConfig)

自己实现的支持向量机分类器。需要支持多分类。

Exported source
from thu_big_data_ml.svm.kernel_hpo import SupportVectorClassifierConfig
from fastcore.all import patch, store_attr
/home/ye_canming/repos/assignments/THU-Coursework-Machine-Learning-for-Big-Data/thu_big_data_ml/svm/kernel_hpo.py:224: ExperimentalWarning:

QMCSampler is experimental (supported from v3.0.0). The interface can change in the future.

/home/ye_canming/repos/assignments/THU-Coursework-Machine-Learning-for-Big-Data/thu_big_data_ml/svm/kernel_hpo.py:225: ExperimentalWarning:

WilcoxonPruner is experimental (supported from v3.6.0). The interface can change in the future.

[I 2024-11-30 04:17:44,906] Using an existing study with name 'svm kernel hpo 11.17 3.0' instead of creating a new one.
Exported source
class KernelSupportVectorClassifier:
    """自己实现的支持向量机分类器。需要支持多分类。
    """
    def __init__(self, config:SupportVectorClassifierConfig):
        store_attr()

由于本次这次Project时间不足,而我们已经完美完成了项目的前4个要求,所以我们暂时没有时间探索这里如何实现。等我有时间了我将继续更新这里的KernelSupportVectorClassifier 敬请关注后续的实现,我将把完整代码开源到 Open-Book-Studio/THU-Coursework-Machine-Learning-for-Big-Data 下的 svm_handy_crafted_kernel 笔记本中。