Exemplo n.º 1
0
    def PosRandomDiscreteInstance(self, PosIns, dim, label):
        ins = Instance(dim)

        for i in range(dim.getSize()):
            if label[i] is True:
                ins.setFeature(i, PosIns.getFeature(i))
            else:
                ins.setFeature(i, self.__ro.getUniformInteger(dim.getRegion(i)[0], dim.getRegion(i)[1]))
        return ins
Exemplo n.º 2
0
 def RandomInstance(self, dim, region, label):
     inst = Instance(dim)
     for i in range(dim.getSize()):
         if label[i] is True:
             if dim.getType(i) is True:
                 inst.setFeature(i, self.__ro.getUniformDouble(region[i][0], region[i][1]))
             else:
                 inst.setFeature(i, self.__ro.getUniformInteger(region[i][0], region[i][1]))
     return inst
Exemplo n.º 3
0
    def PosRandomDiscreteInstance(self, PosIns, dim, label):
        ins = Instance(dim)

        for i in range(dim.getSize()):
            if label[i] is True:
                ins.setFeature(i, PosIns.getFeature(i))
            else:
                ins.setFeature(
                    i,
                    self.__ro.getUniformInteger(
                        dim.getRegion(i)[0],
                        dim.getRegion(i)[1]))
        return ins
Exemplo n.º 4
0
 def RandomInstance(self, dim, region, label):
     inst = Instance(dim)
     for i in range(dim.getSize()):
         if label[i] is True:
             if dim.getType(i) is True:
                 inst.setFeature(
                     i,
                     self.__ro.getUniformDouble(region[i][0], region[i][1]))
             else:
                 inst.setFeature(
                     i,
                     self.__ro.getUniformInteger(region[i][0],
                                                 region[i][1]))
     return inst
Exemplo n.º 5
0
 def PosRandomMixInstance(self, PosIns, dim, regi, lab):
     ins = Instance(dim)
     for i in range(dim.getSize()):
         if lab[i] is False:
             ins.setFeature(i, PosIns.getFeature(i))
         else:
             if dim.getType(i) is True: #continue
                 ins.setFeature(i, self.__ro.getUniformDouble(regi[i][0], regi[i][1]))
             else: #discrete
                 ins.setFeature(i, self.__ro.getUniformInteger(dim.getRegion(i)[0], dim.getRegion(i)[1]))
     return ins
Exemplo n.º 6
0
 def PosRandomMixInstance(self, PosIns, dim, regi, lab):
     ins = Instance(dim)
     for i in range(dim.getSize()):
         if lab[i] is False:
             ins.setFeature(i, PosIns.getFeature(i))
         else:
             if dim.getType(i) is True:  #continue
                 ins.setFeature(
                     i, self.__ro.getUniformDouble(regi[i][0], regi[i][1]))
             else:  #discrete
                 ins.setFeature(
                     i,
                     self.__ro.getUniformInteger(
                         dim.getRegion(i)[0],
                         dim.getRegion(i)[1]))
     return ins