class_docstr: DropCorrelatedFeatures() finds and removes correlated features. Correlation is
  calculated with `pandas.corr()`. Features are removed on first found first removed
  basis, without any further insight.
  
  DropCorrelatedFeatures() works only with numerical variables. Categorical variables
  will need to be encoded to numerical or will be excluded from the analysis.
  
  More details in the :ref:`User Guide <drop_correlated>`.
  
  Parameters
  ----------
  {variables}
  
  method: string or callable, default='pearson'
      Can take 'pearson', 'spearman', 'kendall' or callable. It refers to the
      correlation method to be used to identify the correlated features.
  
      - 'pearson': standard correlation coefficient
      - 'kendall': Kendall Tau correlation coefficient
      - 'spearman': Spearman rank correlation
      - callable: callable with input two 1d ndarrays and returning a float.
  
      For more details on this parameter visit the  `pandas.corr()` documentation.
  
  threshold: float, default=0.8
      The correlation threshold above which a feature will be deemed correlated with
      another one and removed from the dataset.
  
  {missing_values}
  
  {confirm_variables}
  
  Attributes
  ----------
  features_to_drop_:
      Set with the correlated features that will be dropped.
  
  correlated_feature_sets_:
      Groups of correlated features. Each list is a group of correlated features.
  
  {variables_}
  
  {feature_names_in_}
  
  {n_features_in_}
  
  Methods
  -------
  fit:
      Find correlated features.
  
  {fit_transform}
  
  {get_support}
  
  transform:
      Remove correlated features.
  
  Notes
  -----
  If you want to select from each group of correlated features those that are perhaps
  more predictive or more complete, check Feature-engine's SmartCorrelationSelection.
  
  See Also
  --------
  pandas.corr
  feature_engine.selection.SmartCorrelationSelection
class_docstr_tok: ["DropCorrelatedFeatures","(",")","finds","and","removes","correlated","features",".","Correlation","is","calculated","with","`","pandas.corr","(",")","`",".","Features","are","removed","on","first","found","first","removed","basis",",","without","any","further","insight",".","DropCorrelatedFeatures","(",")","works","only","with","numerical","variables",".","Categorical","variables","will","need","to","be","encoded","to","numerical","or","will","be","excluded","from","the","analysis",".","More","details","in","the",":","ref",":","`","User","Guide","<","drop_correlated",">","`",".","Parameters","--","--","--","--","--","{","variables","}","method",":","string","or","callable",",","default='pearson'","Can","take","'pearson","'",",","'spearman","'",",","'kendall","'","or","callable",".","It","refers","to","the","correlation","method","to","be","used","to","identify","the","correlated","features",".","-","'pearson","'",":","standard","correlation","coefficient","-","'kendall","'",":","Kendall","Tau","correlation","coefficient","-","'spearman","'",":","Spearman","rank","correlation","-","callable",":","callable","with","input","two","1d","ndarrays","and","returning","a","float",".","For","more","details","on","this","parameter","visit","the","`","pandas.corr","(",")","`","documentation",".","threshold",":","float",",","default=0.8","The","correlation","threshold","above","which","a","feature","will","be","deemed","correlated","with","another","one","and","removed","from","the","dataset",".","{","missing_values","}","{","confirm_variables","}","Attributes","--","--","--","--","--","features_to_drop_",":","Set","with","the","correlated","features","that","will","be","dropped",".","correlated_feature_sets_",":","Groups","of","correlated","features",".","Each","list","is","a","group","of","correlated","features",".","{","variables_","}","{","feature_names_in_","}","{","n_features_in_","}","Methods","--","--","--","-","fit",":","Find","correlated","features",".","{","fit_transform","}","{","get_support","}","transform",":","Remove","correlated","features",".","Notes","--","--","-","If","you","want","to","select","from","each","group","of","correlated","features","those","that","are","perhaps","more","predictive","or","more","complete",",","check","Feature-engine","'s","SmartCorrelationSelection",".","See","Also","--","--","--","--","pandas.corr","feature_engine.selection.SmartCorrelationSelection"]
code: def __init__(
      self,
      variables: Variables = None,
      method: str = "pearson",
      threshold: float = 0.8,
      missing_values: str = "ignore",
      confirm_variables: bool = False,
  ):
      if (
          not isinstance(threshold, float)
          or threshold < 0
          or threshold > 1
      ):
          raise ValueError("threshold must be a float between 0 and 1")
  
      if missing_values not in ["raise", "ignore"]:
          raise ValueError(
              "missing_values takes only values 'raise' or 'ignore'."
          )
  
      super().__init__(confirm_variables)
  
      self.variables = _check_init_parameter_variables(variables)
      self.method = method
      self.threshold = threshold
      self.missing_values = missing_values
  
file_path: feature_engine/feature_engine/selection/drop_correlated_features.py
imports: from typing import List, Union
  import pandas
  from feature_engine._docstrings.fit_attributes import _feature_names_in_docstring, _n_features_in_docstring
  from feature_engine._docstrings.methods import _fit_transform_docstring
  from feature_engine._docstrings.substitute import Substitution
  from feature_engine._variable_handling.init_parameter_checks import _check_init_parameter_variables
  from feature_engine._variable_handling.variable_type_selection import _find_or_check_numerical_variables
  from feature_engine.dataframe_checks import _check_contains_inf, _check_contains_na, check_X
  from feature_engine.selection._docstring import _get_support_docstring, _missing_values_docstring, _variables_attribute_docstring, _variables_numerical_docstring
  from feature_engine.selection.base_selector import BaseSelector
label_desc: Use image node_id 1 to create a new DropCorrelatedFeatures object from inherited base classes: BaseSelector with example: obj = DropCorrelatedFeatures(variables, method, threshold, missing_values, confirm_variables)