Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trapping constraints #437

Closed
wants to merge 7 commits into from
Closed

Commits on Dec 10, 2023

  1. ENH: Add function to calculate number of polynomial features

    This is much faster than fitting the features, and can be used
    by trapping to replace some constraint index calculations.
    
    Also:
    Add docstring/type annotations
    Rename a variable so it doesn't shadow newly-imported name
    Jacob-Stevens-Haas committed Dec 10, 2023
    Configuration menu
    Copy the full SHA
    7d4dd98 View commit details
    Browse the repository at this point in the history
  2. ENH: add _make_constraints to TrappingSR3

    There are several major differences from the version in example 8:
    * Coupled with PolynomialLibrary logic using PolynomialLibrary.powers_.
    Previously, this coupling was implicit and actually tied to the specific order
    in Example 8, not the order users would expect.
    * Instead of handling pre-flattened 2D array, constraints are built with
    target and feature axes separately, letting the caller handle formatting
    the constraints as "target" or "feature".  This gives us flexibility to
    later clean up the constraint logic outside this function without needing to
    return here and removes the need for striding calculations like:
    n_tgts * (n_tgts + k - 1) + i + n_tgts * int(j * (2 * n_tgts - j - 3) / 2.0)
    Since constraints are built directly from the terms and exponents in the
    library, its much easier to read and debug the code.
    * Renamed "r" as "n_tgts", etc.  Single-letter index variables are
    removed.  When they occur in homogenous iterators, they are concatenated with
    what they're iterating (e.g. tgt_i, tgt_j)
    * Broke out the different kinds of constraints into helper functions to make
    it easier to test.
    
    This allows follow on work to auto-attach constraints to a problem.
    Jacob-Stevens-Haas committed Dec 10, 2023
    Configuration menu
    Copy the full SHA
    65304b2 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    018eb9a View commit details
    Browse the repository at this point in the history
  4. ENH: Allow all polynomial library library options in trapping

    (other than degree, which has to be 2)
    Jacob-Stevens-Haas committed Dec 10, 2023
    Configuration menu
    Copy the full SHA
    0870f57 View commit details
    Browse the repository at this point in the history

Commits on Jan 2, 2024

  1. Configuration menu
    Copy the full SHA
    e007247 View commit details
    Browse the repository at this point in the history

Commits on Jan 8, 2024

  1. Configuration menu
    Copy the full SHA
    f53151a View commit details
    Browse the repository at this point in the history

Commits on Jan 16, 2024

  1. Configuration menu
    Copy the full SHA
    dd501a8 View commit details
    Browse the repository at this point in the history