Py学习  »  机器学习算法

节点红色控制器机器学习错误

Stav Alfi • 5 年前 • 583 次点击  

我正在尝试使用此库在 node red中实现最基本的机器学习流程: https://flows.nodered.org/node/node red contrib machine learning

< Buff行情>

这个流加载一个csv文件,对其进行无序处理,并创建一个培训和一个测试分区。

< /块引用>

我安装了:

  • “python”(在Linux“python3”上)命令可访问python 3.6.4或更高版本
  • Numpy > < 大熊猫
  • Scikit学习
  • TensorFlow(可选:可以跳过)

我打开了 node red from anaconda

问题:

当点击“开始”节点时,我得到以下错误:

traceback(most recent call last):
文件“c:\users\stava\node\u modules\node red contrib machine learning\nodes\dataset\create dataset/create dataset.py”,
第12行,在<module>df=pandas.read_csv(config['path'],header=none)
文件“c:\users\statva\appdata\local\conda\conda\envs\py35\lib\site packages\pandas\io\parsers.py”,
第678行,在解析器中,返回读取(filepath或缓冲区,kwds)
文件“c:\users\statva\appdata\local\conda\conda\envs\py35\lib\site packages\pandas\io\parsers.py”,
第440行,in _read parser=textfilereader(filepath_或_buffer,**kwds)
文件“c:\users\statva\appdata\local\conda\conda\envs\py35\lib\site packages\pandas\io\parsers.py”,
第787行,in uu init_uuuu self.u make_engine(self.engine)
文件“c:\users\statva\appdata\local\conda\conda\envs\py35\lib\site packages\pandas\io\parsers.py”,
行1014,in _make_engine self._engine=cparserwrapper(self.f,**self.options)
文件“c:\users\statva\appdata\local\conda\conda\envs\py35\lib\site packages\p…
< /代码> <.

这个流加载一个csv文件,对其进行无序处理,并创建一个培训和一个测试分区。

enter image description here

我安装:

  • “python”命令(在Linux“python3”上)可以访问python 3.6.4或更高版本
  • 麻木的
  • 熊猫
  • 科学软件学习
  • TensorFlow(可选:可以跳过)

我打开节点红Anaconda.

问题:

当点击“开始”节点时,我得到以下错误:

Traceback (most recent call last):  
File "C:\Users\stava\node_modules\node-red-contrib-machine-learning\nodes\dataset\create-dataset/create-dataset.py",
  line 12, in <module>    df = pandas.read_csv(config['path'], header=None)
File "C:\Users\stava\AppData\Local\conda\conda\envs\py35\lib\site-packages\pandas\io\parsers.py",
  line 678, in parser_f    return _read(filepath_or_buffer, kwds)
File "C:\Users\stava\AppData\Local\conda\conda\envs\py35\lib\site-packages\pandas\io\parsers.py", 
  line 440, in _read    parser = TextFileReader(filepath_or_buffer, **kwds)
File "C:\Users\stava\AppData\Local\conda\conda\envs\py35\lib\site-packages\pandas\io\parsers.py", 
  line 787, in __init__    self._make_engine(self.engine)
File "C:\Users\stava\AppData\Local\conda\conda\envs\py35\lib\site-packages\pandas\io\parsers.py", 
  line 1014, in _make_engine    self._engine = CParserWrapper(self.f, **self.options)
File "C:\Users\stava\AppData\Local\conda\conda\envs\py35\lib\site-packages\p...
Python社区是高质量的Python/Django开发社区
本文地址:http://www.python88.com/topic/33803
 
583 次点击  
文章 [ 1 ]  |  最新文章 5 年前
Stav Alfi
Reply   •   1 楼
Stav Alfi    5 年前
  1. 目前,他们的存储库中有一个已报告且未解决的bug。 bug节点red在节点中找不到您提供给它们的路径的任何文件。 解决方案(适用于Linux发行版和MacOS): 提供文件的完整路径(正如我们在这个项目中所做的那样)。 我们不能让它在Windows中工作。

  2. 这个 decision tree classifier predictor 节点接受数据数组中的数组并返回预测。看看我们是怎么给他发送数据的 message to array for prediction 节点。每个子数组对应于应发送以获得预测的数据:

    return {
            payload: [[...msg.payload.user_code,msg.payload.datetime]]
    };
    

More info and an example of a full working project can be found here.