Example #1
0
            flag_bootstrapped = True
        if i % 1000 == 0:
            print "processed %s jobs so far" % i

    i = 0
    for i in range(len(X)):
        env.start(job_process(i))
        i = i + 1

    simulate(env)

    if arguments['--interactive'] == True:
        print(arguments)
        from IPython import embed
        embed()

    if tool == "sgd":
        array_to_file(
            pred, arguments["<output_folder>"] + "/prediction_%s_%s_%s" %
            (tool, loss, penalty))
    elif tool == "passive-aggressive":
        array_to_file(
            pred,
            arguments["<output_folder>"] + "/prediction_%s_%s" % (tool, loss))

#interactive?
if arguments['--interactive'] == True:
    print(arguments)
    from IPython import embed
    embed()
Example #2
0
        model.partial_fit(np.array([j]),np.array([yf[i]]))
        #print('5: time is %s,i= %s' % (env.now, i))

        if not flag_bootstrapped:
            flag_bootstrapped=True
        if i % 1000==0:
            print "processed %s jobs so far" %i

    i=0
    for i in range(len(X)):
        env.start(job_process(i))
        i=i+1

    simulate(env)

    if arguments['--interactive']==True:
        print(arguments)
        from IPython import embed
        embed()

    if tool=="sgd":
        array_to_file(pred,arguments["<output_folder>"]+"/prediction_%s_%s_%s" %(tool,loss,penalty))
    elif tool=="passive-aggressive":
        array_to_file(pred,arguments["<output_folder>"]+"/prediction_%s_%s" %(tool,loss))

#interactive?
if arguments['--interactive']==True:
    print(arguments)
    from IPython import embed
    embed()
        yield env.timeout(wait_time + run_time)
        #print('4: time is %s,i= %s' % (env.now, i))
        model.partial_fit(np.array([j]), np.array([yf[i]]))
        #print('5: time is %s,i= %s' % (env.now, i))

        if not flag_bootstrapped:
            flag_bootstrapped = True
        if i % 1000 == 0:
            print "processed %s jobs so far" % i

    i = 0
    for i in range(len(X)):
        env.start(job_process(i))
        i = i + 1

    simulate(env)

    if arguments['--interactive'] == True:
        print(arguments)
        from IPython import embed
        embed()

    array_to_file(pred, "prediction_sgd")

#interactive?
if arguments['--interactive'] == True:
    print(arguments)
    from IPython import embed
    embed()
        yield env.timeout(wait_time+run_time)
        #print('4: time is %s,i= %s' % (env.now, i))
        model.partial_fit(np.array([j]),np.array([yf[i]]))
        #print('5: time is %s,i= %s' % (env.now, i))

        if not flag_bootstrapped:
            flag_bootstrapped=True
        if i % 1000==0:
            print "processed %s jobs so far" %i

    i=0
    for i in range(len(X)):
        env.start(job_process(i))
        i=i+1

    simulate(env)

    if arguments['--interactive']==True:
        print(arguments)
        from IPython import embed
        embed()

    array_to_file(pred,"prediction_sgd")

#interactive?
if arguments['--interactive']==True:
    print(arguments)
    from IPython import embed
    embed()