Esempio n. 1
0
def main(base, suffix, stayWeight, treeOptions, students, useWeka):
    makeDirs(base, False)
    header, studentData = readStudents(base, students)
    filename = makeTemp('.arff')
    try:
        writeData(header, studentData, filename)
        if len(suffix) > 0:
            if suffix[0] != '-':
                suffix = '-' + suffix
        dest = 'common%s' % (suffix)
        createDT(filename, base, dest, stayWeight, treeOptions, useWeka)
    finally:
        os.remove(filename)
Esempio n. 2
0
def main(base,suffix,stayWeight,treeOptions,students,useWeka):
  makeDirs(base,False)
  header,studentData = readStudents(base,students)
  filename = makeTemp('.arff')
  try:
    writeData(header,studentData,filename)
    if len(suffix) > 0:
      if suffix[0] != '-':
        suffix = '-' + suffix
    dest = 'common%s' % (suffix)
    createDT(filename,base,dest,stayWeight,treeOptions,useWeka)
  finally:
    os.remove(filename)
def main(base,suffix,stayWeight,treeOptions,students,useWeka,onlyInd):
  makeDirs(base,False)
  header,studentData = readStudents(base,students)
  for i,student in enumerate(students):
    if (onlyInd is not None) and (i != onlyInd):
      continue
    if len(suffix) > 0:
      if suffix[0] != '-':
        suffix = '-' + suffix
    dest = 'leaveOneOut-%s%s' % (student,suffix)
    print '-------------------'
    print student
    print '-------------------'
    processStudent(base,dest,i,header,studentData,treeOptions,stayWeight,useWeka)
def main(base, suffix, stayWeight, treeOptions, students, useWeka, onlyInd):
    makeDirs(base, False)
    header, studentData = readStudents(base, students)
    for i, student in enumerate(students):
        if (onlyInd is not None) and (i != onlyInd):
            continue
        if len(suffix) > 0:
            if suffix[0] != '-':
                suffix = '-' + suffix
        dest = 'leaveOneOut-%s%s' % (student, suffix)
        print '-------------------'
        print student
        print '-------------------'
        processStudent(base, dest, i, header, studentData, treeOptions,
                       stayWeight, useWeka)