code: def variance_feature_selection(
      train_set: pd.DataFrame,
      features: List[str],
      threshold: float = 0.0,
  ) -> LogType:
      """
      Feature selection based on variance
  
      Parameters
      ----------
      train_set : pd.DataFrame
          A Pandas' DataFrame with the training data
  
      features : list of str
          The list of features to consider when dropping with variance
  
      threshold : float
          The variance threshold. Will drop features with variance equal or
          bellow this threshold
  
      Returns
      ----------
      log with feature variance, features to drop and final features
      """
  
      feature_var = train_set[features].var()
  
      features_to_drop = feature_var[
          feature_var <= threshold
      ].index.tolist()
  
      final_features = list(set(features) - set(features_to_drop))
  
      return {
          "feature_var": feature_var.to_dict(),
          "features_to_drop": features_to_drop,
          "final_features": final_features,
      }
  
imports: from typing import List
  import pandas
  from numpy import tril
  from toolz import curry
  from fklearn.types import LogType
label_desc: Use image node_id 2 for calling a global function with example usage: variance_feature_selection(train_set, features, threshold) and returns: dict