# Path: core/kover/learning/common/models.py
# class BaseModel(object):
# class CARTModel(BaseModel):
# class SCMModel(BaseModel):
# class ConjunctionModel(SCMModel):
# class DisjunctionModel(SCMModel):
#     def __init__(self):
#     def predict(self, X):
# 	def predict_proba(self, X):
#     def learner(self):
#     def __str__(self):
#     def __init__(self, class_tags=None):
#     def predict(self, X):
#     def predict_proba(self, X):
#     def learner(self):
#     def _to_string(self, node=None,depth=0):
#     def __len__(self):
#     def depth(self):
#     def __init__(self):
#     def add(self, rule):
#     def predict(self, X):
#     def predict_proba(self, X):
#     def remove(self, index):
#     def example_dependencies(self):
#     def learner(self):
#     def type(self):
#     def _to_string(self, separator=" "):
#     def __eq__(self, other):
#     def __iter__(self):
#     def __len__(self):
#     def predict_proba(self, X):
#     def type(self):
#     def __str__(self):
#     def predict_proba(self, X):
#     def type(self):
#     def __str__(self):
# 
# Path: core/kover/utils.py
# def _class_to_string(instance):
#     """
#     Returns a string representation of the public attributes of a class.
#     
#     Parameters:
#     -----------
#     instance: object
#         An instance of any class.
#         
#     Returns:
#     --------
#     string_rep: string
#         A string representation of the class and its public attributes.
#         
#     Notes:
#     -----
#     Private attributes must be marked with a leading underscore.
#     """
#     return instance.__class__.__name__ + "(" + ",".join(
#         [str(k) + "=" + str(v) for k, v in instance.__dict__.iteritems() if str(k[0]) != "_"]) + ")"


import logging
import numpy as np
from math import ceil
from ..common.models import scm, conjunction, ConjunctionModel, disjunction, DisjunctionModel
from ...utils import _class_to_string

        if not self._flags.get("PROBABILISTIC_PREDICTIONS", False):
            raise RuntimeError("The predictor does not support probabilistic predictions.")

        return self.model.predict_proba(X)

    def __str__(self):
        return _class_to_string(self)


class SetCoveringMachine(BaseSetCoveringMachine):
    """
    The Set Covering Machine (SCM).
    Marchand, M., & Taylor, J. S. (2003). The set covering machine. Journal of Machine Learning Research, 3, 723–746.
    Parameters:
    -----------
    model_type: pyscm.model.conjunction or pyscm.model.disjunction, default=pyscm.model.conjunction
        The type of model to be built.
    p: float, default=1.0
        A parameter to control the importance of making prediction errors on positive examples in the utility function.
    max_rules: int, default=10
        The maximum number of binary rules to include in the model.
    verbose: bool, default=False
        Sets verbose mode on/off.
    """

    def __init__(self, model_type=conjunction, p=1.0, max_rules=10):
        super(SetCoveringMachine, self).__init__(model_type=model_type, max_rules=max_rules)

        if model_type == conjunction:

# Path: core/kover/learning/common/models.py
# class BaseModel(object):
# class CARTModel(BaseModel):
# class SCMModel(BaseModel):
# class ConjunctionModel(SCMModel):
# class DisjunctionModel(SCMModel):
#     def __init__(self):
#     def predict(self, X):
# 	def predict_proba(self, X):
#     def learner(self):
#     def __str__(self):
#     def __init__(self, class_tags=None):
#     def predict(self, X):
#     def predict_proba(self, X):
#     def learner(self):
#     def _to_string(self, node=None,depth=0):
#     def __len__(self):
#     def depth(self):
#     def __init__(self):
#     def add(self, rule):
#     def predict(self, X):
#     def predict_proba(self, X):
#     def remove(self, index):
#     def example_dependencies(self):
#     def learner(self):
#     def type(self):
#     def _to_string(self, separator=" "):
#     def __eq__(self, other):
#     def __iter__(self):
#     def __len__(self):
#     def predict_proba(self, X):
#     def type(self):
#     def __str__(self):
#     def predict_proba(self, X):
#     def type(self):
#     def __str__(self):
# 
# Path: core/kover/utils.py
# def _class_to_string(instance):
#     """
#     Returns a string representation of the public attributes of a class.
#     
#     Parameters:
#     -----------
#     instance: object
#         An instance of any class.
#         
#     Returns:
#     --------
#     string_rep: string
#         A string representation of the class and its public attributes.
#         
#     Notes:
#     -----
#     Private attributes must be marked with a leading underscore.
#     """
#     return instance.__class__.__name__ + "(" + ",".join(
#         [str(k) + "=" + str(v) for k, v in instance.__dict__.iteritems() if str(k[0]) != "_"]) + ")"


# Path: core/kover/learning/learners/scm.py
import logging
import numpy as np
from math import ceil
from ..common.models import scm, conjunction, ConjunctionModel, disjunction, DisjunctionModel
from ...utils import _class_to_string


        if not self._flags.get("PROBABILISTIC_PREDICTIONS", False):
            raise RuntimeError("The predictor does not support probabilistic predictions.")

        return self.model.predict_proba(X)

    def __str__(self):
        return _class_to_string(self)


class SetCoveringMachine(BaseSetCoveringMachine):
    """
    The Set Covering Machine (SCM).
    Marchand, M., & Taylor, J. S. (2003). The set covering machine. Journal of Machine Learning Research, 3, 723–746.
    Parameters:
    -----------
    model_type: pyscm.model.conjunction or pyscm.model.disjunction, default=pyscm.model.conjunction
        The type of model to be built.
    p: float, default=1.0
        A parameter to control the importance of making prediction errors on positive examples in the utility function.
    max_rules: int, default=10
        The maximum number of binary rules to include in the model.
    verbose: bool, default=False
        Sets verbose mode on/off.
    """

    def __init__(self, model_type=conjunction, p=1.0, max_rules=10):
        super(SetCoveringMachine, self).__init__(model_type=model_type, max_rules=max_rules)

        if model_type == conjunction:

            self.model = ConjunctionModel()