so I have an object that I need to convert into something viewable in a sankey diagram. the object looks like this:
"DecisionTreeRegressionModel": [
{
" If (feature 28 <= 16.0)": [
{
" If (feature 0 in {0.0})": [
{
" Predict: 13.0": []
}
]
},
{
" Else (feature 0 not in {0.0})": [
{
" Predict: 16.0": []
}
]
}
]
},
{
" Else (feature 28 > 16.0)": [
{
" If (feature 28 <= 40.0)": [
{
" Predict: 40.0": []
}
]
},
{
" Else (feature 28 > 40.0)": [
{
" If (feature 0 in {0.0})": [
{
" Predict: 45.0": []
}
]
},
{
" Else (feature 0 not in {0.0})": [
{
" Predict: 50.0": []
}
]
}
]
}
]
}
]
the problem is that I don't know the depth of the object array so it must be automatically generated. what is the best way to loop through the object array and fill the sankey chart dataset?