# How the tree should be trained on this input data?

Remote exam in Machine learning, it is necessary to write an algorithm decision tree for the following dataset:
``````x = []
for i in range(500):
x.append([round(-2+50*random()), round(-2+50*random())])
x = np.array(x)
y = round(random()+ x[1, :] + x[2, :] )``````

As using these data, I train a tree? Is it possible that Y is something missing?
April 19th 20 at 12:46
April 19th 20 at 12:48
Solution
The code error, I copied.

X_train = []
for i in range(5000):
X_train.append([round(-2 + 50 * rand()), round(-2 + 50 * rand())])
X_train = np.array(X_train)
Y_train = round(rand()) + X_train[:, 0] + X_train[:, 1]

X_test = []
for i in range(500):
X_test.append([round(-2 + 50 * rand()), round(-2 + 50 * rand())])
X_test = np.array(X_test)
Y_test = round(rand()) + X_test[:, 0] + X_test[:, 1]

I have obtained 500 random values and need to be classified according to randomname count classes. Without sclera it was very difficult, but I did the code and it works, the issue is closed.

Find more questions by tags Machine learningPython