ScratchData LogoScratchData
Back to Nishpish's profile

Curve Fitter (nth degree polynomial regression)

NINishpish•Created February 14, 2021
Curve Fitter (nth degree polynomial regression)
118
91
1142 views
View on Scratch

Instructions

After placing more than ten points, press space or fit to fit a polynomial function to them. Press deg to change the degree of the polynomial you want to fit. Go here for nearly instant calculation: turbowarp.org/487890491/fullscreen?hqpen&turbo

Description

How it works: This project uses gradient descent with the Adam optimizer to minimize the mean squared distance between the y values of the points (targets) and y values of the curve at the x values of the points (predictions). To find a good polynomial degree, it uses 3-fold cross validation, weighted to bias it toward lower degrees. The coordinate data is normalized so as not to prevent numerical instability.

Project Details

Project ID487890491
CreatedFebruary 14, 2021
Last ModifiedApril 6, 2022
SharedFebruary 15, 2021
Visibilityvisible
CommentsAllowed