主要内容

收集

收集的属性统计和机器学习工具对象从GPU

自从R2020b

    描述

    例子

    gatheredObj=收集(obj)收集输入对象的所有属性obj收集并返回对象gatheredObj。输出对象的所有属性存储在本地工作区。

    使用收集创建一个统计和机器学习工具箱™对象与属性从一个对象存储在本地工作区安装使用数据存储为GPU数组。GPU数组的更多细节,请参阅gpuArray(并行计算工具箱)。使用GPU需要并行计算工具箱™和支持GPU设备。万博1manbetx支持设备的信息,请参阅万博1manbetxGPU计算的需求(并行计算工具箱)

    例子

    [gatheredObj1, gatheredObj2,…gatheredObjn] =收集(obj1,obj2……objn)收集多个对象的属性其中obj1 methoda,…, objn并返回相应的收集对象gatheredObj1 gatheredObj2,…, gatheredObjn。输入参数和输出参数的数量必须匹配。

    例子

    全部折叠

    收集装有GPU的线性回归模型的属性数组的数据。

    加载carsmall数据集创建。X作为一个数字矩阵,包含三个汽车性能指标。创建Y作为一个数值向量包含相应的英里每加仑。

    负载carsmallX =(重量、马力、加速度);Y = MPG;

    将预测X和响应YgpuArray(并行计算工具箱)对象。

    X = gpuArray (X);Y = gpuArray (Y);

    适合一个线性回归模型mdl通过使用fitlm

    mdl = fitlm (X, Y);

    显示的系数mdlGPU和确定估计系数值数组。

    mdl.Coefficients
    ans =4×4表估计SE tStat pValue __________替__________(拦截)47.977 3.8785 12.37 4.8957 e-21 x1 -0.0065416 0.0011274 -5.8023 9.8742 e-08 x2 x3 -0.011583 0.19333 -0.059913 0.08078 -0.042943 0.024313 -1.7663 0.95236
    isgpuarray (mdl.Coefficients.Estimate)
    ans =逻辑1

    收集线性回归模型的属性。

    gatheredMdl =收集(mdl);

    显示的系数gatheredMdlGPU和确定估计系数值数组。

    gatheredMdl.Coefficients
    ans =4×4表估计SE tStat pValue __________替__________(拦截)47.977 3.8785 12.37 4.8957 e-21 x1 -0.0065416 0.0011274 -5.8023 9.8742 e-08 x2 x3 -0.011583 0.19333 -0.059913 0.08078 -0.042943 0.024313 -1.7663 0.95236
    isgpuarray (gatheredMdl.Coefficients.Estimate)
    ans =逻辑0

    收集的属性和一个线性回归模型k最近的邻居分类器。两种模型安装使用GPU数组数据。

    加载carsmall数据集创建。X作为一个数字矩阵,包含三个汽车性能指标,并将预测X到一个gpuArray对象。

    负载carsmallX =(重量、马力、加速度);X = gpuArray (X);

    适应的线性回归模型英里/加仑(英里/加仑)作为预测的功能X

    mdlLinear = fitlm (X, MPG);

    火车3-nearest邻居使用预测分类器X和类气缸。规范noncategorical预测数据。

    mdlKNN = fitcknn (X,气缸,“NumNeighbors”3,“标准化”1);

    收集的属性mdLinearmdlKNN模型。

    [gMdlLinear, gMdlKNN] =收集(mdlLinear mdlKNN);

    确定p价值Durbin-Watson测试的回归模型mdlLinear是一个GPU数组。

    isgpuarray (dwt (mdlLinear))
    ans =逻辑1

    确定p价值Durbin-Watson测试的回归模型gMdlLinear是一个GPU数组。

    isgpuarray (dwt (gMdlLinear))
    ans =逻辑0

    确定resubstitution损失的分类器mdlKNN是一个GPU数组。

    isgpuarray (resubLoss (mdlKNN))
    ans =逻辑1

    确定resubstitution损失的收集分类器gMdlKNN是一个GPU数组。

    isgpuarray (resubLoss (gMdlKNN))
    ans =逻辑1

    输入参数

    全部折叠

    配备了GPU数组或对象gpuArray对象,指定为一个回归模型对象,分类模型对象,概率分布对象,cvpartition对象,或gpuArray(并行计算工具箱)对象。一个gpuArray对象表示一个数组存储在GPU上。

    更多信息的统计和机器学习的工具箱支持的对象万博1manbetx收集,请参阅万博1manbetx支持回归模型,万博1manbetx支持分类模型,万博1manbetx支持概率分布对象

    更多关于

    全部折叠

    万博1manbetx支持回归模型

    收集函数可以收集以下回归模型对象的属性。

    模型类型 全部或紧凑的模型对象 模型创建函数
    整体回归的学习者 RegressionEnsemble,CompactRegressionEnsemble,或RegressionBaggedEnsemble fitrensembleRegressionEnsemble目标函数紧凑的
    广义线性回归模型 GeneralizedLinearModelCompactGeneralizedLinearModel fitglmGeneralizedLinearModel目标函数紧凑的
    完整的线性回归模型 LinearModelCompactLinearModel fitlmLinearModel目标函数紧凑的
    回归树模型 RegressionTreeCompactRegressionTree fitrtreeRegressionTree目标函数紧凑的
    万博1manbetx支持向量机回归模型 RegressionSVM,CompactRegressionSVM,或RegressionPartitionedSVM fitrsvm
    旨在回归合奏 RegressionPartitionedEnsemble fitrensemble
    旨在回归模型 RegressionPartitionedModel fitrtree

    如果你想创建一个紧凑的模型配备GPU数组,输入参数mdl紧凑的必须是一个完整的模型对象装有GPU数组输入参数。

    万博1manbetx支持分类模型

    收集函数可以收集以下分类模型对象的属性。

    模型类型 全部或紧凑的模型对象 模型创建函数
    多类支持向量机模型或其他分类器万博1manbetx ClassificationECOCCompactClassificationECOC fitcecocClassificationECOC目标函数紧凑的
    系综分类的学习者 ClassificationEnsemble,CompactClassificationEnsemble,或ClassificationBaggedEnsemble fitcensembleClassificationEnsemble目标函数紧凑的
    k最近的邻居分类器 ClassificationKNN fitcknn
    万博1manbetx支持向量机(SVM)分类器 ClassificationSVMCompactClassificationSVM fitcsvmClassificationSVM目标函数紧凑的
    二叉决策树的多类分类 ClassificationTreeCompactClassificationTree fitctreeClassificationTree目标函数紧凑的
    旨在ECOC模型 ClassificationPartitionedECOC fitcecoc
    旨在分类合奏 ClassificationPartitionedEnsemble fitcensemble
    旨在分类模型 ClassificationPartitionedModel fitcknn,fitcsvm,或fitctree

    如果你想创建一个紧凑的模型配备GPU数组,输入参数mdl紧凑的必须是一个完整的模型对象装有GPU数组输入参数。

    万博1manbetx支持概率分布对象

    收集函数可以收集以下概率分布对象的属性。

    概率分布 概率分布对象 对象创建函数
    贝塔分布 BetaDistribution fitdistdistname指定为“β”
    二项分布 BinomialDistribution fitdistdistname指定为“二”
    Birnbaum-Saunders分布 BirnbaumSaundersDistribution fitdistdistname指定为“BirnbaumSaunders”
    毛刺分布 BurrDistribution fitdistdistname指定为“毛刺”
    指数分布 ExponentialDistribution fitdistdistname指定为“指数”
    极端值分布 ExtremeValueDistribution fitdistdistname指定为“ExtremeValue”
    伽马分布 GammaDistribution fitdistdistname指定为“伽马”
    广义极值分布 GeneralizedExtremeValueDistribution fitdistdistname指定为“GeneralizedExtremeValue”
    广义帕累托分布 GeneralizedParetoDistribution fitdistdistname指定为“GeneralizedPareto”
    Half-normal分布 HalfNormalDistribution fitdistdistname指定为“HalfNormal”
    逆高斯分布 InverseGaussianDistribution fitdistdistname指定为“InverseGaussian”
    内核分配 KernelDistribution fitdistdistname指定为“内核”
    物流配送 LogisticDistribution fitdistdistname指定为“物流”
    Loglogistic分布 LoglogisticDistribution fitdistdistname指定为“Loglogistic”
    对数正态分布 LognormalDistribution fitdistdistname指定为对数正态的
    Nakagami分布 NakagamiDistribution fitdistdistname指定为“Nakagami”
    负二项分布 NegativeBinomialDistribution fitdistdistname指定为“NegativeBinomial”
    正态分布 NormalDistribution fitdistdistname指定为“正常”
    泊松分布 PoissonDistribution fitdistdistname指定为“泊松”
    瑞利分布 RayleighDistribution fitdistdistname指定为“瑞利”
    tLocation-Scale分布 tLocationScaleDistribution fitdistdistname指定为“tLocationScale”
    威布尔分布 WeibullDistribution fitdistdistname指定为“威布尔”

    提示

    • 收集GPU数组可以是昂贵的,通常是没有必要的,除非你需要使用结果与功能不支持GPU数组。万博1manbetx的完整列表统计和机器学习的工具箱函数接受GPU数组,明白了功能列表(GPU数组)

    • 你也可以叫收集其他数据类型,如分布式codistributed或高大的数组。如果收集的数据类型不支持,那么万博1manbetx收集没有效果。

    扩展功能

    版本历史

    介绍了R2020b

    全部展开