Example #1
0
    def __init__(self, sample, **kwargs):
        r"""
        See ``SVMClassificationAlgorithm`` for full documentation.

        """

        LearningAlgorithm.__init__(self, sample)
        check_svm_classification_sample(sample)
        self.sample = sample
        self.model = None

        try:
            self.c = kwargs['c']
        except KeyError:
            self.c = float('inf')

        try:
            self.kernel = kwargs['kernel']
        except KeyError:
            self.kernel = LinearKernel()

        try:
            self.solver = kwargs['solver']
        except KeyError:
            #self.solver = CVXOPTClassificationSolver(*args, **kwargs)
            self.solver = SVMClassificationAlgorithm.default_solver
Example #2
0
    def __init__(self, sample, **kwargs):
        r"""
        See ``PerceptronAlgorithm`` for full documentation.

        """

        try:
            self.threshold = kwargs["threshold"]
        except KeyError:
            self.threshold = True
        self.model = None

        LearningAlgorithm.__init__(self, sample)
        self.reset(**kwargs)