Changeset 16230 for branches/2929_PrioritizedGrammarEnumeration/HeuristicLab.Algorithms.DataAnalysis.PGE/3.3/go-code/go-pge/problems
- Timestamp:
- 10/11/18 11:37:54 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2929_PrioritizedGrammarEnumeration/HeuristicLab.Algorithms.DataAnalysis.PGE/3.3/go-code/go-pge/problems/data.go
r16183 r16230 128 128 } 129 129 130 func (trainData *PointSet) InitTrainDataF(indepNames []string, depndNames []string, matrix unsafe.Pointer, nEntries int) { 131 trainData.ReadPointSet("C:/Users/Hansi/Desktop/Data.trn") 132 } 133 134 func (trainData *PointSet) InitTestDataF(indepNames []string, depndNames []string, matrix unsafe.Pointer, nEntries int) { 135 trainData.ReadPointSet("C:/Users/Hansi/Desktop/Data.tst") 136 } 137 130 138 func (trainData *PointSet) InitTrainData(indepNames []string, depndNames []string, matrix unsafe.Pointer, nEntries int) { 131 139 trainData.indepNames = indepNames //First line in .trn file 132 140 trainData.numDim = len(trainData.indepNames) 133 141 trainData.depndNames = depndNames //Second line in .trn file 142 134 143 fmt.Printf("Var Names = %v | %v\n", trainData.depndNames, trainData.indepNames) 135 144 var nClum int = len(indepNames) + len(depndNames) … … 141 150 item := (*float64) (unsafe.Pointer( uintptr(unsafe.Pointer(matrix)) + unsafe.Sizeof(float64(0)) * uintptr(elemNr) )) 142 151 pnt.indep = append(pnt.indep, *item) 152 153 if os.Getenv("PGEDEBUG") == "1" { 154 fmt.Printf("Adding independend Test/Train Data (%v,%v): %v\n", i, j, *item) 155 } 143 156 } 144 157 … … 147 160 item := (*float64) (unsafe.Pointer( uintptr(unsafe.Pointer(matrix)) + unsafe.Sizeof(float64(0)) * uintptr(elemNr) )) 148 161 pnt.depnd = append(pnt.depnd, *item ) 162 163 if os.Getenv("PGEDEBUG") == "1" { 164 fmt.Printf("Adding dependend (right side) Test/Train Data (%v, %v): %v\n", i, j, *item) 165 } 149 166 } 150 167 … … 154 171 } 155 172 fmt.Printf("Num Points: %v\n", len(trainData.dataPoints)) 156 } 173 174 //if os.Getenv("PGEDEBUG") == "2" { 175 // DebugPrint(trainData) 176 //} 177 } 178 179 //func (trainData *PointSet) DebugPrint() { 180 // for index, elem in range 181 //} 157 182 158 183 func (d *PointSet) ReadPointSet(filename string) {
Note: See TracChangeset
for help on using the changeset viewer.