skimage 0.17.2

AttributesBackRef

Attributes

params : tuple

Line model parameters in the following order :None:None:`origin`, :None:None:`direction`.

In contrast to ordinary least squares line estimation, this estimator minimizes the orthogonal distances of points to the estimated line.

Lines are defined by a point (origin) and a unit vector (direction) according to the following vector equation:

X = origin + lambda * direction

Total least squares estimator for N-dimensional lines.

Examples

This example is valid syntax, but we were not able to check execution
>>> x = np.linspace(1, 2, 25)
... y = 1.5 * x + 3
... lm = LineModelND()
... lm.estimate(np.array([x, y]).T) True
This example is valid syntax, but we were not able to check execution
>>> tuple(np.round(lm.params, 5))
(array([1.5 , 5.25]), array([0.5547 , 0.83205]))
This example is valid syntax, but we were not able to check execution
>>> res = lm.residuals(np.array([x, y]).T)
... np.abs(np.round(res, 9)) array([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.])
This example is valid syntax, but we were not able to check execution
>>> np.round(lm.predict_y(x[:5]), 3)
array([4.5  , 4.562, 4.625, 4.688, 4.75 ])
This example is valid syntax, but we were not able to check execution
>>> np.round(lm.predict_x(y[:5]), 3)
array([1.   , 1.042, 1.083, 1.125, 1.167])
See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

skimage.measure.fit.LineModelND

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


File: /skimage/measure/fit.py#29
type: <class 'type'>
Commit: