ballet.validation.feature_acceptance.validator module

class ballet.validation.feature_acceptance.validator.AlwaysAccepter(X_df, y_df, X_df_val, y_val, features, candidate_feature)[source]

Bases: ballet.validation.base.FeatureAccepter

judge()[source]

Judge whether feature should be accepted

class ballet.validation.feature_acceptance.validator.CompoundAccepter(*args, agg='all', specs=[])[source]

Bases: ballet.validation.base.FeatureAccepter

A compound accepter that runs a list of individual accepters

An accepter spec is just a simple serialization of a class and its kwargs:

name: ballet.validation.feature_acceptance.validator.CompoundAccepter
params:
  agg: any
  specs:
    - name: ballet.validation.feature_acceptance.validator.VarianceThresholdAccepter
      params:
        threshold: 0.1
    - name: ballet.validation.feature_acceptance.validator.MutualInformationAccepter
      params:
        threshold: 0.1
Parameters
  • agg – one of 'all' or 'any'; whether to accept if all underlying accepters accept or if any accepter accepts.

  • specs (List[dict]) – list of dicts of accepter specs

judge()[source]

Judge whether feature should be accepted

class ballet.validation.feature_acceptance.validator.GFSSFAccepter(*args, lmbda_1=0.0, lmbda_2=0.0, lambda_1_adjustment=64, lambda_2_adjustment=64)[source]

Bases: ballet.validation.base.FeatureAcceptanceMixin, ballet.validation.gfssf.GFSSFPerformanceEvaluator

judge()[source]

Judge feature acceptance using GFSSF

Uses lines 1-8 of agGFSSF where we do not remove accepted but redundant features on line 8.

class ballet.validation.feature_acceptance.validator.MutualInformationAccepter(*args, threshold=0.05, handle_nan_targets='fail')[source]

Bases: ballet.validation.base.FeatureAccepter

Accept features with mutual information with the target above a threshold

Parameters
  • threshold – mutual information threshold

  • handle_nan_targets – one of 'fail' or 'ignore', whether to fail validation if NaN-valued targets are discovered or to drop those rows in calculation of the mutual information score

judge()[source]

Judge whether feature should be accepted

class ballet.validation.feature_acceptance.validator.NeverAccepter(X_df, y_df, X_df_val, y_val, features, candidate_feature)[source]

Bases: ballet.validation.base.FeatureAccepter

judge()[source]

Judge whether feature should be accepted

class ballet.validation.feature_acceptance.validator.RandomAccepter(*args, p=0.3, seed=None)[source]

Bases: ballet.validation.base.FeatureAcceptanceMixin, ballet.validation.common.RandomFeaturePerformanceEvaluator

judge()[source]

Accept feature with probability p

class ballet.validation.feature_acceptance.validator.VarianceThresholdAccepter(*args, threshold=0.05)[source]

Bases: ballet.validation.base.FeatureAccepter

Accept features with variance above a threshold

Parameters

threshold – variance threshold

judge()[source]

Judge whether feature should be accepted