当前位置:网站首页>sklearn 高维数据集制作make_circles 和 make_moons
sklearn 高维数据集制作make_circles 和 make_moons
2022-06-25 08:16:00 【郭庆汝】
sklearn 高维数据集制作make_circles 和 make_moons

import pandas as pd
import matplotlib.pyplot as plt
from sklearn.datasets import make_circles
from sklearn.datasets import make_moons
#生成数据 make_circles 和 make_moons,并显示 X = 400x2, Y = {
0, 1}400 ,画图:
#返回值x:[n_samples, 2]形状的数组,生成的样本
# y:[n_samples]形状的数组,每个样本的标签(0或1)
def draw_circle_and_moon():
X_circle,Y_circle=make_circles(n_samples=400,noise=0.1,factor=0.1)
plt.figure("circle")
plt.scatter(X_circle[:,0],X_circle[:,1],s=100,marker="o",edgecolors='r',c=Y_circle)
#c=Y_circle划分两种标签数据的颜色
plt.title('data by make_circles()')
X_moon,Y_moon=make_moons(n_samples=400,noise=0.1)
plt.figure("moon")
plt.scatter(X_moon[:,0],X_moon[:,1],s=100,marker="o",edgecolors='m',c=Y_moon)
plt.title('data by make_moons()')
plt.show()
draw_circle_and_moon()

边栏推荐
- Exchange:管理日历权限
- How to choose an account opening broker? Is it safe to open an account online?
- 《乔布斯传》英文原著重点词汇笔记(三)【 chapter one】
- tp6自动执行的文件是哪个?tp6核心类库有什么作用呢?
- 《乔布斯传》英文原著重点词汇笔记(六)【 chapter three 】
- 《乔布斯传》英文原著重点词汇笔记(四)【 chapter two 】
- How safe is the new bond
- TrendMicro:Apex One Server 工具文件夹
- 【MYSQL】事务的理解
- Sharepoint:sharepoint server 2013 and adrms Integration Guide
猜你喜欢
随机推荐
打新债安全性有多高啊
云网络技术的好处以及类型
【期末复习笔记】数字逻辑
cazy长安战役八卦迷宫
Wechat applet_ 7. Project practice, local life
开户券商怎么选择?在线开户是安全么?
一、单个神经元网络构建
C language: bubble sort
从别人库里拷贝的游戏如何再自己的库里显示
故障:Outlook 收发邮件时的 0x800CCC1A 错误
tp5与tp6的区别是啥呀?
¥3000 | 录「TBtools」视频,交个朋友&拿现金奖!
《乔布斯传》英文原著重点词汇笔记(五)【 chapter three 】
Exchange: manage calendar permissions
RTOS 多线程下hardfault问题总结
In Section 5 of bramble pie project practice, Nokia 5110 LCD is used to display Hello World
wav文件(波形文件)格式分析与详解
Various synchronous learning notes
Hyper-v:Hyper-v 第 1 代或第 2 代虚拟机
检测点是否在多边形内








