Python 第三方模块 机器学习 Scikit-Learn模块 矩阵分解,核近似

一.decomposition
1.简介:

该模块用于进行矩阵分解.其中大多数算法都可用于数据降维

2.使用
(1)类:

"字典学习"(Dictionary learning):class sklearn.decomposition.DictionaryLearning([n_components=None,alpha=1,max_iter=1000,tol=1e-08,fit_algorithm='lars',transform_algorithm='omp',transform_n_nonzero_coefs=None,transform_alpha=None,n_jobs=None,code_init=None,dict_init=None,verbose=False,split_sign=False,random_state=None,positive_code=False,positive_dict=False,transform_max_iter=1000])
  #参数说明:
	n_components:指定提取的字典元素数量;int
	alpha:指定"稀疏度控制参数"(Sparsity controlling parameter);float
	max_iter:指定最大迭代次数;int
	tol:指定最小误差(若误差小于该值,则停止);float
	fit_algorithm:指定用于学习的算法;"lars"/"cd"
	transform_algorithm:指定数据变换算法;"lasso_lars"/"lasso_cd"/"lars"/"omp"/"threshold"
	transform_n_nonzero_coefs:指定解的每1列中非0系数的数量;int
	  #仅当algorithm="lars"/"omp"时使用;且当algorithm="omp"时,会被alpha覆盖
	transform_alpha:If algorithm='lasso_lars'/'lasso_cd',alpha is the penalty applied to the L1 norm
	                If algorithm='threshold',alpha is the absolute value of the threshold below which coefficients will be squashed to zero
	                If algorithm='omp',alpha is the tolerance parameter:the value of the reconstruction error targeted
	                In this case,it overrides n_nonzero_coefs
	n_jobs:指定要运行的并行计算数量;int
	code_init,dict_init:分别指定代码/字典的初始值(用于"热重启"(warm restart));均为n_components×n_features array
	verbose:指定是否输出进度信息;bool
	split_sign:指定是否将稀疏特征向量分割为其负部分和正部分的连接;bool
	  #为True可提供下游分类器的性能
	random_state:指定使用的随机数;int/RandomState instance/None
	positive_code:,positive_dict:分别指定在寻找代码/字典时是否加强积极性;均为bool
	transform_max_iter:指定最大迭代次数;int
	  #仅当algorithm="lasso_cd"/"lasso_lars"时使用

######################################################################################################################

"因子分析"(Factor Analysis;FA):class sklearn.decomposition.FactorAnalysis([n_components=None,tol=0.01,copy=True,max_iter=1000,noise_variance_init=None,svd_method='randomized',iterated_power=3,rotation=None,random_state=0])
  #参数说明:其他参数同class sklearn.decomposition.DictionaryLearning()
	n_components:指定"隐空间"(latent space)的维度;int/None(特征数量)
	copy:指定是否一定创建数据的副本;bool
	noise_variance_init:指定各特征噪声方差的初始值;为array/None(np.ones(n_features))
	svd_method:指定使用哪种SVD方法;"lapack"/"randomized"
	iterated_power:指定"幂次法"(power method)的迭代次数;int
	rotation:指定如何选择因子;"varimax"/"quartimax"

######################################################################################################################

"快速独立成分分析"(Fast Independent Component Analysis;FastICA):class sklearn.decomposition.FastICA([n_components=None,algorithm='parallel',whiten=True,fun='logcosh',fun_args=None,max_iter=200,tol=0.0001,w_init=None,random_state=None])
  #参数说明:其他参数同class sklearn.decomposition.DictionaryLearning()
	n_components:指定要使用的样本数量;int
	algorithm:指定使用的算法;"parallel"/"deflation"
	whiten:指定是否进行白化;bool
	fun:指定用于近似"负熵"(neg-entropy)"G函数"(G function)的函数形式;"logcosh"/"exp"/"cube"/callable
	fun_args:指定要传递给fun的其他参数;dict
	w_init:指定混合矩阵的初始值;为n_components×n_components ndarray

######################################################################################################################

"增量主成分分析"(Incremental principal components analysis;IPCA):class sklearn.decomposition.IncrementalPCA([n_components=None,whiten=False,copy=True,batch_size=None])
  #参数说明:其他参数同class sklearn.decomposition.FastICA()
	n_components:指定要保存的组件数量;int
	batch_size:指定"批"(batch)的大小;int

#
  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值