Home | Trees | Indices | Help |
---|
|
object --+ | BaseEstimator --+ | RegressionEstimator --+ | PLSRegression
Estimator for PLS regression f(beta, X, Y) = -Cov(X.beta, Y), where Cov(., .) is the covariance. Parameters ---------- K : Positive integer. The number of components to compute. algorithm : OR(ImplicitAlgorithm, ExplicitAlgorithm). The algorithm that should be used. Should be one of: 1. PLSR() 2. MultiblockFISTA(...) Default is PLSR(...). algorithm_params : A dict. The dictionary algorithm_params contains parameters that should be set in the algorithm. Passing algorithm=MyAlgorithm(**params) is equivalent to passing algorithm=MyAlgorithm() and algorithm_params=params. Default is an empty dictionary. start_vector : BaseStartVector. Generates the start vector that will be used. mean : Boolean. Whether or not to compute the means squared error or the squared error. Default is True, compute the means squared error. Examples -------- >>> import parsimony.estimators as estimators >>> import parsimony.algorithms.nipals as nipals >>> import parsimony.algorithms.multiblock as multiblock >>> import numpy as np >>> np.random.seed(42) >>> >>> n, p = 16, 10 >>> X = np.random.rand(n, p) >>> y = np.random.rand(n, 1) >>> plsr = estimators.PLSRegression(K=4, algorithm=nipals.PLSR(), ... algorithm_params=dict(max_iter=100)) >>> error = plsr.fit(X, y).score(X, y) >>> print "error = ", error error = 0.0222345224457
|
|||
|
|||
|
|||
|
|||
|
|||
Inherited from Inherited from Inherited from |
|
|||
__abstractmethods__ =
|
|||
Inherited from Inherited from |
|
|||
Inherited from |
|
x.__init__(...) initializes x; see help(type(x)) for signature
|
Return a dictionary containing the estimator's parameters
|
Fit the estimator to the data.
|
Returns the (mean) squared error of the estimator.
|
Home | Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Mon Apr 6 23:52:10 2015 | http://epydoc.sourceforge.net |