Prediction
Classes to perform multidiversity index prediction.
BaseDataManager(*args, **kwargs)
¶
Bases: niva.core.mixins.QgsLogicMixin
Base class for data management. Contain layers to extract features needed for computation.
Source code in niva/core/prediction/data_manager.py
28 29 | |
crs
property
¶
Return CRS of data.
compute_metrics()
abstractmethod
¶
Compute metrics from data layers and output results as Sample. Sample will not have mdi, novelty & branch informations.
Source code in niva/core/prediction/data_manager.py
40 41 42 | |
filter_iacs(layer)
¶
Filter IACS on Niva.ID fields.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
layer
|
qgis.core.QgsVectorLayer
|
IACS layer. |
required |
Returns:
| Type | Description |
|---|---|
qgis.core.QgsVectorLayer
|
Filtered IACS. |
Source code in niva/core/prediction/data_manager.py
44 45 46 47 48 49 50 51 52 53 54 55 56 | |
GridDataManager(grid, *args, **kwargs)
¶
Bases: niva.core.prediction.data_manager.BaseDataManager
DataManager for grid based predictor.
Source code in niva/core/prediction/data_manager.py
67 68 69 | |
compute_metrics(cell)
abstractmethod
¶
Compute cell metrics from data layers and output results as Sample. Sample will not have mdi, novelty & branch informations.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cell
|
qgis.core.QgsGeometry
|
Cell to compute metrics on. |
required |
Returns:
| Type | Description |
|---|---|
niva.core.samples.sample.Sample
|
Sample of variables. |
Source code in niva/core/prediction/data_manager.py
71 72 73 74 75 76 77 78 79 80 81 | |
__getitem__(x)
¶
Get feature from self.grid or use passed feature to compute metrics on a Sample.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
int
|
Grids feature id or QgsFeature. |
required |
Returns:
| Type | Description |
|---|---|
niva.core.samples.sample.Sample
|
Sample corresponding to cell geometry. |
Source code in niva/core/prediction/data_manager.py
124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 | |
T1GridDataManager(grid, iacs, artificial, naa=None, *args, **kwargs)
¶
Bases: niva.core.prediction.data_manager.GridDataManager
Data manager for Contra Tier 1 with grid based predictions.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
iacs
|
qgis.core.QgsVectorLayer
|
Layer of IACS data. Warning: Provide IACS with Niva.ID field. |
required |
artificial
|
qgis.core.QgsVectorLayer
|
Layer of artificial data. |
required |
naa
|
qgis.core.QgsVectorLayer
|
Layer of NAA data. |
None
|
Attributes:
| Name | Type | Description |
|---|---|---|
iacs |
qgis.core.QgsVectorLayer
|
Layer of IACS data. |
artificial |
qgis.core.QgsVectorLayer
|
Layer of artificial data. |
naa |
typing.Union[qgis.core.QgsVectorLayer, None]
|
Layer of NAA data or None if not passed to constructor. |
iacs_index |
qgis.core.QgsSpatialIndex
|
Spatial index for layer iacs. |
artificial_index |
qgis.core.QgsSpatialIndex
|
Spatial index for layer artificial. |
naa_index |
qgis.core.QgsSpatialIndex
|
Spatial index for layer naa. |
Source code in niva/core/prediction/data_manager.py
167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 | |
compute_metrics(cell)
¶
Compute metrics and build Sample for cell.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cell
|
qgis.core.QgsGeometry
|
Cell geometry to compute metric on. |
required |
Returns:
| Type | Description |
|---|---|
niva.core.samples.sample.T1Sample
|
Tier 1 sample for cell. |
Source code in niva/core/prediction/data_manager.py
224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 | |