全因素采样

LatinHypercubeSampling中的属性

名称

类型

含义

clip

bool

是否将样本数取整到每个 nx 维度

xlimts = {"x1": [0, 10], "x2": [0, 20]}
s = FullFactorialSampling(xlimts)
s.clip = True
points = s.sample(50, tablePath=path)
print(points)

# 画图展示
plt.plot(points[:, 0], points[:, 1], "o")
plt.xlabel(s.xTitle[0])
plt.ylabel(s.xTitle[1])
plt.show()
../../_images/%E5%85%A8%E5%9B%A0%E7%B4%A0%E9%87%87%E6%A0%B7%E6%95%88%E6%9E%9C%E5%9B%BE.png