一个轻量级的机器学习框架(纯python+numpy实现的迷你版scikit-learn)
from lemon.datasets import load_iris
from lemon.model_utils.model_selection import train_test_split
from lemon.supervised.naive_bayes import GaussianNB
from lemon.model_utils.metrics import accuracy
x, y = load_iris(x_y=True)
x_train, x_test, y_train, y_test = train_test_split(x, y, split_rate=0.8, random_state=2020)
model = GaussianNB()
model.fit(x_train, y_train)
pred = model.predict(x_test)
print(accuracy(y_test, pred))
- datasets(boston, breast_canner, iris, titanic, wine)
- processing
- preprocessing(binarizer, transformer, discretizer, encoding, scaler)
- decomposition(pca, svd)
- impute(simple-impute)
- feature_utils
- feature_selection (woe_iv)
- model_utils
- metrics
- model_selection(psi)
- supervised
- linear_model(simple-linear, lasso, ridge, elastic-net, perceptron, logistic-regression)
- naive_bayes(gaussian, multinomial)
- neighbors(kd-tree-based-knn)
- svm
- tree
- hmm
- crf
- ensemble
- semi_supervised
- label_propagation
- louvain
- pagerank
- unsupervised
- dbscan
- kmeans(simple-kmeans, kmeans++, mini-batch-kmeans)