{"id":21682,"library":"paramz","title":"paramz","description":"paramz is a parameterization framework for Python, providing mutable, constrained parameters with optimization capabilities (e.g., scipy-based L-BFGS-B). Current version is 0.9.6; release cadence is irregular with no recent updates since 2020.","status":"maintenance","version":"0.9.6","language":"python","source_language":"en","source_url":"https://github.com/sods/paramz","tags":["parameterization","optimization","machine-learning","framework"],"install":[{"cmd":"pip install paramz","lang":"bash","label":"Install from PyPI"}],"dependencies":[],"imports":[{"note":"Correct import for the main parameter class; note that paramz is not namespaced.","symbol":"Param","correct":"from paramz import Param"},{"note":"ParamArray is directly exposed in the top-level package, not in core.","wrong":"from paramz.core import ParamArray","symbol":"ParamArray","correct":"from paramz import ParamArray"},{"note":"Model is a top-level class, not a submodule.","wrong":"from paramz.model import Model","symbol":"Model","correct":"from paramz import Model"}],"quickstart":{"code":"from paramz import Param, Model\nimport numpy as np\n\nclass MyModel(Model):\n    def __init__(self):\n        super().__init__()\n        self.param = Param('x', np.array([1.0, 2.0]))\n\nm = MyModel()\nprint(m)\nprint(m.param.values)","lang":"python","description":"Create a model with a parameter and display its values."},"warnings":[{"fix":"Migrate to GPyTorch or Pyro.","message":"paramz is in maintenance mode; consider switching to GPy's paramz (built-in) or Pyro's parameterization for active development.","severity":"deprecated","affected_versions":"all"},{"fix":"Always assign using slice syntax: param[:] = new_values.","message":"Param objects have their values stored as a NumPy array; setting values directly via assignment (e.g., param.values = new_array) may not trigger constraints properly. Use param[:] = new_array instead.","severity":"gotcha","affected_versions":"all"},{"fix":"Define log_likelihood() returning the negative log-likelihood and optionally gradients() for custom gradient computation.","message":"When using gradient-based optimization, ensure that the model's log_likelihood() and gradients() methods are implemented; otherwise the optimizer may fail silently.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Ensure that Model.__init__() is called via super().__init__() and that all parameters are added before optimization.","cause":"The optimizer expects a _gradient_array_ method; this is missing if you didn't call super().__init__() or if parameter names are inconsistent.","error":"AttributeError: 'Model' object has no attribute '_gradient_array_'"},{"fix":"Check that Param() is called with correct arguments, e.g., Param('name', np.array([1.0])).","cause":"Param was not properly initialized or the object was overwritten.","error":"Param object has no attribute 'values'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}