Ejemplo n.º 1
0
def test_exponential():
    fp = StringIO.StringIO()
    fp.write("dpc1,mean\n")
    fp.write("0,1\n")
    fp.seek(0)

    output = StringIO.StringIO()

    FeaturesInterpreter.init_from_feature_file(SplineModel(), fp, ',', (0, 100)).write(output, ',')
    print output.getvalue()

    fp.close()
    output.close()
Ejemplo n.º 2
0
def test_non_gaussian():
    fp = StringIO.StringIO()
    fp.write("dpc1,mean,.025,.975\n")
    fp.write("0,0,-1,2\n")
    fp.seek(0)

    output = StringIO.StringIO()

    FeaturesInterpreter.init_from_feature_file(SplineModel(), fp, ',', ('-inf', 'inf')).write(output, ',')
    print output.getvalue()

    fp.close()
    output.close()
Ejemplo n.º 3
0
def test_exponential():
    fp = StringIO.StringIO()
    fp.write("dpc1,mean\n")
    fp.write("0,1\n")
    fp.seek(0)

    output = StringIO.StringIO()

    FeaturesInterpreter.init_from_feature_file(SplineModel(), fp, ',',
                                               (0, 100)).write(output, ',')
    print output.getvalue()

    fp.close()
    output.close()
Ejemplo n.º 4
0
def test_gtc(modelfile, distfile):
    with open(modelfile, "r") as modelfp:
        model = SplineModel()
        FeaturesInterpreter.init_from_feature_file(model, modelfp, ',', (SplineModel.neginf, SplineModel.posinf))
        
    with open(distfile, "r") as distfp:
        dist = DistributionModel()
        dist.init_from(distfp, ',')

    output = StringIO.StringIO()

    dist.apply_as_distribution(model).write(output, ',')
    print output.getvalue()

    output.close()
Ejemplo n.º 5
0
def test_non_gaussian():
    fp = StringIO.StringIO()
    fp.write("dpc1,mean,.025,.975\n")
    fp.write("0,0,-1,2\n")
    fp.seek(0)

    output = StringIO.StringIO()

    FeaturesInterpreter.init_from_feature_file(SplineModel(), fp, ',',
                                               ('-inf', 'inf')).write(
                                                   output, ',')
    print output.getvalue()

    fp.close()
    output.close()