on 12-12-2013 04:33 PM - edited on 07-27-2021 11:47 PM by APIUserOpsDM
We were recently approached by a concerned client with "Help! I have a model object in a .yxdb but my computer crashed and I need to document the predictor variables!" This naturally led to a discussion on how we can pull these variables back for the client, and what kind of scenarios would lead to this.
The first scenario is the most obvious (the case of the client). The model object was created using Alteryx and was stored in a .yxdb. During another process, my computer crashed and I lost all of my data! Luckily, I still had the model object in a shared location, but I need to document the variables and the model object looks like this:
Unfortunately, this does not give us any information about the data or more importantly, the predictor variables. Luckily, a simple script can break down this model object and fill you in on all of the details.
Within Alteryx, attach an R Tool to your data stream (I am using the Forest Model Object that is created from an Alteryx Sample):
Next, copy and paste the following script into your R Tool code builder:
model.data <- read.Alteryx("#1")
the.obj <- unserializeObject(as.character(model.data$Object[1]))
print(the.obj$call)