cftool: fitting again after changing the data stored in the selected variables

16 views (last 30 days)
Hi there
I'm attempting to fit a polynomial surface to 3 variables using the cftool.
I'm using dividerand() from the Machine learning toolbox to divide my data into test and validation subsets. I'm then plotting both of these sets in cftool. Since each time I run my Matlab code it randomly partitions my data into the test and validation sets I want to plot the surface again each time I run the code, which cftool isnt doing automatically. I need to reselect the data for it to update itself. Is there a way to avoid having to do this manually i.e. where the plot updates itself each time the code is run and the partition is changed?
Thanks for your help!

Accepted Answer

Vidip
Vidip on 21 Dec 2023
I understand that when you use ‘dividerand’ to randomly partition your data into training and validation sets, the partition is determined randomly each time you run your code. However, when you open ‘cftool’ and generate a fit, the software retains the data that was loaded when it was opened.
To automate the process of updating the data in ‘cftool’ with the new random partition, you can consider using the ‘fit’ function directly in your script and then visualize the results using plot commands. The ‘fit’ function allows you to fit models programmatically without requiring manual intervention.
For further information, refer to the documentation link below:

More Answers (0)

Categories

Find more on Get Started with Curve Fitting Toolbox in Help Center and File Exchange

Products


Release

R2019b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!