Skip to main content

An easy-to-use ML framework

Project description

classicML: 简单易用的经典机器学习框架

build PyPI Documentation Status

classicML 是一个用 Python 和 C++ 混编的机器学习项目,您既可以使用纯 Python 版本进行学习,也可以使用CC标准版进行实验和探索自定义功能。它既实现了Python的简单易用快速上手,又实现了C++的高效性能。classicML的设计目标是简单易用,快速入门,高扩展性和编程风格简洁。更多信息请访问文档网站

多后端支持

classicML 本身是一个Python项目,但是机器学习中涉及到的复杂的矩阵运算对于Python有点儿捉襟见肘,因此我们提供了使用C++后端的加速版本。为了保证兼容性,classicML默认使用Python后端,现在全部算法支持了使用C++作为后端进行加速,如果您需要使用标准版的classicML,只需在开头使用这条语句切换后端。

import os
os.environ['CLASSICML_ENGINE'] = 'CC'

精度控制

目前,classicML 正在对全部算法支持32位和64位切换精度,使用32位的精度可以获得更快的运行速度和更小固化模型。

import os
os.environ['CLASSICML_PRECISION'] = '32-bit'

第一个机器学习程序

使用线性判别分析进行二分类

  • 下载示例数据集
wget https://github.com/sun1638650145/classicML/blob/master/datasets/西瓜数据集alpha.csv
  • 运行下面的代码
import classicML as cml

DATASET_PATH = '/path/to/西瓜数据集alpha.csv'

# 读取数据
ds = cml.data.Dataset()
ds.from_csv(DATASET_PATH)
# 生成模型
model = cml.models.LDA()
# 训练模型
model.fit(ds.x, ds.y)
# 可视化模型
cml.plots.plot_lda(model, ds.x, ds.y, '密度', '含糖率')

v0.7 预览

在之前的版本classicML全局精度是float64的,现在我们引入CLASSICML_PRECISION,这样你就可以控制全局精度,使用32位的精度时,可以获得更快的运行速度和更小固化模型。

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

classicML-lite-0.7a0.tar.gz (45.5 kB view details)

Uploaded Source

Built Distribution

classicML_lite-0.7a0-py3-none-any.whl (70.0 kB view details)

Uploaded Python 3

File details

Details for the file classicML-lite-0.7a0.tar.gz.

File metadata

  • Download URL: classicML-lite-0.7a0.tar.gz
  • Upload date:
  • Size: 45.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.8.10

File hashes

Hashes for classicML-lite-0.7a0.tar.gz
Algorithm Hash digest
SHA256 c20828f5e69d8f1a6f6159bdd98771748b54983a0f68aa0546ce15f3f30c15b9
MD5 9d470220088592b4c822b43f7b953a42
BLAKE2b-256 341404037bf1d2454e37956a5bb12c92c092e138358688588af28352c6565844

See more details on using hashes here.

File details

Details for the file classicML_lite-0.7a0-py3-none-any.whl.

File metadata

  • Download URL: classicML_lite-0.7a0-py3-none-any.whl
  • Upload date:
  • Size: 70.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.8.10

File hashes

Hashes for classicML_lite-0.7a0-py3-none-any.whl
Algorithm Hash digest
SHA256 0327e3b8431ad7c9d2a7c3dbf835be00baa147ce73ae9629ed83da7e1776cb3b
MD5 ae21f66997874043cdfd5cafeb5f583e
BLAKE2b-256 f1349d2873e2be24972aabad72b31c5d84ee3cc53e8a13141f726727f70b2653

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page