
Product
Rust Support Now in Beta
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.
This Python package provides bindings for the well-known weighted orthogonal distance regression (ODR) solver odrpack95. This design ensures that users benefit from the performance and reliability of the original Fortran implementation, while working within the modern Python ecosystem.
ODR, also known as errors-in-variables regression, is designed primarily for instances when both the explanatory and response variables have significant errors.
You can install the package via pip:
pip install odrpack
The following example demonstrates a simple use of the package. For more comprehensive examples and explanations, please refer to the documentation pages.
from odrpack import odr_fit
import numpy as np
xdata = np.array([0.982, 1.998, 4.978, 6.01])
ydata = np.array([2.7, 7.4, 148.0, 403.0])
beta0 = np.array([2.0, 0.5])
bounds = (np.array([0.0, 0.0]), np.array([10.0, 0.9]))
def f(x: np.ndarray, beta: np.ndarray) -> np.ndarray:
"Model function."
return beta[0] * np.exp(beta[1]*x)
sol = odr_fit(f, xdata, ydata, beta0, bounds=bounds)
print("beta:", sol.beta)
print("delta:", sol.delta)
beta: [1.63336897 0.9 ]
delta: [-0.36885696 -0.31272648 0.02929022 0.11031872]
FAQs
Package for weighted orthogonal distance regression (ODR).
We found that odrpack demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.
Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.