watex.utils.projection_validator#
- watex.utils.projection_validator(X, Xt=None, columns=None)[source]#
Retrieve x, y coordinates of a datraframe ( X, Xt ) from columns names or indexes.
If X or Xt are given as arrays, columns may hold integers from selecting the the coordinates ‘x’ and ‘y’.
- Parameters
X (Ndarray ( M x N matrix where
M=m-samples, &N=n-features)) – training set; Denotes data that is observed at training and prediction time, used as independent variables in learning. The notation is uppercase to denote that it is ordinarily a matrix. When a matrix, each sample may be represented by a feature vector, or a vector of precomputed (dis)similarity with each training sample.Xt (Ndarray ( M x N matrix where
M=m-samples, &N=n-features)) – Shorthand for “test set”; data that is observed at testing and prediction time, used as independent variables in learning. The notation is uppercase to denote that it is ordinarily a matrix.columns (list of str or index, optional) – columns is usefull when a dataframe is given with a dimension size greater than 2. If such data is passed to X or Xt, columns must hold the name to consider as ‘easting’, ‘northing’ when UTM coordinates are given or ‘latitude’ , ‘longitude’ when latlon are given. If dimension size is greater than 2 and columns is None , an error will raises to prevent the user to provide the index for ‘y’ and ‘x’ coordinated retrieval.
- Returns
arrays and coordinate labels
- Return type
( x, y, xt, yt ), (xname, yname, xtname, ytname), Tuple of coordinate