Skip to content

Support the masure regression #387

Open

Description

@1-Bart-1

The python version of this package already supports the masure regression. In a similar way as in which we support neuralfoil, we should make a submodule such that we can support the masure regression.

Activity

  1. 1-Bort-1 commented on Sep 23, 2026

    @1-Bort-1
    Member

    Adding masure_regression to AirfoilAero: a pure-Julia evaluator for the sklearn Extra-Trees models (exported to .npz by a one-off script in scripts/), wired into resolve_airfoil so a wing_airfoils entry resolves to a polars table like neuralfoil. Parity-tested against sklearn.predict on a small committed forest. Leaving out retraining in Julia, shipping/downloading the 2.3 GB models, and an on-disk polar cache.

  2. 1-Bart-1 commented on Sep 30, 2026

    @1-Bart-1
    MemberAuthor

    So we convert the tree to an npz? Isn't that tricky or difficult to get right? Can we do a full-Julia version of the tree and then an npz alternative so we can directly compare?

  3. 1-Bort-1 commented on Sep 30, 2026

    @1-Bort-1
    Member

    Review plan — #387 masure regression (revised after comment 5910987987)

    Objective. Let a geometry YAML entry [id, masure_regression, {t, eta, kappa, delta, lambda, phi}] resolve to polars in Julia, as the Python VSM does, instead of erroring "not yet supported".

    Approach. Same shape as NeuralFoil: pure Julia inside the AirfoilAero submodule. The Python models are three ~2.3 GB scikit-learn Extra-Trees pickles on Zenodo, one per Re = 1e6, 5e6, 2e7, with outputs CD, CL, CM. A one-off Python script dumps each tree's five flat arrays (children_left/right, feature, threshold, value) to .npz. A Julia evaluator walks the trees and averages them. resolve_airfoil's masure_regression branch writes a polars table like the neuralfoil branch.

    Direct comparison (your question). The Julia evaluator is checked against sklearn.predict row by row, to 1e-12:

    • In CI, a committed few-KB fixture holds a small sklearn Extra Trees and its predictions.
    • On the real models, the check runs when VSM_MASURE_MODELS_DIR is set.

    The pitfalls the test catches are the float32 cast sklearn applies before each split comparison, Pipeline/MultiOutput wrapping, and the CD-first column order.

    Option, if you meant it: retrain the Extra Trees in Julia from Masure's CFD dataset, with no pickles at all, and compare it against the npz model. It can only agree statistically, because the splits are random. It also needs an Extra-Trees trainer Julia lacks, so I'd make it a separate issue.

    Files expected. New src/airfoil_aero/masure_regression.jl; AirfoilAero.jl; airfoil_io.jl (branch + docstring); maybe obj_adapter/obj_to_yaml.jl (models dir); new scripts/export_masure_models.py; new test/airfoil_aero/test_masure_regression.jl + test/data/masure_fixture/; docs/src/airfoil_pipeline.md; CHANGELOG.md; typo fixes in data/TUDELFT_V3_KITE/aero_geometry*.yaml.


    Remove the agent:needs-plan-approval label to start.
    Task VortexStepMethod.jl-387.

  4. 16 remaining items

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions