IIS_2023_1/kondrashin_mikhail_lab_2/data.py

13 lines
340 B
Python
Raw Normal View History

2023-11-25 17:47:27 +04:00
import numpy as np
def generate_data():
size = 750
np.random.seed(0)
X = np.random.uniform(0, 1, (size, 14))
Y = (10 * np.sin(np.pi * X[:, 0] * X[:, 1]) + 20 * (X[:, 2] - .5) ** 2 + 10 * X[:, 3] + 5 * X[:, 4] ** 5 + np.random.normal(0, 1))
X[:, 10:] = X[:, :4] + np.random.normal(0, .025, (size, 4))
return X, Y