19. FFML Score
Command: ffml-score
Kind: Score
The description below is Tetrad’s own, shown in the interface when you select this method. It is reproduced here so that the method is documented; it has not yet been edited for the manual, and it has no “when to use” guidance of the kind the hand-written pages carry.
FFML: Feature-Function Marginal Likelihood score for mixed (continuous + discrete) parents This class extends the continuous FFML (random-feature Gaussian-process marginal likelihood) score to parent sets containing both continuous and discrete variables. The goal is to retain nonlinear flexibility for continuous parents while treating discrete parents via an appropriate categorical kernel, rather than embedding integer-coded levels into a smooth Euclidean geometry. Product-kernel model For parent vector Z = (Z_c, Z_d) with continuous part Z_c and discrete part Z_d, we use a product kernel: k((z_c, z_d), (z’_c, z’_d)) = k_cont(z_c, z’_c) * k_cat(z_d, z’_d) k_cont is an RBF kernel over continuous parents, approximated using Random Fourier Features (RFF) or Orthogonal Random Features (ORF), as in the continuous FFML score. k_cat is a positive semidefinite categorical kernel returning 1 for a level match and ρ for a mismatch (0 ≤ ρ < 1). When ρ=0, this corresponds to independent function draws per joint discrete level; larger ρ induces partial pooling across levels. Feature representation: The product kernel is implemented via an explicit finite feature map. Discrete parents are mapped to a categorical feature block (indexed by joint discrete levels), and continuous parents are mapped via Fourier features. The mixed feature map is the Kronecker product: φ_mix(z_c, z_d) = φ_cat(z_d) ⊗ φ_cont(z_c) This guarantees that inner products in feature space correspond to the product kernel above. For a discrete parent with L levels, the feature dimension is multiplied by L; with multiple discrete parents, the feature space corresponds to their joint level combinations. Scoring objective: The local score for Y | Pa(Y) is the log marginal likelihood of a Bayesian linear model in the random-feature space. This is equivalent to a low-rank Gaussian-process marginal likelihood under the chosen kernel approximation. Computation uses the standard Woodbury reduction to an m×m system (where m is the mixed feature dimension), avoiding formation of an n×n kernel matrix. Bandwidths and preprocessing: Continuous parent columns are globally z-scored. The RBF bandwidth for k_cont is selected using a median pairwise (squared) distance heuristic on continuous parents only (typically via subsampling). If no continuous parents are present, the model reduces to a purely categorical-kernel marginal likelihood. Random-feature generation is deterministic per (target, parent set), enabling stable caching and reproducibility. Practical notes: Intended for mixed data with genuinely categorical (unordered) discrete parents. Feature dimension grows with joint discrete cardinality; runtime scales accordingly. The parameter ρ controls similarity across categorical levels.