EN DE

Measurement Data in OnlyOffice — Fire and Forget

My NLP solver plugin for OnlyOffice has gained a second mode: PolyFit. While the classical solver assumes a known objective function and only tunes its parameters, PolyFit looks for the formula itself. The use case: measurement data analysis when no theoretical model is available.

The Common Case: Data Without a Model

In practice it usually looks like this: there's a test rig, an experimental setup, a sensor array — and at the end, a table with input variables x1, x2, x3, … and a target variable y. What's missing is the formula in between. The theoretical model is either unknown, too complex for the required accuracy, or simply impractical for everyday use.

The classical answer is regression. In Excel or OnlyOffice this works reasonably well with a single variable, becomes cumbersome with several, and as soon as you have to commit to a specific functional form (y = a·x + b? y = a·x² + b·x + c? y = a/x + b·x²?), you start guessing. You try a few approaches, glance at the coefficient of determination, and decide based on intuition.

PolyFit flips this around: instead of the user, the algorithm decides on the functional form. It systematically tries all polynomial combinations within the defined degree range and returns the formula with the best fit — structure and coefficients in a single pass.

💡 What PolyFit Does Differently

The classical solver mode assumes that the function f(x1, x2, x3, …) is already known and only its parameters need to be adjusted. PolyFit treats the function itself as unknown. Both the structure of the polynomial and its coefficients are fitted.

Fire and Forget

The principle is deliberately low-friction: mark the input columns, mark the target column, specify the degree range, hit Start. Everything else runs on its own. Anyone who knows their data has a rough sense of which degree range is reasonable — beyond that, it's search effort that can be automated.

That's also why the algorithm is intentionally kept this direct. Instead of building symbolic regression with operator trees and genetic algorithms, PolyFit confines itself to the polynomial space. It's bounded enough to be searched systematically, and expressive enough to describe most smooth relationships in engineering data well. Negative exponents are allowed — which makes it possible to capture saturation and hyperbolic-like behavior without dragging that complexity into the algorithm.

The restriction to polynomials has another, often overlooked advantage: it potentially preserves dimensional consistency. A great many physical formulas are built to be unit-correct — both sides of the equation carry the same physical dimension. With a polynomial structure this can be carried through cleanly by choosing the right exponents: if x1 is measured in meters and x2 in seconds, then x1²·x2⁻¹ yields a squared velocity with a clearly defined unit. Functional forms like sin(x), log(x) or , on the other hand, are only well-defined for dimensionless arguments — the moment they show up as arbitrary building blocks in a regression, dimensional consistency is necessarily broken.

✅ A Deliberate Restriction

Polynomials cover the bulk of technically interesting relationships. If you're expecting an exponential or a logarithm, PolyFit isn't the right tool — if you need a robust, dimensionally consistent, fast-to-evaluate approximation, it is.

The Result Is an Ordinary Cell Formula

This is the point that distinguishes PolyFit from a pure analysis tool. The result is not a black box, not a model object, not an external function — it's a finished polynomial formula as text that you can paste straight into a cell. For example:

-0.1300·x2⁻¹·x3² + 1.5252·x1²·x3 + 0.8147·x1 + …

The fitting itself can take noticeably long depending on dataset size and search space — that's the price for genuinely searching a large space systematically. But it happens once. What's left afterwards is an algebraic formula with no state, no lookups, no iteration: plug in the values, evaluate, done.

That makes PolyFit a good preliminary step for design and real-time software. The slow, one-time model building happens offline. What remains in the actual application is polynomial evaluation — one of the fastest computations there is. Whether the formula later runs in a spreadsheet calculation, a configuration app, or an embedded system: runtime is constant and negligible.

Performance: WASM or the Native Service

The plugin itself runs as WebAssembly inside the OnlyOffice editor — written in Go, compiled to WASM. This works well for most datasets. Once search space or data volume grow, however, WASM becomes a noticeable bottleneck: single-threaded, sandboxed, with the corresponding overhead at the JavaScript ↔ WASM boundary.

That's why there's also a native service: the same Go program, compiled as a regular binary for Linux, Windows and macOS, both amd64 and arm64. You start it from a terminal or a double-click, it listens on a local port (default 8081) and exposes a small HTTP/JSON API. Inside the plugin you enable "Use Native" — and the computation runs in the native process instead of inside the editor. With everything that brings: full CPU access, no WASM bridge, no sandbox.

The service is optional. If you don't want it, ignore it — the plugin works without. If you're working seriously with larger datasets, you'll unzip it once and let the binary run.

Manual and Download

A step-by-step manual, example files and the current downloads are available on the project page. The code is licensed under AGPL-3.0, with additional commercial restrictions.

If you have a concrete dataset or a concrete analysis problem and want to find out whether PolyFit fits — feel free to reach out. Cases like that are the best test candidates, and I keep developing the solver along real problems.