oraclesai.pipeline.SpatialPipeline
- class SpatialPipeline(steps, memory=None, verbose=False)
A SpatialPipeline is like a scikit-learn pipeline, but it also can contain spatial estimators which accept a spatial column and may use or compute spatial information such as spatial weights objects. A SpatialPipeline and other composite spatial estimators such as SpatialFeatureUnion and SpatialColumnTransformer, can work directly with a SpatialDataFrame or GeoPandas’ GeoDataFrame and deliver the right information to its steps, that is, spatial data will be passed only to spatial estimators while it will be omitted for regular, non-spatial estimators. In practice a spatial pipeline and other composite spatial estimators look and work exactly as a regular scikit-learn pipeline, except that, for its fit, transform and predict methods (and variations of these methods),
Xparameter can also be of type SpatialDataFrame or GeoPandas GeoDataFrame. Additionally, it accepts a well-defined set of spatial parameters which can be passed to the appropriate spatial estimators in the pipeline.geometries: A 1D array of shapely geometries. Not needed when
Xis a spatial type.crs: A string or PyProj CRS. This information can be extracted from
Xwhen it is a spatial type.spatial_weights_definition: a SpatiaWeightsDefinition object.
spatial_weights: A SpatialWeights object or a PySAL weights object.
spatial_index: A spatial index for geometries.
Methods
__init__(steps[, memory, verbose])add_metric_info(metric_name, result[, ...])decision_function(X, **params)Transform the data, and apply decision_function with the final estimator.
fit(X[, y])Fits all the transformers in the pipeline, one after the other, and finally, calls the
fitmethod of the final estimator.fit_predict(X[, y])Fits all the transformers in the pipeline, one after the other.
fit_transform(X[, y])Fits all the transformers in the pipeline, one after the other.
get_feature_names_out([input_features])Get output feature names for transformation.
get_params([deep])Get parameters for this estimator.
inverse_transform([X, Xt])Apply inverse_transform for each step in a reverse order.
predict(X[, y])Calls the
transformmethod of each transformer in the pipeline.predict_log_proba(X, **params)Transform the data, and apply predict_log_proba with the final estimator.
predict_proba(X, **params)Transform the data, and apply predict_proba with the final estimator.
score(X, y[, sample_weight])Calls the
transformmethod of each transformer in the pipeline.score_samples(X)Transform the data, and apply score_samples with the final estimator.
set_fit_input(X[, geometries, y, ...])set_params()Set the parameters of this estimator.
transform(X[, y])Transforms the data by calling the transform method of each transformer in the pipeline.
Attributes
classes_The classes labels.
feature_names_in_Names of features seen during first step fit method.
metrics_infon_features_in_Number of features seen during first step fit method.
Returns all the steps in the pipeline
named_stepsAccess the steps by name.
predict_input_infopredict_output_infosteps