Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
10/11/18 11:37:54 (6 years ago)
Author:
hmaislin
Message:

#2929: Adapted pge plugin to check for null value

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  
    128128}
    129129
     130func (trainData *PointSet) InitTrainDataF(indepNames []string, depndNames []string, matrix unsafe.Pointer, nEntries int) {
     131  trainData.ReadPointSet("C:/Users/Hansi/Desktop/Data.trn")
     132}
     133
     134func (trainData *PointSet) InitTestDataF(indepNames []string, depndNames []string, matrix unsafe.Pointer, nEntries int) {
     135  trainData.ReadPointSet("C:/Users/Hansi/Desktop/Data.tst")
     136}
     137
    130138func (trainData *PointSet) InitTrainData(indepNames []string, depndNames []string, matrix unsafe.Pointer, nEntries int) {
    131139  trainData.indepNames = indepNames  //First line in .trn file
    132140  trainData.numDim = len(trainData.indepNames)
    133141  trainData.depndNames = depndNames //Second line in .trn file
     142 
    134143  fmt.Printf("Var Names = %v | %v\n", trainData.depndNames, trainData.indepNames)
    135144  var nClum int = len(indepNames) + len(depndNames)
     
    141150      item := (*float64) (unsafe.Pointer( uintptr(unsafe.Pointer(matrix)) + unsafe.Sizeof(float64(0)) * uintptr(elemNr) ))
    142151      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      }
    143156    }
    144157
     
    147160      item := (*float64) (unsafe.Pointer( uintptr(unsafe.Pointer(matrix)) + unsafe.Sizeof(float64(0)) * uintptr(elemNr) ))
    148161      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      }
    149166    }
    150167
     
    154171  }
    155172  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//}
    157182
    158183func (d *PointSet) ReadPointSet(filename string) {
Note: See TracChangeset for help on using the changeset viewer.