Jump to content
We've recently updated our Privacy Statement, available here. ×

Create Polynomial Curve Fit from IronPython

Riley ODonnell

Recommended Posts

I would like to add a polynomial curve to my visualisation with degree 4, a custom name, and set to update manually. I would then like to retrieve the parameters for the fitted model. The use case is fitting a model over multiple different time periods which can then be used in comparison calculations.

I currently have the following script which is just able to add the polynomial fit of specified degree:

from Spotfire.Dxp.Application.Visuals import ScatterPlot

from Spotfire.Dxp.Application.Visuals.FittingModels import PolynomialFittingModel

for viz in Document.Pages[1].Visuals:

if viz.Title == "title:

vis1 = viz.As[scatterPlot]()

fm = vis2.FittingModels


fm.AddNew(PolynomialFittingModel).Degree = 4

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...