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 part 2/3 #493

Merged
merged 18 commits into from Apr 16, 2024
Merged

Trapping part 2/3 #493

merged 18 commits into from Apr 16, 2024

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 7, 2024

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

Commits on Jan 8, 2024

  1. Configuration menu
    Copy the full SHA
    3730a91 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    141f7f6 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    1b436ca View commit details
    Browse the repository at this point in the history
  4. feat(trapping): Create trapping constraints automatically

    Previously, TrappingSR3 could only use constraints passed to it, and only then a
    limited set of constraints.  It also didn't apply the trapping constraints
    automatically, because constraints were required at __init__, and actually
    shaping them requires knowledge about the number of features, typically not
    known until fit (unless the user is a developer who knows how the feature
    libraries work internally 😉)
    
    WIP, Spawned issue #452
    Jacob-Stevens-Haas committed Jan 8, 2024
    Configuration menu
    Copy the full SHA
    7b2622b View commit details
    Browse the repository at this point in the history

Commits on Jan 9, 2024

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

Commits on Jan 10, 2024

  1. feat(utils): Deprecate target format constraints

    And simplify reorder_constraints
    Jacob-Stevens-Haas committed Jan 10, 2024
    Configuration menu
    Copy the full SHA
    f4a8f80 View commit details
    Browse the repository at this point in the history
  2. test(reformat_constraints): Make target and feature format clear

    Read the fucking diff
    
    backport-to: constraint-order
    Jacob-Stevens-Haas committed Jan 10, 2024
    Configuration menu
    Copy the full SHA
    e0f723b View commit details
    Browse the repository at this point in the history
  3. feat(trapping): Enable merging trapping and user constraints

    Also:
    * (constrained_sr3)clean up creating cvxpy constraints
    * (constrained_sr3)Clone the cvxpy problem in case of except statements,
    because prob.solve() mutates prob in a mathematically significant way
    Jacob-Stevens-Haas committed Jan 10, 2024
    Configuration menu
    Copy the full SHA
    c8339c0 View commit details
    Browse the repository at this point in the history

Commits on Apr 16, 2024

  1. Configuration menu
    Copy the full SHA
    598ab21 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    a88a1f2 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    cb1ab37 View commit details
    Browse the repository at this point in the history