Nupic—–HTM學習(Spatial Classification)
如果資料集不含有時間序列,則可以讓nupic建立“spatial classification”模型。
packaging, height, weight, category
glass, , , "salad dressing"
cardboard, , , "cereal"
plastic, , , "milk"
plastic, , , "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