Nupic—–HTM学习(Spatial Classification)
如果数据集不含有时间序列,则可以让nupic创建“spatial classification”模型。
packaging, height, weight, category
glass, 6, 16, "salad dressing"
cardboard, 12, 16, "cereal"
plastic, 12, 64, "milk"
plastic, 8, 16, "salad dressing"
...
在这里, “category” 列是模型在所有其他列中给定数据时应输出的内容。与时态问题相比, 在 N-1 (或 N-2、N-3 等) 时的数据与 N 时的输出没有关系。
用OPF创建spatial classification模型
examples/opf/experiments/spatial_classification
这个目录下有一些例子
下面是description.py
中的三个重要区别,来区分spatial classification 和temporal prediction:
(见examples/opf/experiments/spatial_classification/base/description.py
):
- The config[‘modelParams’][‘inferenceType’] will be ‘NontemporalClassification’ (in a temporal prediction experiment it will typically be ‘TemporalMultistep’).
- The config[‘modelparams’][‘clParams’][‘steps’] will be ‘0’.
- The encoder that encodes the predicted field has ‘classifierOnly’ set to True.
在一些设置文件中能找到这些参数
inferenceType 设置告诉OPF应该在模型中放入什么算法组件。在当前的实现中, ’ NontemporalClassification ’ 告诉OPF建立一个只包含encoder和一个classifier的模型(没有空间或时间池)。
config中的参数['modelparams']['clParams']['steps']
告诉classifier将当前输入与预测字段的当前值关联。
predicted field的encoder 的 “classifierOnly” 标志告诉OPF不将此字段放入网络底部。它只会作为分类输入送入classifier。注意: predicted field的名称在control [’ inferenceArgs ‘] [’ predictedField ‘] 的description.py中定义。
还有很多内容并没有翻译
请看原文章:https://discourse.numenta.org/t/spatial-classification/2152