基于wisard模型的wisard库

wisardpkg的Python项目详细描述


wisardpkg

说明:

这是一个基于Wisard的不同型号的项目, 具有高性能,易于使用,易于安装和遵循使用模式。 这些模型是机器学习模型, 有监督、无监督和半监督学习。

要安装:

Python:

pip install wisardpkg

适用于python2和pyhton3。
如果您在Linux上,而不是在虚拟环境中,则可能需要以超级用户身份运行。

OBS:

要在Windows平台上安装,您可以使用anaconda并执行以下操作:

python -m pip install wisardpkg

C++: 将文件wisardpkg.hpp复制到项目中

include/wisardpkg.hpp

要卸载:

pip uninstall wisardpkg

导入:

Python:

importwisardpkgaswp

C++:

# include "wisardpkg.hpp"namespacewp=wisardpkg;

使用:

wisard

默认情况下,带有漂白功能的wisard:

Python:

# load input data, just zeros and ones  X=[[1,1,1,0,0,0,0,0],[1,1,1,1,0,0,0,0],[0,0,0,0,1,1,1,1],[0,0,0,0,0,1,1,1]]# load label data, which must be a string arrayy=["cold","cold","hot","hot"]addressSize=3# number of addressing bits in the ramignoreZero=False# optional; causes the rams to ignore the address 0# False by default for performance reasons,# when True, WiSARD prints the progress of train() and classify()verbose=Truewsd=wp.Wisard(addressSize,ignoreZero=ignoreZero,verbose=verbose)# train using the input datawsd.train(X,y)# classify some dataout=wsd.classify(X)# the output of classify is a string list in the same sequence as the inputfori,dinenumerate(X):print(out[i],d)

C++:

vector<vector<int>>X(4);X[0]={1,1,1,0,0,0,0,0};X[1]={1,1,1,1,0,0,0,0};X[2]={0,0,0,0,1,1,1,1};X[3]={0,0,0,0,0,1,1,1};vector<string>y={"cold","cold","hot","hot"};wp::Wisardw(3,{{"ignoreZero",false},{"verbose",true}});w.train(X,y);vector<string>out=w.classify(X);for(inti=0;i<4;i++){cout<<"i: "<<i<<"; class: "<<out[i]<<endl;}

俱乐部

默认情况下带有漂白功能的俱乐部:

addressSize=3# number of addressing bits in the ram.minScore=0.1# min score of training processthreshold=10# limit of training cycles by discriminatordiscriminatorLimit=5# limit of discriminators by clusters# False by default for performance reasons# when enabled,e ClusWiSARD prints the progress of train() and classify()verbose=Trueclus=ClusWisard(addressSize,minScore,threshold,discriminatorLimit,verbose=True)# train using the input dataclus.train(X,y)# optionally you can train using arbitrary labels for the data# input some labels in a dict,# the keys must be integer indices indicating which input array the entry is associated to,# the values are the labels which must be stringsy2={1:"cold",3:"hot"}clus.train(X,y2)# classify some dataout=clus.classify(X)# the output of classify is a string list in the same sequence as the inputfori,dinenumerate(X):print(out[i],d)

文档:

您可以在page中找到完整的文档。

基于库:

pybind11nlohmann/json

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java是否可以基于步骤定义返回的arraylist迭代一组功能文件行   SoapUI项目执行后的java WebDriver异常   在Java中,比较int和可能为null的整数最干净的方法是什么?   java生成带有bouncy castle的dsa/elgamal密钥对,该密钥对在GPG中导入时不会出错   java JLS与Sun javac的对应关系/它们不匹配的原因   用圆除法的java大长数值   是否存在用于集合处理的Java库?   java读取txt文件。显示每行旁边的整数之和,并找出其中最大的和   java计算数组中的值之和   java正在从SharedReferences中删除对象   在项目“XXXXX”上运行生成器“Jboss知识库生成器”时出现java错误。未知标签!位置=3池计数=12   java有没有更简单的方法来编写这个equalsIgnoreCase检查链?   java无法在NetBeans中找到main   如何在Java或C中创建MAC连接?   ssl Java MTLS主体和颁发者顺序   如何在java中解组具有未知子元素的XML?   java如何使用带多FirestoreRecyclerAdapter的房间?   java如何实例化IOSDriver以在当前会话中访问其方法   java Oracle在插入后更新NCLOB   我们可以在安卓中进行下一次迭代之前,在每次迭代中创建一个for循环来获取用户输入