AutoSmart 开源项目使用教程

AutoSmart 开源项目使用教程

AutoSmart AutoSmart 项目地址: https://gitcode.com/gh_mirrors/au/AutoSmart

1. 项目目录结构及介绍

AutoSmart 项目的目录结构如下:

AutoSmart/
├── auto_smart/
│   ├── __init__.py
│   ├── core.py
│   ├── utils.py
│   └── ...
├── demo/
│   ├── demo_script.py
│   └── ...
├── .gitignore
├── LICENSE
├── README.md
└── setup.py

目录结构介绍

  • auto_smart/: 这是项目的主要代码目录,包含了 AutoSmart 的核心功能实现。

    • __init__.py: 初始化文件,用于导入模块。
    • core.py: 核心功能实现文件。
    • utils.py: 工具函数文件。
    • 其他相关文件和子目录。
  • demo/: 包含项目的演示脚本和示例代码。

    • demo_script.py: 演示脚本,展示了如何使用 AutoSmart 进行训练和预测。
    • 其他演示文件和子目录。
  • .gitignore: Git 忽略文件,指定哪些文件或目录不需要被 Git 管理。

  • LICENSE: 项目的开源许可证文件,本项目使用 GPL-3.0 许可证。

  • README.md: 项目的说明文件,包含了项目的简介、安装方法、使用方法等信息。

  • setup.py: 项目的安装脚本,用于安装 AutoSmart 包。

2. 项目启动文件介绍

项目的启动文件是 demo/demo_script.py。该文件展示了如何使用 AutoSmart 进行训练和预测。

启动文件内容

import auto_smart

# 读取数据信息
info = auto_smart.read_info("data")

# 读取训练数据和标签
train_data, train_label = auto_smart.read_train("data", info)

# 读取测试数据
test_data = auto_smart.read_test("data", info)

# 训练并预测
auto_smart.train_and_predict(train_data, train_label, info, test_data)

启动文件功能

  • 读取数据信息: 使用 auto_smart.read_info("data") 读取数据集的信息。
  • 读取训练数据和标签: 使用 auto_smart.read_train("data", info) 读取训练数据和标签。
  • 读取测试数据: 使用 auto_smart.read_test("data", info) 读取测试数据。
  • 训练并预测: 使用 auto_smart.train_and_predict(train_data, train_label, info, test_data) 进行模型训练和预测。

3. 项目的配置文件介绍

AutoSmart 项目没有明确的配置文件,但可以通过 info 字典来传递数据集的相关信息。info 字典包含了数据集的时间预算、时间列、表信息、关系信息等。

info 字典示例

info = {
    "time_budget": 3600,  # 时间预算,单位为秒
    "time_col": "timestamp",  # 时间列名称
    "tables": {
        "main": {
            "feature1": "cat",  # 分类特征
            "feature2": "num",  # 数值特征
            "feature3": "multi-cat",  # 多值分类特征
            "feature4": "time"  # 时间特征
        },
        "table_1": {
            "feature1": "cat",
            "feature2": "num"
        }
    },
    "relations": [
        ("main", "table_1", "feature1", "1-1")  # 表关系,主表与相关表通过 feature1 进行一对一关联
    ]
}

info 字典功能

  • time_budget: 设置数据集的时间预算,单位为秒。
  • time_col: 指定数据集的主时间列名称。
  • tables: 包含数据集中的表信息,每个表的特征类型。
  • relations: 定义表之间的关系,包括表名、键列和关系类型。

通过 info 字典,用户可以灵活地配置数据集的相关信息,以便 AutoSmart 进行训练和预测。

AutoSmart AutoSmart 项目地址: https://gitcode.com/gh_mirrors/au/AutoSmart

创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

尹田凌Luke

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值