Metadata-Version: 2.1
Name: onetouch
Version: 0.1.23
Summary: A simple and convenient Python automation toolkit based on libraries such as PyTorch, Pandas, Scikit-learn, Matplotlib, NumPy, etc., offering features like one-click data cleaning, model training, model evaluation, automatic hyperparameter tuning, and prediction.
Home-page: https://gitee.com/SunnyB0y/onetouch
Author: 17fine
Author-email: 2756601885@qq.com
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pandas (>=2.2.2)
Requires-Dist: numpy (>=1.26.4)
Requires-Dist: seaborn (>=0.12.2)
Requires-Dist: matplotlib (>=3.7.2)
Requires-Dist: scikit-learn (>=1.3.2)
Requires-Dist: tqdm (>=4.66.1)
Provides-Extra: dev
Requires-Dist: flake8 ; extra == 'dev'
Provides-Extra: extra
Requires-Dist: torch ; extra == 'extra'
Requires-Dist: sklearn ; extra == 'extra'

# OneTouch 一键

发布日期: 2024年10月26日

版权所有: 17fine(个人)

版本号: 0.1.23

---

# 前言

本参考手册详细介绍了OneTouch中包含的函数、模块和对象，描述了它们是什么以及它们做什么。了解如何使用OneTouch。

---

# 概述

## 简介

一款基于PyTorch、Pandas、Scikit-learn、Matplotlib、NumPy等库的简单便捷的Python自动化工具包，提供一键数据清洗、模型训练、模型评估、自动超参数调优和预测等功能。

A simple and convenient Python automation toolkit based on libraries such as PyTorch, Pandas, Scikit-learn, Matplotlib, NumPy, etc., offering features like one-click data cleaning, model training, model evaluation, automatic hyperparameter tuning, and prediction.

## 宗旨

以极简之码，绘繁复之功。

With minimalist code, depicting the intricate work.

---

# **安装指南**

## 默认安装

```Perl
pip install onetouch
```

## 指定版本安装

```PowerShell
pip install onetouch==0.1.7
```

## 安装依赖库

```Plain Text
pandas>=2.2.2
numpy>=1.26.4
seaborn>=0.12.2
matplotlib>=3.7.2
scikit-learn>=1.3.2
tqdm>=4.66.1
torch>=2.1.0+cu121
```

## 卸载

```PowerShell
pip uninstall onetouch
```

---

# **快速入门**

## 先决条件

在阅读本教程之前，你应该了解一些Python的基础知识。如果你想复习一下，请回去看看[Python教程](https://docs.python.org/zh-cn/3/tutorial/)。

## One2Three

一键三连模块使用,集成数据清洗,模型训练,评估模型三大模块

```Python
import onetouch as ot

filename = "Your FileName"

data = ot.One2Three(None, None, filename)

```

---

# **功能参考**

## onetouch

### One2Three

onetouch中, One2Three(df, label, filename) 

一键三连地进行数据清洗、模型训练、模型评估

#### 参数

- `df`: `pd.DataFrame`-`None`-`选`

    通常是pandas处理过后的dataframe格式的数据

    `df`与`filename`必填其中之一

- `label`: `str`-`None`-`选`

    表示用于模型训练的标签栏

    默认为`df`最后一列

- `filepath`: `str`-`None`-`选`

    通常是原始数据的路径地址

    `df`与`filename`必填其中之一

    目前支持: `.csv`-`.xslx`

#### 示例

```Python
import onetouch as ot

filename = "Your FileName"

data = ot.One2Three(None, None, filename)

```

#### 输出

各项基本信息,不详细展开

### One2Three.predict

onetouch中, One2Three.predict(x) 

提供一键三连中模型预测功能

#### 参数

- `x`: `pd.DataFrame`-`必`

    通常是pandas处理过后的dataframe格式的数据,不含标签值

#### 示例

```Python
import onetouch as ot
import pandas as pd

df = pd.DataFrame(None, None, 'Your filepath')

data = ot.One2Three(df)

x = pd.dataframe([1,2,3]) # 你的数据

print(data.predict(x))

```

#### 输出

分类任务

- `pred`: `str`类别标签

- `confidence`: `float`置信度(0-1) 

```PowerShell
(pred, confidence)
```

回归任务

- `pred`: `float`标签值

```PowerShell
pred
```

## onetouch.tools

### printc

onetouch.tools中, printc(self, *args, display, color, sep, end, file)

选择性打印多种颜色的字符到终端

#### 参数

- `self`: `Any`-`None`-`选`

    通常是要打印在终端的内容

- `*args`: `tuple[Any]`-`None`-`选`

    通常是其他需要打印在终端的内容

- `display`: `bool`-`True`-`选`

    控制是否将内容输出到终端

- `color`: `str`-`None`-`选`

    控制将内容输出到终端的颜色

    目前支持颜色

        `default`:`默认颜色`

        `black`:`黑色`

        `red`:`红色`

        `green`:`绿色`

        `yellow`:`黄色`

        `blue`:`蓝色`

        `magenta`:`品红色`

        `cyan`:`青色`

        `white`:`白色`

        `bright_black`:`灰色`

        `bright_red`:`亮红色`

        `bright_green`:`亮绿色`

        `bright_yellow`:`亮黄色`

        `bright_blue`:`亮蓝色`

        `bright_magenta`:`亮品红色`

        `bright_cyan`:`亮青色`

        `bright_white`:`亮白色`

- `sep`: `str`-`''`-`选`

    `self`和所有`*args`之间的连接符

- `end`: `str`-`'\n'`-`选`

    两次printc操作之间的连接符

- `file`: `SupportsWrite[str]`-`None`-`选`

    文件类对象 （stream）;默认为当前的 sys.stdout。

#### 示例

```Python
import onetouch as ot

list1 = [1, 2, 3]
list2 = [9, 8, 7]

ot.tools.printc(f'{123}绿色文本', list1, list2, display=True, color='green')

```

#### 输出

```PowerShell
123绿色文本 [1, 2, 3] [9, 8, 7] 
```

### prints

onetouch.tools中, prints(self, *args, display, style, morphology, recover, sep, end, file)

选择性打印多种样式的字符到终端

#### 参数

- `self`: `Any`-`None`-`选`

    通常是要打印在终端的内容

- `*args`: `tuple[Any]`-`None`-`选`

    通常是其他需要打印在终端的内容

- `display`: `bool`-`True`-`选`

    控制是否将内容输出到终端

- `style`: `str`-`None`-`选`

    控制将内容输出到终端的样式,绝对优先级:`3`

    规范化写法

        ```Python
        style='color:green;backgroundcolor:blue;'
        ```

    目前支持样式

        `color`: 字体颜色

        目前支持颜色

        `default`:`默认颜色`

        `black`:`黑色`

        `red`:`红色`

        `green`:`绿色`

        `yellow`:`黄色`

        `blue`:`蓝色`

        `magenta`:`品红色`

        `cyan`:`青色`

        `white`:`白色`

        `bright_black`:`灰色`

        `bright_red`:`亮红色`

        `bright_green`:`亮绿色`

        `bright_yellow`:`亮黄色`

        `bright_blue`:`亮蓝色`

        `bright_magenta`:`亮品红色`

        `bright_cyan`:`亮青色`

        `bright_white`:`亮白色`

        `backgroundcolor`: 背景颜色

        目前支持颜色

        `black`:`黑色`

        `red`:`红色`

        `green`:`绿色`

        `yellow`:`黄色`

        `blue`:`蓝色`

        `magenta`:`品红色`

        `cyan`:`青色`

        `white`:`白色`

        `bright_black`:`灰色`

        `bright_red`:`亮红色`

        `bright_green`:`亮绿色`

        `bright_yellow`:`亮黄色`

        `bright_blue`:`亮蓝色`

        `bright_magenta`:`亮品红色`

        `bright_cyan`:`亮青色`

        `bright_white`:`亮白色`

        `bold`: 字体加粗 - `True`/`False`

        `faint`: 变暗 - `True`/`False`

        `italic`: 斜体 - `True`/`False`

        `underline`: 下划线 - `True`/`False`

        `reverse`: 颜色反转 - `True`/`False`

        `crossed-out`: 删除线 - `True`/`False`

- `morphology`: `dict`-`None`-`选`

    控制将内容输出到终端的样式,绝对优先级:`2`

    规范化写法

        ```Python
        morphology = {
            'color': 'red',
            'backgroundcolor': 'yellow',
            'bold': True,
            'faint': True,
            'italic': True,
            'underline': True,
            'reverse': True,
            'crossed-out': True
        }
        ```

    目前支持样式

        参考onetouch.tools.printc参数style的目前支持样式

- `recover`: `bool`-`True`-`选`

    是否保持该字体样式

- `sep`: `str`-`''`-`选`

    `self`和所有`*args`之间的连接符

- `end`: `str`-`'\n'`-`选`

    两次printc操作之间的连接符

- `file`: `SupportsWrite[str]`-`None`-`选`

    文件类对象 （stream）;默认为当前的 sys.stdout。

#### 示例

```Python
import onetouch as ot

list1 = [1, 2, 3]
list2 = [9, 8, 7]

morphology = {
    'color': 'red',
    'backgroundcolor': 'yellow',
    'bold': True,
    'faint': True,
    'italic': True,
    'underline': True,
    'reverse': True,
    'crossed-out': True
}

ot.tools.prints(f'{987}测试文本', list1, list2, display=True,style='color:green;backgroundcolor:blue;', morphology=morphology, recover=True)

```

#### 输出

```PowerShell
987测试文本[1, 2, 3][9, 8, 7]
```

---

# **附录**

[pytorch参考手册](https://pytorch.org/docs/main/)

[numpy参考手册](https://www.numpy.org.cn/reference/)

[pandas参考手册](https://pypandas.cn/docs/)

[matplotlib参考手册](https://www.matplotlib.org.cn/contents/)

[scikit-learn参考手册](https://scikit-learn.org/stable/api/index.html)

---

# 致谢

在此，我要特别感谢智谱清言对于OneTouch库的开发与构建所做出的巨大贡献。这款软件以其高效能和智能化特性，极大地简化了开发流程，提升了库的功能性和稳定性。智谱清言的强大指导性AI大模型,让OneTouch库的构建变得更加高效和可靠。我们对智谱清言所提供的支持表示衷心的感谢，并期待在未来的项目中继续利用这一强大工具，共同推动技术的发展。





