This repository has been archived by the owner on Sep 1, 2023. It is now read-only.
/
searchDef.py
75 lines (64 loc) · 2.22 KB
/
searchDef.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate 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 Affero 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 Affero Public License for more details.
#
# You should have received a copy of the GNU Affero Public License
# along with this program. If not, see http://www.gnu.org/licenses.
#
# http://numenta.org/licenses/
# ----------------------------------------------------------------------
import os
def getSearch(rootDir):
""" This method returns search description. See the following file for the
schema of the dictionary this method returns:
py/nupic/swarming/exp_generator/experimentDescriptionSchema.json
The streamDef element defines the stream for this model. The schema for this
element can be found at:
py/nupicengine/cluster/database/StreamDef.json
"""
# Form the stream definition
dataPath = os.path.abspath(os.path.join(rootDir, 'datasets', 'scalar_1.csv'))
streamDef = dict(
version = 1,
info = "testSpatialClassification",
streams = [
dict(source="file://%s" % (dataPath),
info="scalar_1.csv",
columns=["*"],
),
],
)
# Generate the experiment description
expDesc = {
"environment": 'nupic',
"inferenceArgs":{
"predictedField":"classification",
"predictionSteps": [0],
},
"inferenceType": "MultiStep",
"streamDef": streamDef,
"includedFields": [
{ "fieldName": "field1",
"fieldType": "float",
},
{ "fieldName": "classification",
"fieldType": "string",
},
{ "fieldName": "randomData",
"fieldType": "float",
},
],
"iterationCount": -1,
}
return expDesc