Skip to main content

A small machine learning package, which can help people learn ML more easier

Project description

tinysklearn

仿制了部分sklearn接口,结构简单,容易理解,非常适合机器学习入门

使用方法

  • 安装
pip install tinysklearn
  • 使用
    使用方法和sklearn是一致的(至少实现了fit,predict,transform,score这四种方法)
from tinysklearn.tinysklearn import LinearRegression
from tinysklearn.datasets import load_boston
from tinysklearn.preprocessing import StandardScaler
from tinysklearn.neighbors import KNeighborsClassifier
from tinysklearn.model_selection import train_test_split
from tinysklearn.decomposition import PCA
from tinysklearn.metrics import mean_absolute_error

#读取数据
boston = load_boston()
x = boston.data
y = boston.target

#分割训练集测试集
x_train, x_test, y_train, y_test = train_test_split(x, y, test_size=0.2, random_state=666666)

#构建模型,训练
lr = LinearRegression()
lr.fit(x_train, x_test)

#预测
lr.predict(x_test)

#评估
lr.score(x_test, y_test)

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

tinysklearn-0.0.3.tar.gz (5.4 kB view details)

Uploaded Source

File details

Details for the file tinysklearn-0.0.3.tar.gz.

File metadata

  • Download URL: tinysklearn-0.0.3.tar.gz
  • Upload date:
  • Size: 5.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.6.9

File hashes

Hashes for tinysklearn-0.0.3.tar.gz
Algorithm Hash digest
SHA256 34bb9167d0eb647ee6e081de5a9297d1207588e6c9636e8256dd34121a9c705e
MD5 0866478cb0b394f536b59761ea87977c
BLAKE2b-256 676328f1befba06752b537e445e6118c2efd5e67fa3fbb819cbd288a9cd8a8f7

See more details on using hashes here.

Supported by

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