Ejemplo n.º 1
0
 def get_battle(self):
     for battle_scene in self.battle_scenes:
         if analyze(self.screenshot, battle_scene, self.threshold) == 1:
             split()
             combat = Battle()
             combat.get_cards()
             break
Ejemplo n.º 2
0
def simple():
    from util import reader
    r = reader.stringSepReader("u.data", "\t")

    from util import split
    train, test1 = split.split(r.getR(), 1234567890)

    from recommender import nonpersonalized
    c = nonpersonalized.randomRec(r.getR(), 3284092)

    from util import test
    test.auc(test1, c.getRec, r)
Ejemplo n.º 3
0
def svd():
    from util import reader
    r = reader.tabSepReader("u.data")

    from util import split
    train, test1 = split.split(r.getR(), 1234567890)

    from recommender import svd
    W, H = svd.learnModel(r.getMaxUid(), r.getMaxIid(),
                          0.0002, train, 1000, 25, r.numberOfTransactions)
    import numpy as np
    np.savez_compressed(
        "SVDModelFile", W=W, H=H)
    # modelf = np.load("BPRMFModelFile" + ".npz")
    # W = modelf['W']
    # H = modelf['H']
    # modelf.close

    from util import test
    t = test.MFtest(W, H, train)
    test.hitrate(test1, t.getRec, 10)
Ejemplo n.º 4
0
def slopeone():
    from util import reader
    r = reader.tabSepReader("u.data")

    from util import split
    train, test1 = split.split(r.getR(), 12320894329854567890)

    from recommender import slopeone
    so = slopeone.slopeone(train)

    # import cPickle
    # output = open("slopeone.npz", "wb")
    # cPickle.dump(so, output, -1)
    # output.close()

    # inputfile = open("slopeone.npz", "rb")
    # so = cPickle.load(inputfile)
    # inputfile.close()

    from util import test
    test.auc(test1, so.getRec, r)
Ejemplo n.º 5
0
def mf():
    from util import reader
    r = reader.tabSepReader("u.data")

    from util import split
    train, test1 = split.split(r.getR(), 1234567890)

    from recommender import mf
    W, H = mf.learnModel(r.getMaxUid(), r.getMaxIid(), 0.01, 0.01, 0.01,
                         0.1, train, 150, 3, r.numberOfTransactions,
                         mf.logLoss, mf.dLogLoss)
    import numpy as np
    # np.savez_compressed(
    #    "BPRMFModelFile", W=W, H=H)
    # modelf = np.load("BPRMFModelFile" + ".npz")
    # W = modelf['W']
    # H = modelf['H']
    # modelf.close

    from util import test
    t = test.MFtest(W, H, train)
    test.hitrate(test1, t.getRec, 10)
Ejemplo n.º 6
0
def fastBPRMF():
    from util import reader
    r = reader.fastStringSepReader("u.data", "\t")

    from util import split
    train, test1 = split.split(r.getR(), 1234567890)

    from recommender import fastBPRMF
    W, H = fastBPRMF.learnModel(r.getMaxUid(), r.getMaxIid(), 0.01, 0.01, 0.01,
                         0.1, train, 150, 3)
    import numpy as np
    # np.savez_compressed(
    #    "BPRMFModelFile", W=W, H=H)
    # modelf = np.load("BPRMFModelFile" + ".npz")
    # W = modelf['W']
    # H = modelf['H']
    # modelf.close

    from recommender import mf
    from util import test
    t = mf.MFrec(W, H, train)
    test.hitrate(test1, t.getRec, 10)
Ejemplo n.º 7
0
from cards.Combat import Combat
from util.clean import clean_tmp
from util.split import split
from interface.Major import Major

clean_tmp()

s = Major()
out = s.recognize()
print(out)
"""
split()
a = Combat()
for crd in a.card_crd:
    print(crd)
"""