This site uses different types of cookies, including analytics and functional cookies (its own and from other sites). To change your cookie settings or find out more, click here. If you continue browsing our website, you accept these cookies.
on 12-12-201304:33 PM - edited on 04-22-201901:43 PM by NeilR
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:
This script states to take the data coming in from Input #1 and label it "model.data". Next, unserialize (break down) the data in the field Object (specified by "model.data%Object"). Finally, print the results in the Alteryx Output window. The final results for this particular object are then printed out, as shown.
As you can see, the output clearly states that my predictor variables are Chk_Bal, Duration, Credit_Hist, Purpose, etc. The end result is quick, clean, and can really help get you out of a jam if you lose your data.