class_docstr: Modality that contains features in general
  
  Parameters
  ----------
  features: numpy.ndarray or scipy.sparse.csr_matrix, default = None
      Numpy 2d-array that the row indices are aligned with user/item in `ids`.
  
  ids: List, default = None
      List of user/item ids that the indices are aligned with `corpus`.
      If None, the indices of provided `features` will be used as `ids`.
  
  normalized: bool, default = False
      Whether the features will be normalized using min-max normalization.
class_docstr_tok: ["Modality","that","contains","features","in","general","Parameters","--","--","--","--","--","features",":","numpy.ndarray","or","scipy.sparse.csr_matrix",",","default","=","None","Numpy","2d-array","that","the","row","indices","are","aligned","with","user\/item","in","`","ids","`",".","ids",":","List",",","default","=","None","List","of","user\/item","ids","that","the","indices","are","aligned","with","`","corpus","`",".","If","None",",","the","indices","of","provided","`","features","`","will","be","used","as","`","ids","`",".","normalized",":","bool",",","default","=","False","Whether","the","features","will","be","normalized","using","min-max","normalization","."]
code: def _swap_feature(self, id_map):
      new_feats = np.copy(self.features)
      new_ids = self.ids.copy()
      for old_idx, raw_id in enumerate(self.ids):
          new_idx = id_map.get(raw_id, None)
          if new_idx is None:
              continue
          assert new_idx < new_feats.shape[0]
          new_feats[new_idx] = self.features[old_idx]
          new_ids[new_idx] = raw_id
      self.features = new_feats
      self.ids = new_ids
  
file_path: cornac/cornac/data/modality.py
imports: import numpy
label_desc: Use image node_id 5 for calling the FeatureModality obj's underlying member method code with example usage: obj._swap_feature(id_map) without return types