我正在尝试使用这个库在node-red
中实现最基本的机器学习流程:https://flows.nodered.org/node/node-red-contrib-machine-learning。
这个流程加载一个CSV文件,对其进行洗牌,并创建一个训练和测试分区。
我安装了:
- Python 3.6.4或更高版本,可通过’python’命令访问(在Linux上为’python3’)
- Numpy
- Pandas
- SciKit-Learn
- Tensorflow(可选:可以跳过)
我从Anaconda
中打开了node-red
。
问题:
当点击“Start”节点时,我得到了以下错误:
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...
回答:
-
目前,他们的仓库中有一个已报告但未解决的错误。该错误是Node red无法找到您在节点中提供路径的任何文件。解决方案(适用于Linux发行版和MacOS):提供文件的完整路径(正如我们在本项目中所做的那样)。我们在Windows上无法使其工作。
-
decision tree classifier predictor
节点接受数据数组中的数组并返回预测。请查看我们如何从message to array for prediction
节点发送数据给它。每个子数组对应应发送以获取预测的数据:return { payload: [[...msg.payload.user_code,msg.payload.datetime]]};