This documentation was automatically generated using the source code’s included docstrings.
MinCq learning algorithm
Related papers: [1] From PAC-Bayes Bounds to Quadratic Programs for Majority Votes (Laviolette et al., 2011) [2] Risk Bounds for the Majority Vote: From a PAC-Bayesian Analysis to a Learning Algorithm (Germain et al., 2014)
http://graal.ift.ulaval.ca/majorityvote/
MinCq algorithm learner. See [1, 2]
Parameters: | mu : float
voters_type : string, optional (default=’kernel’)
n_stumps_per_attribute : int, optional (default=10)
kernel : string, optional (default=’rbf’)
degree : int, optional (default=3)
gamma : float, optional (default=0.0)
|
---|
Methods
Learn a majority vote weights using MinCq.
Parameters: | X : ndarray, shape=(n_samples, n_features)
y : ndarray, shape=(n_samples,), optional
|
---|
Using previously learned majority vote weights, predict the labels of new data points.
Parameters: | X : ndarray, shape=(n_samples, n_features)
|
---|---|
Returns: | predictions : ndarray, shape=(n_samples,)
|
Using previously learned majority vote weights, predict the labels of new data points with a confidence level. The confidence level is the margin of the majority vote.
Parameters: | X : ndarray, shape=(n_samples, n_features)
|
---|---|
Returns: | predictions : ndarray, shape=(n_samples,)
|
A Majority Vote of real-valued functions.
Parameters: | voters : ndarray of Voter instances
weights : ndarray, optional (default: uniform distribution)
|
---|
Attributes
Methods
Returns the classification matrix of the majority vote.
Parameters: | X : ndarray, shape=(n_samples, n_features)
|
---|---|
Returns: | classification_matrix : ndrray, shape=(n_samples, n_voters)
|
A Binary Kernel Voter, which outputs the value of a kernel function whose first example is fixed a priori. The sign of the output depends on the label (-1 or 1) of the sample on which the kernel voter is based
Parameters: | x : ndarray, shape=(n_features,)
y : int, -1 or 1
kernel_function : function
kwargs : keyword arguments (optional)
|
---|
Methods
Generic Attribute Threshold Binary Classifier
Parameters: | attribute_index : int
threshold : float
direction : int (-1 or 1)
|
---|
Methods
Utility function to create binary kernel voters for each (x, y) sample.
Parameters: | kernel_function : function
kwargs : keyword arguments (optional)
|
---|
Methods
Decision Stumps Voters generator.
Parameters: | n_stumps_per_attribute : int, (default=10)
|
---|
Methods
Base class for a voter (function X -> [-1, 1]), where X is an array of samples
Methods
Base class to create a set of voters using training samples
Methods
Generates the voters using samples.
Parameters: | X : ndarray, shape=(n_samples, n_features)
y : ndarray, shape=(n_samples,), optional
self_complemented : bool
|
---|---|
Returns: | voters : ndarray
|