【问题标题】:AWS Personalize — algorithmHyperParameters must be an associative array. Found arrayAWS Personalize — algorithmHyperParameters 必须是关联数组。找到数组
【发布时间】:2021-02-17 05:32:20
【问题描述】:

根据文档 (https://docs.aws.amazon.com/aws-sdk-php/v3/api/api-personalize-2018-05-22.html#createsolution),当您创建解决方案时,您必须提供 algorithmHyperParameters 作为字符串数组,所以我这样做了:

'solutionConfig' => [
    'algorithmHyperParameters' => [
        'min_copurchase_count',
        'exponentiation_parameter',
    ],
    ...
],

但脚本失败并出现错误:

Fatal error: Uncaught InvalidArgumentException: Found 1 error while validating the input provided for the CreateSolution operation:
[solutionConfig][algorithmHyperParameters] must be an associative array. Found array(2) in /var/www/vendor/aws/aws-sdk-php/src/Api/Validator.php:65

在这种情况下,algorithmHyperParameters 如何成为 an associative array?我已经尝试将它作为关联数组,但我没有找到任何有效的。

有人可以帮忙解决这个问题吗?提前致谢。

【问题讨论】:

    标签: php amazon-web-services amazon-personalize


    【解决方案1】:

    这个文档有错误,因为在其他文档(https://docs.aws.amazon.com/personalize/latest/dg/API_CreateSolution.html)这个参数是:

    1. 不需要。
    2. 如果需要,应该是这样的:
    'solutionConfig' => [
        'algorithmHyperParameters' => [
            '<string>' => '<string>',
        ],
        ...
    ],
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-06-24
      • 2019-09-26
      • 2019-11-29
      • 2019-08-03
      • 2016-05-21
      • 1970-01-01
      • 2017-02-25
      • 2021-07-21
      相关资源
      最近更新 更多