API simplification

未关闭
#83 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
18/100
Issue 类型
重构
描述清晰度
需要澄清
活跃度
停滞
技术栈
python

调研方向

No files or tests are named. Start by reviewing the existing ModelManager, ModelCreator, and InferenceClient interfaces and the import and configuration examples in the issue. Clarify which API changes are in scope with maintainers; done should mean an agreed, tested replacement for the selected interfaces without breaking documented usage.

由索引模型根据 Issue 内容生成。

描述

What do you think about API simplification?

  1. Too long import:
    Current:
    from sap.aibus.dar.client.model_manager_client import ModelManagerClient
    Proposal:
    'from sap.dar import MMClient'

  2. Code cutting for model creation:
    Current:
    with open('dar_test.txt', 'r') as sk_file: sk_data = sk_file.read() json_data = json.loads(sk_data) creator = ModelCreator.construct_from_credentials( dar_url=json_data['url'], clientid=json_data['uaa']['clientid'], clientsecret=json_data['uaa']['clientsecret'], uaa_url=json_data['uaa']['url'], )
    Proposal:
    creator = ModelCreator(filekey='dar_test.txt')

  3. Config proposal:
    Current:
    new_schema = {
    "features": [
    {"label": "manufacturer", "type": "CATEGORY"},
    {"label": "description", "type": "TEXT"},
    {"label": "price", "type": "NUMBER"},
    ],
    "labels": [
    {"label": "level1_category", "type": "CATEGORY"},
    {"label": "level2_category", "type": "CATEGORY"},
    {"label": "level3_category", "type": "CATEGORY"},

    ],
    "name": "bestbuy-category-prediction",
    }
    Proposal:
    Features = fc.Category(["manufacturer"])+fc.Text(["description"])+ fc.Number(["price])
    Labels = fc.Category(["level1_category,level2_category,level3_category"])
    Schema = Features+Labels
    ^
    less code, easy to read, easy to change

  4. Enums for templates:
    Current:
    model_template_id="d7810207-ca31-4d4d-9b5a-841a644fd81f"
    Proposal:
    model_template = 0

  5. One class for rule them all:
    Current:
    ModelManager, ModelCreator, InferenceClient, etc.
    Proposal:
    DARModel
    DARModel.create()
    DARModel.deploy()
    DARModel.inference()
    DARModel.templates
    DARModel.deployments
    etc...

主要语言
Jupyter Notebook
星标
20
派生
6
PR 合并指标
30 天内没有已合并 PR

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

SAP/data-attribute-recommendation-python-sdk 的其他 Issue

查看 SAP/data-attribute-recommendation-python-sdk 的全部 Issue

相似的 Issue

更多 Backend & API Design Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。