Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/astroautomata/PySR
/ functions
Functions
356 in github.com/astroautomata/PySR
⨍
Functions
356
◇
Types & classes
31
↓ 89 callers
Method
fit
Search for equations to fit the dataset and store them in `self.equations_`. Parameters ---------- X : ndarray | pan
pysr/sr.py:2411
↓ 27 callers
Method
get_best
Get best equation using `model_selection`. Parameters ---------- index : int | list[int] If you wish to
pysr/sr.py:1525
↓ 26 callers
Method
predict
Predict y from input X using the equation chosen by `model_selection`. You may see what equation is used by printing this object. X
pysr/sr.py:2601
↓ 20 callers
Function
jl_array
(x, dtype=None)
pysr/julia_helpers.py:37
↓ 15 callers
Function
_get_batch_size
Calculate the actual batch size to use.
pysr/sr.py:3122
↓ 15 callers
Method
refresh
Update self.equations_ with any new options passed. For example, updating `extra_sympy_mappings` will require a `.refresh()`
pysr/sr.py:2581
↓ 13 callers
Function
sympy2latex
Convert sympy expression to LaTeX with custom precision.
pysr/export_latex.py:23
↓ 12 callers
Function
_run
(cmd: list[str], *, cwd: Path | None = None, env: dict[str, str] | None = None)
pysr/test/test_slurm.py:13
↓ 12 callers
Function
gh_request
(method: str, url: str, token: str, **kwargs)
scripts/paper_image_sync.py:44
↓ 11 callers
Function
env
(name: str, default: str | None = None)
scripts/paper_image_sync.py:37
↓ 10 callers
Method
sympy
Return sympy representation of the equation(s) chosen by `model_selection`. Parameters ---------- index : int | list
pysr/sr.py:2714
↓ 8 callers
Method
from_file
Create a model from a saved model checkpoint or equation file. Parameters ---------- run_directory : str
pysr/sr.py:1225
↓ 8 callers
Method
latex
Return latex representation of the equation(s) chosen by `model_selection`. Parameters ---------- index : int | list
pysr/sr.py:2744
↓ 8 callers
Method
latex_table
Create a LaTeX/booktabs table for all, or some, of the equations. Parameters ---------- indices : list[int] | list[list[int]]
pysr/sr.py:2950
↓ 7 callers
Function
load_package
(package_name: str, uuid_s: str)
pysr/julia_extensions.py:55
↓ 6 callers
Method
_check_macro_str
(self, spec, expected_str)
pysr/test/test_main.py:2238
↓ 6 callers
Method
create_true_latex
(self, middle_part, include_score=False)
pysr/test/test_main.py:1904
↓ 6 callers
Function
idx_model_selection
Select an expression and return its index.
pysr/sr.py:3010
↓ 6 callers
Method
pytorch
Return pytorch representation of the equation(s) chosen by `model_selection`. Each equation (multiple given if there are multiple ou
pysr/sr.py:2818
↓ 6 callers
Function
try_with_registry_fallback
Execute function with modified Julia registry preference. First tries with existing registry preference. If that fails with a Julia registry erro
pysr/julia_registry_helpers.py:15
↓ 5 callers
Method
__repr__
Print all current equations fitted by the model. The string `>>>>` denotes which equation is selected by the `model_selectio
pysr/sr.py:1364
↓ 5 callers
Method
jax
Return jax representation of the equation(s) chosen by `model_selection`. Each equation (multiple given if there are multiple output
pysr/sr.py:2782
↓ 4 callers
Method
_template_macro_str
(self)
pysr/expression_specs.py:272
↓ 4 callers
Function
fail
(msg: str)
scripts/validate_papers_yml.py:29
↓ 4 callers
Method
get_equation_file
(self, i: int | None = None)
pysr/sr.py:2853
↓ 4 callers
Function
is_nonempty_str
(x: object)
scripts/validate_papers_yml.py:34
↓ 4 callers
Function
manually_create_model
(equations, feature_names=None)
pysr/test/test_main.py:1306
↓ 3 callers
Function
_check_assertions
( X, use_custom_variable_names, variable_names, complexity_of_variables, weights, y,
pysr/sr.py:182
↓ 3 callers
Function
_process_constraints
( operators: dict[int, list[str]], constraints: dict[str, int | tuple[int, ...]], )
pysr/sr.py:84
↓ 3 callers
Function
_subscriptify
Converts integer to subscript text form. For example, 123 -> "₁₂₃".
pysr/utils.py:58
↓ 3 callers
Function
_validate_elementwise_loss
Check whether a Julia `elementwise_loss` accepts the expected inputs. The function probes the loss with two or three arguments, depending on
pysr/sr.py:238
↓ 3 callers
Function
jl_is_function
(f)
pysr/julia_helpers.py:54
↓ 3 callers
Function
merge_trials
Merge two hyperopt trials objects :trials1: The primary trials object :trials2_slice: A slice of the trials object to be merged, obta
benchmarks/hyperparamopt.py:183
↓ 3 callers
Function
run_feature_selection
Find most important features. Uses a gradient boosting tree regressor as a proxy for finding the k most important features in X, returni
pysr/feature_selection.py:17
↓ 3 callers
Function
sympy2torch
Returns a module for a given sympy expression with trainable parameters; This function will assume the input to the module is a matrix X, where
pysr/export_torch.py:190
↓ 2 callers
Function
_accepts_npos
(m, npos: int)
pysr/sr.py:285
↓ 2 callers
Method
_checkpoint
Save the model's current state to a checkpoint file. This should only be used internally by PySRRegressor.
pysr/sr.py:1470
↓ 2 callers
Method
_clear_equation_file_contents
(self)
pysr/sr.py:1610
↓ 2 callers
Method
_get_precision_mapped_dtype
(self, X: np.ndarray)
pysr/sr.py:1866
↓ 2 callers
Method
_lambda
(self)
pysr/export_numpy.py:53
↓ 2 callers
Method
_postprocess_dataframe
(self, df: pd.DataFrame)
pysr/sr.py:2894
↓ 2 callers
Function
_preprocess_julia_floats
(s: str)
pysr/utils.py:40
↓ 2 callers
Function
_reduce
(fn)
pysr/export_torch.py:11
↓ 2 callers
Function
_search_output_to_callable_expressions
( equations: pd.DataFrame, search_output, i: int | None )
pysr/expression_specs.py:409
↓ 2 callers
Function
_suggest_keywords
(cls, k: str)
pysr/utils.py:66
↓ 2 callers
Method
_validate_and_modify_params
Ensure parameters passed at initialization are valid. Also returns a dictionary of parameters to update from their values gi
pysr/sr.py:1613
↓ 2 callers
Function
_validate_custom_objective
( custom_objective, *, knob, signature, other_alternative=None, )
pysr/sr.py:273
↓ 2 callers
Method
_validate_data_X_y
(self, X: Any, y: Any)
pysr/sr.py:1852
↓ 2 callers
Function
_validate_export_mappings
(extra_jax_mappings, extra_torch_mappings)
pysr/sr.py:324
↓ 2 callers
Function
best_lossless
(im: Image.Image)
scripts/paper_image_sync.py:172
↓ 2 callers
Function
best_quantized
(im: Image.Image)
scripts/paper_image_sync.py:183
↓ 2 callers
Method
close
Close the logger instance.
pysr/logger_specs.py:25
↓ 2 callers
Function
comment_on_pr
(repo: str, pr_number: int, token: str, body: str)
scripts/paper_image_sync.py:362
↓ 2 callers
Function
denoise
Denoise the dataset using a Gaussian process.
pysr/denoising.py:11
↓ 2 callers
Function
format_docstring
Format a parsed docstring as markdown with nice tables.
docs/gen_api.py:62
↓ 2 callers
Function
format_signature
Get the signature of a function/method.
docs/gen_api.py:53
↓ 2 callers
Function
get_file_bytes_at_ref
(repo: str, path: str, ref: str, token: str)
scripts/paper_image_sync.py:124
↓ 2 callers
Method
get_hof
Get the equations from a hall of fame file or search output. If no arguments entered, the ones used previously from a call to PySR wi
pysr/sr.py:2905
↓ 2 callers
Function
jl_deserialize
(s: NDArray[np.uint8])
pysr/julia_helpers.py:65
↓ 2 callers
Function
jl_serialize
(obj: Any)
pysr/julia_helpers.py:58
↓ 2 callers
Function
load_required_packages
( *, turbo: bool = False, bumper: bool = False, autodiff_backend: Literal["Zygote", "Mooncake"
pysr/julia_extensions.py:12
↓ 2 callers
Function
parametric_expression_deprecation_warning
( max_parameters: int, variable_names: ArrayLike[str] )
pysr/expression_specs.py:321
↓ 2 callers
Function
pysr2sympy
( equation: str | float | int, *, feature_names_in: ArrayLike[str] | None = None, extra_sympy_
pysr/export_sympy.py:89
↓ 2 callers
Function
save_png
(im: Image.Image, *, level: int)
scripts/paper_image_sync.py:166
↓ 2 callers
Function
sympy2jax
Returns a function f and its parameters; the function takes an input matrix, and a list of arguments: f(X, parameters) where the p
pysr/export_jax.py:117
↓ 2 callers
Function
sympy2latextable
Generate a booktabs-style LaTeX table for a single set of equations.
pysr/export_latex.py:62
↓ 1 callers
Method
__init__
(self, *, expr, _memodict, _func_lookup, **kwargs)
pysr/export_torch.py:90
↓ 1 callers
Function
_apply_regexp_im
(x: str)
pysr/utils.py:28
↓ 1 callers
Function
_apply_regexp_im_sci
(x: str)
pysr/utils.py:32
↓ 1 callers
Function
_apply_regexp_sci
(x: str)
pysr/utils.py:36
↓ 1 callers
Method
_call_template_macro
(self)
pysr/expression_specs.py:269
↓ 1 callers
Function
_escape_filename
Turn a path into a string with correctly escaped backslashes.
pysr/julia_helpers.py:23
↓ 1 callers
Method
_get_cache_key
(self)
pysr/expression_specs.py:237
↓ 1 callers
Function
_handle_feature_selection
( X: ndarray, select_k_features: int | None, y: ndarray, variable_names: ArrayLike[str], )
pysr/feature_selection.py:44
↓ 1 callers
Function
_initialize_jax
()
pysr/export_jax.py:101
↓ 1 callers
Function
_initialize_torch
()
pysr/export_torch.py:23
↓ 1 callers
Function
_load_cluster_manager
(cluster_manager: str)
pysr/julia_helpers.py:32
↓ 1 callers
Method
_load_new_format
( self, combine: str, *, expressions: list[str], variable_names: list[
pysr/expression_specs.py:224
↓ 1 callers
Method
_load_old_format
( self, function_symbols: list[str], combine: str, num_features: dict[str, int
pysr/expression_specs.py:213
↓ 1 callers
Function
_map_parallelism_params
Map old and new parallelism parameters to the new format. Parameters ---------- parallelism : str or None New parallelism paramet
pysr/sr.py:3158
↓ 1 callers
Function
_maybe_create_inline_operators
( operators: dict[int, list[str]], extra_sympy_mappings: dict[str, Callable] | None, expression_sp
pysr/sr.py:141
↓ 1 callers
Method
_multiprocessing_turbo_custom_objective
(self, loss_key)
pysr/test/test_main.py:119
↓ 1 callers
Function
_mutate_parameter
(param_name: str, param_value)
pysr/sr.py:3136
↓ 1 callers
Method
_pre_transform_training_data
Transform the training data before fitting the symbolic regressor. This method also updates/sets the `selection_mask_` attribute.
pysr/sr.py:1874
↓ 1 callers
Function
_prepare_guesses_for_julia
Convert Python guesses to Julia format. Parameters ---------- guesses : list[str] | list[list[str]] | list[dict[str, str]] | list[list[di
pysr/sr.py:3065
↓ 1 callers
Method
_read_equation_file
Read the hall of fame file created by `SymbolicRegression.jl`.
pysr/sr.py:2863
↓ 1 callers
Method
_run
Run the symbolic regression fitting process on the julia backend. Parameters ---------- X : ndarray Trai
pysr/sr.py:1989
↓ 1 callers
Method
_run_autodiff_backend
( self, backend: Literal["Zygote", "Mooncake", "Enzyme"] )
pysr/test/test_autodiff.py:26
↓ 1 callers
Function
_safe_check_feature_names_in
_check_feature_names_in with compat for old versions.
pysr/utils.py:48
↓ 1 callers
Method
_setup_equation_file
Set the pathname of the output directory.
pysr/sr.py:1581
↓ 1 callers
Method
_validate_and_set_fit_params
Validate the parameters passed to the :term`fit` method. This method also sets the `nout_` attribute. Parameters --
pysr/sr.py:1703
↓ 1 callers
Function
_validate_custom_expression_objective
(custom_loss_expression)
pysr/sr.py:316
↓ 1 callers
Function
_validate_custom_full_objective
(custom_full_objective)
pysr/sr.py:307
↓ 1 callers
Method
_validate_data_X
(self, X: Any)
pysr/sr.py:1859
↓ 1 callers
Method
_wait_for_cluster_ready
(self, *, timeout_s: int)
pysr/test/test_slurm.py:94
↓ 1 callers
Function
add_export_formats
Create export formats for an equations dataframe. Returns a new dataframe containing only the exported formats.
pysr/export.py:17
↓ 1 callers
Function
assert_valid_sympy_symbol
(var_name: str)
pysr/export_sympy.py:111
↓ 1 callers
Function
calculate_scores
Calculate scores for each equation based on loss and complexity. Score is defined as the negated derivative of the log-loss with respect to compl
pysr/sr.py:3031
↓ 1 callers
Method
create_exports
( self, model: PySRRegressor, equations: pd.DataFrame, search_output,
pysr/expression_specs.py:93
↓ 1 callers
Method
create_logger
Create a logger instance.
pysr/logger_specs.py:15
next →
1–100 of 356, ranked by callers