`L iddZddZy)Ncn|ft|dr1t|jdr|jj}nEt|jdDcgc]}d| }}nt|dr|j}t t |t |k7r td|Scc}w)a(Check feature names. Parameters ---------- X : array-like of shape (n_samples, n_features) Input data. feature_names : None or array-like of shape (n_names,), dtype=str Feature names to check or `None`. Returns ------- feature_names : list of str Feature names validated. If `feature_names` is `None`, then a list of feature names is provided, i.e. the column names of a pandas dataframe or a generic list of feature names (e.g. `["x0", "x1", ...]`) for a NumPy array. columnstolistxz,feature_names should not contain duplicates.)hasattrrrrangeshapelenset ValueError)X feature_namesis b/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/sklearn/inspection/_pd_utils.py_check_feature_namesrs& 1i WQYY%AII,,.M/4AGGAJ.?@qW@M@  )%,,.  3} #m"44GHH As B2ct|tr#|td|d |j|S|S#t$r}td|d|d}~wwxYw)aGet feature index. Parameters ---------- fx : int or str Feature index or name. feature_names : list of str, default=None All feature names from which to search the indices. Returns ------- idx : int Feature index. Nz+Cannot plot partial dependence for feature z since the list of feature names was not provided, neither as column names of a pandas data-frame nor via the feature_names parameter.zFeature z not in feature_names) isinstancestrr index)fxres r_get_feature_indexr(s| "c  =bVD   L &&r* * I Lxv-BCD! K Ls6 AAA)N)rrrrs Fr