watex.methods.hydro.MXS.makeyMXS#
- MXS.makeyMXS(y_pred=None, func=None, categorize_k=False, default_func=False, **mxs_kws)[source]#
Construct the MXS target \(y*\)
- Parameters:
y_pred (Array-like 1d, pandas.Series) –
Array composing the valid NGA labels. Note that NGA labels is a predicted labels mostly using the unsupervising learning.
- seealso:
predict_NGA_labels()for further details.
func (callable) – Function to specifically map the permeability coefficient column in the dataframe of serie. If not given, the default function can be enabled instead from param default_func.
string (bool,) – If set to “True”, categorized map from ‘k’ should be prefixed by “k”. However is string value is given , the prefix is changed according to this label.
default_ufunc (bool,) –
- Default function for mapping k is setting to
True. Note that, this could probably not fitted your own data. So it is recommended to provide your own function for mapping ‘k’. However the default ‘k’ mapping is given as follow:
k0 {0}: k = 0
k1 {1}: 0 < k <= .01
k2 {2}: .01 < k <= .07
k3 {3}: k> .07
- mxs_kws:dict,
Additional keyword arguments passed to
make_MXS_labels().
- Default function for mapping k is setting to
- Returns:
MXS.mxs_labels_ – array like of MXS labels
- Return type:
array-like 1d `
Example
>>> from watex.datasets import load_hlogs >>> from watex.methods.hydro import MXS >>> hdata = load_hlogs ().frame >>> # drop the 'remark' columns since there is no valid data >>> hdata.drop (columns ='remark', inplace=True) >>> mxs =MXS (kname ='k').fit(hdata) # specify the 'k'columns >>> # we can predict the NGA labels and yMXS with single line >>> # of code snippet using the default 'k' classification. >>> ymxs = mxs.predictNGA().makeyMXS(categorize_k=True, default_func=True) >>> mxs.yNGA_[:7] ... array([2, 2, 2, 2, 2, 2, 2]) >>> ymxs[:7] Out[40]: array([22, 22, 22, 22, 22, 22, 22]) >>> mxs.mxs_group_classes_ Out[56]: {1: 1, 2: 22, 3: 3} # transform classes >>> mxs.mxs_group_labels_ Out[57]: (2,) >>> # **comment: # # only the label '2' is tranformed to '22' since # it is the only one that has similariry with the true label 2