I made a Random Forest Regression model with a dataset that consist of several sheets, each sheet is representing a different but identical data that looks like this:
I am still confused on how to export the predictor output into a single excel file with the corresponding sheet as in my dataset and also how to export the trained model into a different table after the Loop End. I have tried adding Table Write and Excel Write but it gives me the output not as I expected. What should I do in the Loop End part? Thank you very much
In this case, if you want to write the model, predictions, and results into separate sheets in a single spreadsheet, I would structure things a little differently.
First of all, the Loop End is not what you want here. The Loop End is basically a way to concatenate similar data structures together in a single table, but your 3 three data structures aren’t similar. So you could use a Variable Loop End instead.
Then, I would use three different Excel Writer nodes, one each after the Predictor, Model to Cell, and Constant Value Columns - making sure that each is writing to different sheets in the same spreadsheet. You can control which sheet by using the flow variable defined earlier in the workflow.
If you want to upload your workflow in progress, I could try to be more specific with a screenshot.
Hello @ScottF , thank you for your warm greetings.
Yes, sure, here I upload my current workflow. Regression_Random Forest.knwf (59.3 KB)
So, basically I do not have to use Loop End?
Something like this is what I was suggesting before. Keep in mind that I don’t have your data to test with, so there will probably be additional tweaking required, but hopefully this gives you some ideas for moving forward.
I’m not sure writing the model back to Excel is the best way to proceed here either (hello Model Writer) , but if you really want to store the model inside a spreadsheet with results, this should do it. In theory