class_docstr: Trainer of pipeline: MPCA->Feature selection->Classifier
  
  Args:
      classifier (str, optional): Available classifier options: {"svc", "linear_svc", "lr"}, where "svc" trains a
          support vector classifier, supports both linear and non-linear kernels, optimizes with library "libsvm";
          "linear_svc" trains a support vector classifier with linear kernel only, and optimizes with library
          "liblinear", which suppose to be faster and better in handling large number of samples; and "lr" trains
          a classifier with logistic regression. Defaults to "svc".
      classifier_params (dict, optional): Parameters of classifier. Defaults to 'auto'.
      classifier_param_grid (dict, optional): Grids for searching the optimal hyper-parameters. Works only when
          classifier_params == "auto". Defaults to None by searching from the following hyper-parameter values:
          1. svc, {"kernel": ["linear"], "C": [0.0001, 0.001, 0.01, 0.1, 1, 10, 100], "max_iter": [50000]},
          2. linear_svc, {"C": [0.0001, 0.001, 0.01, 0.1, 1, 10, 100]},
          3. lr, {"C": [0.0001, 0.001, 0.01, 0.1, 1, 10, 100]}
      mpca_params (dict, optional): Parameters of MPCA, e.g., {"var_ratio": 0.8}. Defaults to None, i.e., using the
          default parameters (https://pykale.readthedocs.io/en/latest/kale.embed.html#module-kale.embed.mpca).
      n_features (int, optional): Number of features for feature selection. Defaults to None, i.e., all features
          after dimension reduction will be used.
      search_params (dict, optional): Parameters of grid search, for more detail please see
          https://scikit-learn.org/stable/modules/grid_search.html#grid-search . Defaults to None, i.e., using the
          default params: {"cv": 5}.
class_docstr_tok: ["Trainer","of","pipeline",":","MPCA-",">","Feature","selection-",">","Classifier","Args",":","classifier","(","str",",","optional",")",":","Available","classifier","options",":","{","``","svc","''",",","``","linear_svc","''",",","``","lr","''","}",",","where","``","svc","''","trains","a","support","vector","classifier",",","supports","both","linear","and","non-linear","kernels",",","optimizes","with","library","``","libsvm","''",";","``","linear_svc","''","trains","a","support","vector","classifier","with","linear","kernel","only",",","and","optimizes","with","library","``","liblinear","''",",","which","suppose","to","be","faster","and","better","in","handling","large","number","of","samples",";","and","``","lr","''","trains","a","classifier","with","logistic","regression",".","Defaults","to","``","svc","''",".","classifier_params","(","dict",",","optional",")",":","Parameters","of","classifier",".","Defaults","to","'auto","'",".","classifier_param_grid","(","dict",",","optional",")",":","Grids","for","searching","the","optimal","hyper-parameters",".","Works","only","when","classifier_params","==","``","auto","''",".","Defaults","to","None","by","searching","from","the","following","hyper-parameter","values",":","1.","svc",",","{","``","kernel","''",":","[","``","linear","''","]",",","``","C","''",":","[","0.0001",",","0.001",",","0.01",",","0.1",",","1",",","10",",","100","]",",","``","max_iter","''",":","[","50000","]","}",",","2.","linear_svc",",","{","``","C","''",":","[","0.0001",",","0.001",",","0.01",",","0.1",",","1",",","10",",","100","]","}",",","3.","lr",",","{","``","C","''",":","[","0.0001",",","0.001",",","0.01",",","0.1",",","1",",","10",",","100","]","}","mpca_params","(","dict",",","optional",")",":","Parameters","of","MPCA",",","e.g.",",","{","``","var_ratio","''",":","0.8","}",".","Defaults","to","None",",","i.e.",",","using","the","default","parameters","(","https",":","\/\/pykale.readthedocs.io\/en\/latest\/kale.embed.html","#","module-kale.embed.mpca",")",".","n_features","(","int",",","optional",")",":","Number","of","features","for","feature","selection",".","Defaults","to","None",",","i.e.",",","all","features","after","dimension","reduction","will","be","used",".","search_params","(","dict",",","optional",")",":","Parameters","of","grid","search",",","for","more","detail","please","see","https",":","\/\/scikit-learn.org\/stable\/modules\/grid_search.html","#","grid-search",".","Defaults","to","None",",","i.e.",",","using","the","default","params",":","{","``","cv","''",":","5","}","."]
docstr: Probability of each class for the given data x. Not supported by "linear_svc".
  
  Args:
      x (array-like tensor): input data, shape (n_samples, I_1, I_2, ..., I_N)
  
  Returns:
      array-like: probabilities, shape (n_samples, n_class)
docstr_tok: ["Probability","of","each","class","for","the","given","data","x",".","Not","supported","by","``","linear_svc","''",".","Args",":","x","(","array-like","tensor",")",":","input","data",",","shape","(","n_samples",",","I_1",",","I_2",",","...",",","I_N",")","Returns",":","array-like",":","probabilities",",","shape","(","n_samples",",","n_class",")"]
code: def predict_proba(self, x):
      """Probability of each class for the given data x. Not supported by "linear_svc".
  
      Args:
          x (array-like tensor): input data, shape (n_samples, I_1, I_2, ..., I_N)
  
      Returns:
          array-like: probabilities, shape (n_samples, n_class)
      """
      if self.classifier == "linear_svc":
          error_msg = (
              "Linear SVC does not support computing probability."
          )
          logging.error(error_msg)
          raise ValueError(error_msg)
      return self.clf.predict_proba(self._extract_feature(x))
  
file_path: pykale/kale/pipeline/mpca_trainer.py
imports: import logging
  import numpy
  from sklearn.base import BaseEstimator, ClassifierMixin
  from sklearn.feature_selection import f_classif
  from sklearn.linear_model import LogisticRegression
  from sklearn.model_selection import GridSearchCV
  from sklearn.svm import LinearSVC, SVC
  from sklearn.utils.validation import check_is_fitted
  from ..embed.factorization import MPCA
label_desc: Use image node_id 5 for calling the MPCATrainer obj's underlying member method code with example usage: obj.predict_proba(x) and returns: self