一、软件介绍
文末提供程序和源码下载
nnetsauce开源程序是使用随机和准随机(神经)网络(目前为Python和R)进行统计/机器学习
二、Installing (for Python and R)安装(适用于 Python 和 R)
Python 蟒
- 1st method: by using
pip
at the command line for the stable version
第 1 种方法:在稳定版的命令行中使用pip
pip install nnetsauce
- 2nd method: using
conda
(Linux and macOS only for now)
第二种方法:使用conda
(目前仅限 Linux 和 macOS)
conda install -c conda-forge nnetsauce
- 3rd method: from Github, for the development version
第 3 种方法:来自 Github,用于开发版本
pip install git+https://github.com/Techtonique/nnetsauce.git
or
git clone https://github.com/Techtonique/nnetsauce.git
cd nnetsauce
make install
R
From GitHub 来自 GitHub
remotes::install_github("Techtonique/nnetsauce_r") # the repo is in this organization
From R-universe 来自 R-universe
install.packages('nnetsauce', repos = c('https://techtonique.r-universe.dev',
'https://cloud.r-project.org'))
General rule for using the package in R: object accesses with .
's are replaced by $
's. R Examples can be found in the package, once installed, by typing (in R console):
在 R 中使用包的一般规则:带有 .
' 的对象访问将替换为 $
's。安装后,可以通过键入 (在 R 控制台中) 在包中找到 R 示例:
?nnetsauce::MultitaskClassifier
三、Quick start 快速开始
There are multiple examples here on GitHub, plus notebooks (including R Markdown notebooks).
GitHub 上有多个示例,以及笔记本(包括 R Markdown 笔记本)。
You can also read these blog posts.
您还可以阅读这些博客文章。
Lazy Deep (quasi-randomized neural) networks example
Lazy Deep (准随机神经网络) 网络示例
!pip install nnetsauce --upgrade
import os
import nnetsauce as ns
from sklearn.datasets import load_breast_cancer
from sklearn.model_selection import train_test_split
from time import time
data = load_breast_cancer()
X = data.data
y= data.target
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size = .2, random_state = 123)
clf = ns.LazyDeepClassifier(n_layers=3, verbose=0, ignore_warnings=True)
start = time()
models, predictions = clf.fit(X_train, X_test, y_train, y_test)
print(f"\n\n Elapsed: {time()-start} seconds \n")
model_dictionary = clf.provide_models(X_train, X_test, y_train, y_test)
display(models)
软件下载
本文信息来源于GitHub作者地址:https://github.com/Techtonique/nnetsauce