生成随机产生的训练数据
#createDist.py
from numpy import *
import matplotlib import matplotlib.pyplot as plt from matplotlib.patches import Rectangle n = 1000 #number of points to create xcord = zeros((n))#create a shuzu,length=n ycord = zeros((n)) markers =[]#used to give different date with different size colors =[]#used to give different date with different color fw = open('testSet.txt','w')#open a file in a write way for i in range(n):#give n=1000 date diferent value [r0,r1] = random.standard_normal(2)#create a list whitch has two elements myClass = random.uniform(0,1)#used to classify if (myClass <= 0.16): fFlyer = random.uniform(22000, 60000) tats = 3 + 1.6*r1 markers.appe
生成随机产生的训练数据
最新推荐文章于 2022-10-18 15:33:03 发布