Spaces:
Sleeping
Sleeping
Johann Brehmer
commited on
Commit
•
edc0ef8
1
Parent(s):
5290229
Fixed equation path
Browse files- pysr/sr.py +4 -2
pysr/sr.py
CHANGED
@@ -12,7 +12,7 @@ import shutil
|
|
12 |
from pathlib import Path
|
13 |
|
14 |
|
15 |
-
global_equation_file =
|
16 |
global_n_features = None
|
17 |
global_variable_names = []
|
18 |
global_extra_sympy_mappings = {}
|
@@ -249,7 +249,9 @@ def pysr(X=None, y=None, weights=None,
|
|
249 |
y = eval(eval_str)
|
250 |
print("Running on", eval_str)
|
251 |
|
|
|
252 |
pkg_directory = Path(__file__).parents[1] / 'julia'
|
|
|
253 |
|
254 |
def_hyperparams = ""
|
255 |
|
@@ -496,7 +498,7 @@ def get_hof(equation_file=None, n_features=None, variable_names=None, extra_symp
|
|
496 |
global_extra_sympy_mappings = extra_sympy_mappings
|
497 |
|
498 |
try:
|
499 |
-
output = pd.read_csv(equation_file + '.bkup', sep="|")
|
500 |
except FileNotFoundError:
|
501 |
print("Couldn't find equation file!")
|
502 |
return pd.DataFrame()
|
|
|
12 |
from pathlib import Path
|
13 |
|
14 |
|
15 |
+
global_equation_file = Path('hall_of_fame.csv')
|
16 |
global_n_features = None
|
17 |
global_variable_names = []
|
18 |
global_extra_sympy_mappings = {}
|
|
|
249 |
y = eval(eval_str)
|
250 |
print("Running on", eval_str)
|
251 |
|
252 |
+
# Absolute paths are necessary for Windows support
|
253 |
pkg_directory = Path(__file__).parents[1] / 'julia'
|
254 |
+
equation_file = Path(equation_file)
|
255 |
|
256 |
def_hyperparams = ""
|
257 |
|
|
|
498 |
global_extra_sympy_mappings = extra_sympy_mappings
|
499 |
|
500 |
try:
|
501 |
+
output = pd.read_csv(str(equation_file) + '.bkup', sep="|")
|
502 |
except FileNotFoundError:
|
503 |
print("Couldn't find equation file!")
|
504 |
return pd.DataFrame()
|