perpetual 2.1.0

A self-generalizing gradient boosting machine that doesn't need hyperparameter optimization
Documentation
//! Constraints
//!
//! This module handles monotonicity and interaction constraints, which allow for
//! incorporating domain knowledge into the model.
use serde::{Deserialize, Serialize};
use std::collections::HashMap;

/// Monotonicity constraint for a feature.
#[derive(Debug, Deserialize, Serialize, Clone, Copy)]
pub enum Constraint {
    /// Constrain the relationship to be monotonically increasing.
    Positive,
    /// Constrain the relationship to be monotonically decreasing.
    Negative,
    /// No monotonicity constraint.
    Unconstrained,
}

/// A map covering the constraints for each feature, key is the feature index.
pub type ConstraintMap = HashMap<usize, Constraint>;