In case you missed the announcement: The Alteryx One Fall Release is here! Learn more about the new features and capabilities here
ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests after December 31, 2025. Set up your security questions now so you can recover your account anytime, just log out and back in to get started. Learn more here
Start Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Spline Tool Output

j_brzezinski
8 - Asteroid
What is  content of the spline tool output object?  I would like to extract lists of variables and coefficiects, r_square, and fitted values for additional analyses and visualizing actual vs fitted values (which are not in the reports output).
1 REPLY 1
ChadM
Alteryx Alumni (Retired)
For the Spline Tool, try dropping in a R Tool, then enter the following script:

the.model = read.Alteryx("#1")
the.model = unserializeObject(as.character(the.model$Object[1]))

## Extracting Coefficients ##
coefficients.names = row.names(the.model$coefficients)
the.model.coefficients = data.frame("Term" = coefficients.names, "Value" = as.vector(the.model$coefficients), row.names = NULL)
write.Alteryx(the.model.coefficients, nOutput = 1)

## Extracting R Squared ##
the.model.summary = data.frame("R.Squared" = the.model$rsq)
write.Alteryx(the.model.summary, nOutput = 2)

## Extracting Fitted Values ##
the.model.fitted.values = data.frame("Fitted.Values" = as.vector(the.model$fitted.values))
write.Alteryx(the.mode?l.fitted.values, nOutput = 3)
 

This will output your coefficients to output 1, the R Squared value to output 2, and the Fitted Values to output 3.  Thanks! 
Labels
Top Solution Authors