MilesCranmer commited on
Commit
2acedc5
·
1 Parent(s): fdc95c9

Clean up anti-patterns

Browse files
Files changed (1) hide show
  1. pysr/sr.py +4 -4
pysr/sr.py CHANGED
@@ -995,8 +995,8 @@ def get_hof(
995
  else:
996
  sympy_symbols = [sympy.Symbol("x%d" % i) for i in range(n_features)]
997
 
998
- for i in range(len(output)):
999
- eqn = sympify(output.loc[i, "Equation"], locals=local_sympy_mappings)
1000
  sympy_format.append(eqn)
1001
 
1002
  # Numpy:
@@ -1026,8 +1026,8 @@ def get_hof(
1026
  )
1027
  torch_format.append(module)
1028
 
1029
- curMSE = output.loc[i, "MSE"]
1030
- curComplexity = output.loc[i, "Complexity"]
1031
 
1032
  if lastMSE is None:
1033
  cur_score = 0.0
 
995
  else:
996
  sympy_symbols = [sympy.Symbol("x%d" % i) for i in range(n_features)]
997
 
998
+ for _, eqn_row in output.iterrows():
999
+ eqn = sympify(eqn_row["Equation"], locals=local_sympy_mappings)
1000
  sympy_format.append(eqn)
1001
 
1002
  # Numpy:
 
1026
  )
1027
  torch_format.append(module)
1028
 
1029
+ curMSE = eqn_row["MSE"]
1030
+ curComplexity = eqn_row["Complexity"]
1031
 
1032
  if lastMSE is None:
1033
  cur_score = 0.0