How to find an equation from data
There are two ways to get an equation from a table of measurements. You can pick the form of the equation yourself, a straight line, a polynomial, an exponential, and let a tool work out its constants: that is curve fitting and ordinary regression. Or you can let a search look for the form as well as the constants, directly from the data: that is Symbolic Regression, and it is what an automated analysis on Diafunc does. This guide follows one real case from the table to the equation, with every figure taken from the public report.
The result is one readable model for the column you want to explain, with its quality measured on rows the search never saw, and a report that also says where the model is weak.
The data
The table is Yacht Hydrodynamics from the UCI Machine Learning Repository, published under CC BY 4.0: towing-tank measurements of sailing-yacht hulls at different speeds. It has 308 rows and 7 columns. Six columns describe the hull and the speed, and the seventh is what was measured.
| Column | Role |
|---|---|
| Longitudinal position of the center of buoyancy | Input |
| Prismatic coefficient | Input |
| Length-displacement ratio | Input |
| Beam-draught ratio | Input |
| Length-beam ratio | Input |
| Froude number | Input |
| Residuary resistance per unit weight of displacement | Target: the column to explain |
Nobody told the analysis which of the six inputs matter, or what shape the relation has.
Why not a straight line
The obvious first try is a linear regression over all six inputs. The report runs it for you, as one of its baselines, and scores it on the same rows as the discovered model. On this table the straight line explains 67% of the variation of the resistance (R² 0.667). A third of what happens in the tank is left unexplained, which means the relation is not a line.
From here a curve fitter needs you to guess a better form. With six inputs there is no obvious guess.
Three choices before the launch
An automated analysis asks for three things, and none of them is the form of the equation.
1. The table. The file is uploaded as it is. The wizard shows how it will be read and a preview of the first rows.
2. The target, and your questions. Here the target is Residuary resistance per unit weight of displacement. Three questions were typed in plain language, and the report answers each of them: what the resistance of a hull depends on most, how it grows with speed, and which hull-shape ratios matter and which hardly at all.
3. The depth. A depth is a time budget and a credit budget. This run was given four hours and 4,000 credits. It finished after 1 hour and 29 minutes. The first chapters of a report, the ones about the data, are there within minutes; the search for the model takes the rest.
The full description of the wizard is in Analyses .
The equation that came back
This is the model the analysis discovered, as the report prints it:
Discovered model
Residuary resistance per unit weight of displacement
= 106.3 − 105.8 × tanh(4.45 − 10.53 × Froude number
+ 1.66 × Prismatic coefficient
+ Froude number / (Longitudinal position of the center of buoyancy − 3.5)) It reads in one pass. The resistance is a saturating curve, a hyperbolic tangent, of three inputs. It rises ever more steeply with the speed, the Froude number, falls with the prismatic coefficient, and rises with the longitudinal position of the center of buoyancy. The speed carries almost all of it: the report puts its share of what the formula explains at 99.3%, the share of the prismatic coefficient at 0.7%, and the position of buoyancy in the formula with no measurable share.
Three of the six inputs are not in the model at all: the beam-draught ratio, the length-beam ratio and the length-displacement ratio. The search was free to use them and found a model that does without. That is also an answer.
How good it is, measured on rows it never saw
Before the search started, 62 of the 308 rows were set aside. The search worked with the other 246. The figures to quote are the ones on the 62 held-out rows, because they say how the model does on data it has not seen.
| Measure | On the 62 held-out rows | 95% interval |
|---|---|---|
| Quality | 99.17% | 98.65% to 99.49% |
| Error | 0.65% | 0.4% to 1.06% |
| R² | 0.9935 | 0.9894 to 0.996 |
| Complexity | 19.6% |
Against the baselines, on the same rows: the straight line reaches R² 0.667 and the discovered model 0.994, a lift of 0.327. The report calls that margin large, and the model is the closer of the two on 98.4% of the held-out rows. Had the two been level, the report would have said that the relation is linear and that the extra structure adds nothing.
What each measure means, and how the rows are held out, is described in How Diafunc measures quality .
What the report says against its own model
A quality of 99% is not where the report stops. Its validity verdict is valid: nothing in the data or the formula speaks against relying on the result. It still raises two warnings and a note, none of them critical. The first warning: the Froude number on its own almost determines the resistance (Spearman's rho 0.996). The data cannot tell a strong input from a leak, a column computed from the target after the fact, so the report asks whether the Froude number is known before the resistance. In a towing tank it is: it is set by the speed the hull is towed at, before anything is measured.
The second warning is a systematic offset: across the 62 held-out rows the model under-predicts by 0.282 on average, a quarter of the spread of its misses. The report asks to account for it wherever predictions are added up or compared with a threshold, and to check on the next run whether it persists. The note: the misses grow with the predicted value, more slowly than it. And where the model is weaker: on the 35 held-out rows with the length-beam ratio in its third quarter, R² is 0.992 against 0.993 on all rows.
The Deployment Readiness chapter gives the verdict Usable with care: four checks pass, and one warns, because there are too few held-out rows to judge whether the prediction intervals hold.
An equation alone would not have told you this. The equation is the readable part; the report is what lets you decide how far to trust it.
The whole report is public: Yacht Hydrodynamics, the finished analysis.
When a curve fitter is enough
If your table has one input and you know the family of the curve, a curve fitter or a trendline in a spreadsheet answers the question in seconds, and an analysis that runs for an hour or more is the wrong tool. The search is for the other case: several inputs, or a form nobody can name in advance.
Your own table
Upload a CSV or Excel file, choose the column to explain, and launch. An analysis runs from about an hour, and you get an email when it is done. From about 150 rows the report grades its figures; below that it states them with their intervals, and below about 60 it says the model itself is not to be relied on.