Beispiel #1
0
def run_explicit_loop():
    for problem in DATA.explicit_problems:
        prob, target = problem.split(";")
        df = DATA.read_datafile("explicit", prob)

        cols = [col for col in df.columns if not (col == target or col == "T" or (len(col) > 2 and col[:2] == "D_"))]
        ins = df[cols].as_matrix()
        outs = df[target].values

        for i in range(num_runs):
            seed = 23 * i
            print("\n\n", prob, target, ins.shape, outs.shape, "\n=======================\n")
            score, r2, gen = run_gp(ins, outs, seed, problem)
            print(i, problem, seed, gen, score, r2, file=fobj)

        print("\n", file=fobj)

    for problem in DATA.diffeq_problems:
        prob, target = problem.split(";")
        df = DATA.read_datafile("diffeq", prob)

        cols = [col for col in df.columns if not (col == target or col == "T" or (len(col) > 2 and col[:2] == "D_"))]
        ins = df[cols].as_matrix()
        outs = df[target].values

        for i in range(num_runs):
            seed = 23 * i + 1
            print("\n\n", prob, target, ins.shape, outs.shape, "\n=======================\n")
            score, r2, gen = run_gp(ins, outs, seed, problem)
            print(i, problem, seed, gen, score, r2, file=fobj)

        print("\n", file=fobj)
Beispiel #2
0
def run_explicit_loop():
	for problem in DATA.explicit_problems:
		prob,target = problem.split(";")
		df = DATA.read_datafile("explicit", prob)

		cols = [col for col in df.columns if not (col == target or col == "T" or (len(col)>2 and col[:2] == "D_"))]
		ins = df[cols].as_matrix()
		outs = df[target].values    

		print("\n\n", prob, target, ins.shape, outs.shape, "\n=======================\n")


		models = ffx.run(ins,outs, ins,outs, cols)
		for model in models:
			print_model(model.complexity(), model, ins, outs)


	for problem in DATA.diffeq_problems:
		prob,target = problem.split(";")
		df = DATA.read_datafile("diffeq", prob)

		cols = [col for col in df.columns if not (col == target or col == "T" or (len(col)>2 and col[:2] == "D_"))]
		ins = df[cols].as_matrix()
		outs = df[target].values    

		print("\n\n", prob, target, ins.shape, outs.shape, "\n=======================\n")


		models = ffx.run(ins,outs, ins,outs, cols)
		for model in models:
			print_model(model.complexity(), model, ins, outs)
Beispiel #3
0
def run_explicit_loop():
	for problem in DATA.explicit_problems:
		prob,target = problem.split(";")
		df = DATA.read_datafile("explicit", prob)

		print("\n\n", prob, target, df.shape,"\n=======================\n")


		cols = [col for col in df.columns if not (col == target or col == "T" or (len(col)>2 and col[:2] == "D_"))]
		ins = df[cols].as_matrix()
		outs = df[target].values    

		theline_model(ins,outs)
		elastic_model(ins,outs,0.1,0.7)
		

	for problem in DATA.diffeq_problems:
		prob,target = problem.split(";")
		df = DATA.read_datafile("diffeq", prob)

		print("\n\n", prob, target, df.shape,"\n=======================\n")


		cols = [col for col in df.columns if not (col == target or col == "T" or (len(col)>2 and col[:2] == "D_"))]
		ins = df[cols].as_matrix()
		outs = df[target].values    

		theline_model(ins,outs)
		elastic_model(ins,outs,0.1,0.7)
Beispiel #4
0
def run_explicit_loop():
	for problem in DATA.explicit_problems:
		prob,target = problem.split(";")
		df = DATA.read_datafile("explicit", prob)

		cols = [col for col in df.columns if not (col == target or col == "T" or (len(col)>2 and col[:2] == "D_"))]
		ins = df[cols].as_matrix()
		outs = df[target].values    

		print("\n\n", prob, target, ins.shape, outs.shape, "\n=======================\n")


		svr_rbf = svm.SVR(kernel='rbf', C=1e3, gamma=0.1)

		svr_rbf.fit(ins,outs)
		print_model("svr - rbf", svr_rbf, ins,outs)

	for problem in DATA.diffeq_problems:
		prob,target = problem.split(";")
		df = DATA.read_datafile("diffeq", prob)

		cols = [col for col in df.columns if not (col == target or col == "T" or (len(col)>2 and col[:2] == "D_"))]
		ins = df[cols].as_matrix()
		outs = df[target].values    

		print("\n\n", prob, target, ins.shape, outs.shape, "\n=======================\n")


		svr_rbf = svm.SVR(kernel='rbf', C=1e3, gamma=0.1)

		svr_rbf.fit(ins,outs)
		print_model("svr - rbf", svr_rbf, ins,outs)