features¶
- class
polygon_classification.features.
Features
[source]¶This class builds features regarding polygon properties.
See also
compute_features()
Details on the implemented features.
build
(X)[source]¶Build features and return them as an ndarray of floats.
- Parameters
X (array-like or sparse matrix, shape = [n_samples, n_features]) – The train/test input samples.
- Returns
fX – The computed features to use as input to ML classifiers.
- Return type
ndarray
compute_features
(poly1, poly2)[source]¶This method builds an ndarray of the following features:
- core: basic geometric attributes, i.e.,
area of each polygon,
percentage of coverage/intersection area per polygon,
perimeter of each polygon,
number of corners of each polygon,
average edges’ length per corner of each polygon,
variance of edges’ length per corner of each polygon,
- extra: compute additional features on setting
extra_features
toTrue
, i.e.,
area of of each polygon convex hull,
percentage of coverage/intersection of convex hull area per polygon,
distance of centroids of polygons
- Parameters
poly1, poly2 (str) – Input geometric objects, i.e., shapely Polygons.
- Returns
It returns a list (vector) of features.
- Return type
list