Table of contents
- Tempura.Cluster.Kmeans(n_clusters, init, n_jobs, maxiter, tol)
- Tempura.Mixture.GMM(n_components, n_iter, thresh, min_covar)
- Tempura.Decomposition.PCA(n_components, whiten)
- Tempura.CrossDecomposition.CCA(n_components, scale)
- Tempura.Neighbors.KNeighborsClassifier(n_neighbors, algorithm, leaf_size, weights)
- Tempura.LinearModel.LinearRegression(center, normalize, solver)
- Tempura.LinearModel.Lasso(lambda, center, normalize, n_iter, tolerance)
- Tempura.LinearModel.Ridge(lambda, center, normalize, solver, n_iter, tolerance)
- Tempura.LinearModel.Logistic(eta, alpha, center, n_iter)
- Tempura.LinearModel.SGDRegressor(algorithm, n_iter, t_zero, aver)
- Tempura.LinearModel.OnlineLearning.Perceptron(eta, center, n_iter)
- Tempura.LinearModel.OnlineLearnig.PassiveAggressive(C, mode, n_iter)
- Tempura.LinearModel.OnlineLearnig.AdaptiveRegularizationOfWeight(C, center, n_iter)
- Tempura.LinearModel.OnlineLearnig.GaussianHearding(C, center, n_iter)
- Tempura.LinearModel.OnlineLearnig.ConfidenceWeighted(eta, center, n_iter)
- Tempura.LinearModel.OnlineLearnig.SoftConfidenceWeighted(eta, C, center, n_iter)
Tempura.Cluster.Kmeans(n_clusters, init, n_jobs, maxiter, tol)
|
n_clusters : int, default 8, number of clusters init : string, default "kmeans++", algorithm for initialization of clusters. *init should be "kmeans++" or "random". n_jobs : int, default 1. the number of process when calculating k-means. *n_jobs > 1 is not implemented now. maxiter : int, default 300, max iteration of Expectation and Maximization step of EM algorithm. tol : float, default 0.001, convergence criterion. |
fit(X)
|
X : array [n_samples, n_feature], data matrix used for trainig gmm. Each row corresponds to a single data point. |
|
this : instance of GMM, which has fitted parameters. |
Tempura.Mixture.GMM(n_components, n_iter, thresh, min_covar)
|
n_components : int, default 1, the number of components of gmm n_iter : int, default 100, max iteration of Expectation and Maximization step of EM algorithm. thresh : float, default 0.01, convergence criterion. min_covar : float, default 0.01, floor on the diagonal of the covariance matrix to prevent overfitting |
fit(X)
|
X : array [n_samples, n_feature], data matrix used for training gmm. Each row corresponds to a single data point. |
|
this : instance of GMM, which has fitted parameters. |
calcLogLikelihood(X)
|
X : array [n_samples, n_feature], data matrix. |
|
loglikelihood : float, sum of negative log likelihood of given data X. |
showParams()
|
: None |
|
: None |
Tempura.Decomposition.PCA(n_components, whiten)
|
n_components : int, default 1, the number of dimension after reduction whiten : boolean, default false, whether whitening is applied or not |
fit(X)
|
X : array [n_samples, n_feature], data matrix to which dimension reduction is applied. Each row corresponds to a single data point. |
|
this : instance of PCA, which has fitted parameters. |
Tempura.CrossDecomposition.CCA(n_components, scale)
|
n_components : int, default 2, the number of dimension of latent space. normalize : boolean, default true, whether data is centerized and normalized or not |
fit(X,Y)
|
X : array [n_samples, n_features], training samples of domain 1 Y : array [n_samples, n_features], training samples of domain 2 *the number of samples of X and Y should be the same. |
|
this : instance of CCA, which has fitted parameters. |
transform(X,Y)
|
X : array [n_samples, n_features], test samples of domain 1 Y : array [n_samples, n_features], test samples of domain 2. *the number of samples of X and Y should be the same. |
|
X_score : array [n_samples, n_components], samples of domain1 after projection onto latent space. Y_score : array [n_samples, n_components], samples of domain2 after projection onto latent space. |
Tempura.Neighbors.KNeighborsClassifier(n_neighbors, algorithm, leaf_size, weights)
|
n_neightbors : int, default 5, the number of neighbors used to classify algorithm : string, default "auto", algorithm of kNN leaf_size : int, default 30, size of leaf weights : string, default "uniform", weight of neighbors for prediction *weights should be "uniform" or "dist". |
fit(X, y)
|
X : array [n_samples, n_feature], training data matrix. each row corresponds to a single data point. y : array [n_samples, 1], target vector. i-th element corresponds to the target value of i-th data of X. |
|
this : instance of kNN Classifier, which has fitted parameters. |
predict(X)
|
X : array [n_samples, n_feature], data matrix used for prediction. |
|
res : array [n_samples, n_class], (i, j) element corresponds to predicted probability of i-th sample belonging j-th class. |
Tempura.LinearModel.LinearRegression(center, normalize, solver)
|
center : boolean, default true, whether data is centerized or not normalize : boolean, default true, whether data is normalized or not solver : string, default 'qr', solver used to calculate parameter *solver should be "lrqr" or "qr". |
fit(X, y)
|
X : array [n_samples, n_feature], data matrix for training. each row corresponds to a single data point. y : array [n_samples, 1], target vector. i-th element corresponds to the target value of i-th data of X. |
|
this : instance of Ridge Regression, which has fitted parameters. |
predict(X)
|
X : array [n_samples, n_feature], data matrix used for prediction. |
|
pred : array [n_samples, 1], i-th element corresponds to the target value of i-th data of test data. |
Tempura.LinearModel.Lasso(lambda, center, normalize, n_iter, tolerance)
|
lambda : float, default 1.0, constant value to avoid overfitting center : boolean, default true, whether data is centerized or not normalize : boolean, default true, whether data is normalized or not n_iter : int, default 1000, the number of iteration tolerance : int, default 0.0001, convergence criterion of cooridate decent. |
fit(X, y)
|
X : array [n_samples, n_feature], data matrix for training. each row corresponds to a single data point. y : array [n_samples, 1], target vector. i-th element corresponds to the target value of i-th data of X. |
|
this : instance of Ridge Regression, which has fitted parameters. |
predict(X)
|
X : array [n_samples, n_feature], data matrix used for prediction. |
|
pred : array [n_samples, 1], i-th element corresponds to the target value of i-th data of test data. |
Tempura.LinearModel.Ridge(lambda, center, nermalize, solver, n_iter, tolerance)
|
lambda : float, default 1.0, constant value for avoiding overfit center : boolean, default true, whether data is centerized or not normalize : boolean, default true, whether data is normalized or not solver : string, default 'cd', solver used to calculate parameter *solver should be "lrqr" or "cd" (coordinate decent). n_iter : int, default 1000, the number of iterations tolerance : int, default 0.0001, convergence criterion of cooridate decent. |
fit(X, y)
|
X : array [n_samples, n_feature], data matrix for training. Each row corresponds to a single data point. y : array [n_samples, 1], target vector. i-th element corresponds to the target value of i-th data of X. |
|
this : instance of Ridge Regression, which has fitted parameters. |
predict(X)
|
X : array [n_samples, n_feature], data matrix used for prediction. |
|
pred : array [n_samples, 1], i-th element corresponds to the target value of i-th data of test data. |
Tempura.LinearModel.Logistic(eta, alpha, center, n_iter)
|
eta : float, default 0.01, learning rate for delta Error alpha : float, default 0.015, l2-regularization strength center : boolean, default true, whether data is centerized or not *center is not implemented. n_iter : int, default 100, the number of iterations |
fit(X, y)
|
X : array [n_samples, n_feature], data matrix for training. each row corresponds to a single data point. y : array [n_samples, 1], target vector. i-th element corresponds to the target value of i-th data of X. |
|
this : instance of Logistic Regression, which has fitted parameters. |
predict(X)
|
X : array [n_samples, n_feature], data matrix used for prediction. |
|
pred : array [n_samples, 1], i-th element corresponds to the target value of i-th data of test data. |
Tempura.LinearModel.SGDRegressor(algorithm, n_iter, t_zero, aver)
|
algorithm : string, default 'sgdsvm', algorithm for online training *algorithm should be "sgdsvm" or "perceptron". n_iter : int, default 1000, the number of iterations t_zero : float, default 1.0, value to decide step size alpha aver : boolean, default true, whether averaging is used or not |
fit(X, y, init_w)
|
X : array [n_samples, n_feature], data matrix of training samples. Each row corresponds to a single data point. y : array [n_samples, n_class], label matrix of training samples. Each row corresponds to label information of single data. init_w : array [n_feature+1, n_class], initial value of weight parameter |
|
this : instance of Regressor, which has fitted parameters. |
predict(X)
|
X : array [n_samples, n_feature], data matrix used for prediction. |
|
pred : array [n_samples, 1], i-th element corresponds to the target value of i-th data of test data. |
Tempura.LinearModel.OnlineLearning.Perceptron(eta, center, n_iter)
|
eta : float, default 1.0, learning rate center : boolean, default true, whether data is centerized or not n_iter : int, default 100, the number of iterations |
fit(X, y)
|
X : array [n_samples, n_feature], data matrix of training samples. Each row corresponds to a single data point. y : array [n_samples, 1], label vector of training samples. i-th element corresponds to the target value of i-th data of X. |
|
this : instance of Perceptron, which has fitted parameters. |
predict(X)
|
X : array [n_samples, n_feature], data matrix used for prediction. |
|
pred : array [n_samples, 1], i-th element corresponds to the target value of i-th data of test data. |
Tempura.LinearModel.OnlineLearning.PassiveAggressive(C, mode, n_iter)
|
C : float, default 1.0, parameter which controls the influence of the regularization term mode : string, default "PA2", mode of passive aggressive *mode should be "PA1" or "PA2". n_iter : int, default 100, the number of iterations |
fit(X, y)
|
X : array [n_samples, n_feature], data matrix of training samples. Each row corresponds to a single data point. y : array [n_samples, 1], label vector of training samples. i-th element corresponds to the target value of i-th data of X. |
|
this : instance of Perceptron, which has fitted parameters. |
predict(X)
|
X : array [n_samples, n_feature], data matrix used for prediction. |
|
pred : array [n_samples, 1], i-th element corresponds to the target value of i-th data of test data. |
Tempura.LinearModel.OnlineLearning.AdaptiveRegularizationOfWeight(C, mode, n_iter)
|
C : float, default 0.1, parameter which controls the influence of the regularization term center : boolean, default true, whether data is centerized or not n_iter : int, default 100, the number of iterations |
fit(X, y)
|
X : array [n_samples, n_feature], data matrix of training samples. Each row corresponds to a single data point. y : array [n_samples, 1], label vector of training samples. i-th element corresponds to the target value of i-th data of X. |
|
this : instance of Perceptron, which has fitted parameters. |
predict(X)
|
X : array [n_samples, n_feature], data matrix used for prediction. |
|
pred : array [n_samples, 1], i-th element corresponds to the target value of i-th data of test data. |
Tempura.LinearModel.OnlineLearning.GaussianHearding(C, center, n_iter)
|
C : float, default 0.1, parameter which controls the influence of the regularization term center : boolean, default true, whether data is centerized or not n_iter : int, default 100, the number of iterations |
fit(X, y)
|
X : array [n_samples, n_feature], data matrix of training samples. Each row corresponds to a single data point. y : array [n_samples, 1], label vector of training samples. i-th element corresponds to the target value of i-th data of X. |
|
this : instance of Perceptron, which has fitted parameters. |
predict(X)
|
X : array [n_samples, n_feature], data matrix used for prediction. |
|
pred : array [n_samples, 1], i-th element corresponds to the target value of i-th data of test data. |
Tempura.LinearModel.OnlineLearning.ConfidenceWeighted(eta, center, n_iter)
|
eta : float, default 0.9, probability that the sample is correctly classified center : boolean, default true, whether data is centerized or not n_iter : int, default 100, the number of iterations |
fit(X, y)
|
X : array [n_samples, n_feature], data matrix of training samples. Each row corresponds to a single data point. y : array [n_samples, 1], label vector of training samples. i-th element corresponds to the target value of i-th data of X. |
|
this : instance of Perceptron, which has fitted parameters. |
predict(X)
|
X : array [n_samples, n_feature], data matrix used for prediction. |
|
pred : array [n_samples, 1], i-th element corresponds to the target value of i-th data of test data. |
Tempura.LinearModel.OnlineLearning.SoftConfidenceWeighted(eta, C, center, n_iter)
|
eta : float, default 0.9, probability that the sample is correctly classified C : float, default 0.1, parameter which controls the influence of the regularization term center : boolean, default true, whether data is centerized or not n_iter : int, default 100, the number of iterations |
fit(X, y)
|
X : array [n_samples, n_feature], data matrix of training samples. Each row corresponds to a single data point. y : array [n_samples, 1], label vector of training samples. i-th element corresponds to the target value of i-th data of X. |
|
this : instance of Perceptron, which has fitted parameters. |
predict(X)
|
X : array [n_samples, n_feature], data matrix used for prediction. |
|
pred : array [n_samples, 1], i-th element corresponds to the target value of i-th data of test data. |