///|
pub(all) enum RuleCondition {
  RuleCondition(Int, Double, DecisionDirection)
} derive(Eq, Debug)

///|
pub(all) struct ClassificationExplanation {
  prediction : Int
  probabilities : Array[Double]
  confidence : Double
  leaf_id : Int
  leaf_samples : Int
  leaf_impurity : Double
  path : Array[DecisionStep]
} derive(Eq, Debug)

///|
pub(all) struct RegressionExplanation {
  prediction : Double
  leaf_id : Int
  leaf_samples : Int
  leaf_variance : Double
  path : Array[DecisionStep]
} derive(Eq, Debug)

///|
pub(all) struct ClassificationRule {
  leaf_id : Int
  conditions : Array[RuleCondition]
  prediction : Int
  probabilities : Array[Double]
  samples : Int
  impurity : Double
} derive(Eq, Debug)

///|
pub(all) struct RegressionRule {
  leaf_id : Int
  conditions : Array[RuleCondition]
  prediction : Double
  samples : Int
  variance : Double
} derive(Eq, Debug)