Advanced settings for model parameters in HTM Engine

Hi,

I’ve coded a new release the script create_cpu_percent_model.py with the full set of OPF with default values. So it’s very helpfull for me.

#!/usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2015, Numenta, Inc.  Unless you have purchased from
# Numenta, Inc. a separate commercial license for this software code, the
# following terms and conditions apply:
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see http://www.gnu.org/licenses.
#
# http://numenta.org/licenses/
# ----------------------------------------------------------------------

"""Create the cpu percent model.  See also send_cpu.py and README.md."""

from htmengine.adapters.datasource import createDatasourceAdapter



modelSpec = {
   "datasource": "custom",
    "metricSpec": {
    "metric": "cpu_percent"
  },
  "modelParams": {
    "min": 0,  
    "max": 100 
  },
  "completeModelParams" : {
    "modelConfig" :  {         
			"aggregationInfo": {
				"seconds": 0,
				"fields": [],
				"months": 0,
				"days": 0,
				"years": 0,
				"hours": 0,
				"microseconds": 0,
				"weeks": 0,
				"minutes": 0,
				"milliseconds": 0
			},
			"model": "CLA",
			"version": 1,
			"predictAheadTime": "",
			"modelParams": {
				"sensorParams": {
					"verbosity": 0,
					"encoders": {
						"c0_dayOfWeek": "",
						"c0_timeOfDay": {
							"type": "DateEncoder",
							"timeOfDay": [21, 9.49122334747737],
							"fieldname": "c0",
							"name": "c0"
						},
						"c1": {
							"fieldname": "c1",
							"seed": 42,
							"resolution": 0.8771929824561403,
							"name": "c1",
							"type": "RandomDistributedScalarEncoder"
						},
						"c0_weekend": ""
					},
					"sensorAutoReset": ""
				},
				"anomalyParams": {
					"anomalyCacheRecords": "",
					"autoDetectThreshold": "",
					"autoDetectWaitRecords": 5030
				},
				"spParams": {
					"columnCount": 2048,
					"synPermInactiveDec": 0.0005,
					"maxBoost": 1,
					"spatialImp": "cpp",
					"inputWidth": 0,
					"spVerbosity": 0,
					"synPermConnected": 0.1,
					"synPermActiveInc": 0.0015,
					"seed": 1956,
					"numActiveColumnsPerInhArea": 40,
					"globalInhibition": 1,
					"potentialPct": 0.8
				},
				"trainSPNetOnlyIfRequested": "false",
				"clParams": {
					"alpha": 0.035828933612158,
					"regionName": "CLAClassifierRegion",
					"steps": "1",
					"clVerbosity": 0
				},
				"tpParams": {
					"columnCount": 2048,
					"activationThreshold": 13,
					"pamLength": 3,
					"cellsPerColumn": 32,
					"permanenceInc": 0.1,
					"minThreshold": 10,
					"verbosity": 0,
					"maxSynapsesPerSegment": 32,
					"outputType": "normal",
					"globalDecay": 0,
					"initialPerm": 0.21,
					"permanenceDec": 0.1,
					"seed": 1960,
					"maxAge": 0,
					"newSynapseCount": 20,
					"maxSegmentsPerCell": 128,
					"temporalImp": "cpp",
					"inputWidth": 2048
				},
				"clEnable": "false",
				"spEnable": "true",
				"inferenceType": "TemporalAnomaly",
				"tpEnable": "true"
			}
	},
	
	"inferenceArgs" :  {         
		"predictionSteps": [1],
		"predictedField": "c1",
		"inputPredictedField": "auto"
	},
	
	"timestampFieldName" :  "c0",  
	"valueFieldName" :  "c1"       
	
	}
 }


adapter = createDatasourceAdapter(modelSpec["datasource"])
modelId = adapter.monitorMetric(modelSpec)

print "Model", modelId, "created..."

Feel free to use or to update git .