docs: def sweep(self):
          """
          Runs through entire dataset. 
          Returns TSS error, total correct, total count, pcorrect (a dict of layer data)
          """
          self.preSweep()
          if self.loadOrder == []:
              raise NetworkError('No loadOrder for the inputs. Make sure inputs are properly set.', self.loadOrder)
          if len(self.targets) != 0 and len(self.targets) != len(self.inputs):
              raise NetworkError("Number of inputs does not equal number of targets (inputs=%d, targets=%d)" % (len(self.targets), len(self.inputs)))
          if self.verbosity >= 1: print("Epoch #", self.epoch, "Cycle...")
          if not self.orderedInputs:
              self.randomizeOrder()
          tssError = 0.0; totalCorrect = 0; totalCount = 0; totalPCorrect = {}
          cnt = 0
          if self.saveResults:
              self.results = [(0,0,0) for x in self.loadOrder]
          for i in self.loadOrder:
              if self.verbosity >= 1 or self.interactive:
                  print("-----------------------------------Pattern #", self.loadOrder[i] + 1)
              datum = self.getData(i) # creates a dictionary of input/targets from self.inputs, self.targets
              if cnt < len(self.loadOrder) - 1:
                  self.currentSweepCount = cnt
              else:
                  self.currentSweepCount = None
              self._sweeping = 1
              (error, correct, total, pcorrect) = self.step( **datum )
              self._sweeping = 0
              if self.saveResults:
                  self.results[i] = (error, correct, total, pcorrect)
              tssError += error
              totalCorrect += correct
              totalCount += total
              sumMerge(totalPCorrect, pcorrect)
              if self.sweepReportRate and (cnt + 1) % self.sweepReportRate == 0:
                  print("   Step # %6d | TSS Error: %.4f | Correct: %.4f" % \
                        (cnt + 1, tssError, totalCorrect * 1.0 / totalCount))
              if self.crossValidationSampleRate and self.epoch % self.crossValidationSampleRate == 0:
                  self.saveNetworkForCrossValidation(self.crossValidationSampleFile)
              cnt += 1
          if self.learning and self.batch:
              self.change_weights() # batch mode, otherwise change weights in step
          self.postSweep()
          return (tssError, totalCorrect, totalCount, totalPCorrect)