机器学习 -- 支持向量机SVM(Ⅴ SVM处理非线性数据问题)

本文介绍了如何使用支持向量机(SVM)处理非线性数据,通过Python的`make_moons()`函数创建非线性数据集,接着展示了如何引入多项式特征来构建SVM模型,最后通过绘制决策边界展示了SVM在非线性数据上的应用。
摘要由CSDN通过智能技术生成

datasets中make_moons()函数:

(1)函数定义

Signature:
datasets.make_moons(
    n_samples=100,
    shuffle=True,
    noise=None,
    random_state=None,
)
Docstring:
Make two interleaving half circles

A simple toy dataset to visualize clustering and classification algorithms.
Parameters
----------
n_samples : int, optional (default=100)
    The total number of points generated.

shuffle : bool, optional (default=True)
    Whether to shuffle the samples.

noise : double or None (default=None)
    Standard deviation of Gaussian noise added to the data.

random_state : int, RandomState instance or None (default)
    Determines random number generation for dataset shuffling and noise.
    Pass an int for reproducible output across multiple function calls.
    See :term:`Glossary <random_state>`.

Returns
-------
X : array of shape [n_samples, 2] 
    The generated samples.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值