# Using a decision tree with 3 dimensional input points

I implemented a normal classification tree (that uses the Gini index to look for a split). I am using it to predict the age of people. My input data was a series of points on 1 axis (Only X coordinate), and output was an age (9 years old, 10 years old....).

Example:

p1 = 1.3, p2 = 3.4, p3 = 2.1 ........ => Output = 9 years old

p1 = 1.4, p2 = 2.4, p3 = 2.6 ........ => Output = 10 years old

My tree looks something like (just an example):

if p1 > 1
if p2 < 3
output = 10 years old
else
output = 9 years old
else
...


This is working fine.

Now I want to modify it, to work with 3D points. I mean points that have X, Y, Z and not just X.

So my input data would be like:

p1 = [1.2, 1.5, 4.3], p2 = [4.2, 1.3, 5.2] .... => output = 9 years old

How do I approach this? should my tree use each coordinate as a seperate input (p1x, p1y, p1z, p2x, p2y....) or is there an approach that can be taken for my case?

Note: I am using classification trees but if you think there's another way of predicting in my case, I would love to know about it.

Also I'm using python code, but I'm looking for the logic not the programming part.

Thanks

## 1 Answer

To use a single vector (p1x, p1y, p1z, p2x, p2y....) per person would be the most easy and obvious way.

Maybe, your prediction would also improve by including some other transformations of these features. But usually trees are eager to use all the information you feed them efficiently. So just a 9-dimensional vector would do.