<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/symbolic-learning-in-python-and-julia-1ntjxqpm6" -->

---
title: Symbolic Learning in Python and Julia | daily.dev
description: PySR is an open-source Python and Julia tool for symbolic regression, searching for interpretable mathematical expressions that fit a dataset. It's installed...
canonical: https://daily.dev/posts/symbolic-learning-in-python-and-julia-1ntjxqpm6
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Symbolic Learning in Python and Julia | daily.dev
og:description: PySR is an open-source Python and Julia tool for symbolic regression, searching for interpretable mathematical expressions that fit a dataset. It's installed...
og:url: https://daily.dev/posts/symbolic-learning-in-python-and-julia-1ntjxqpm6
og:image: https://api.daily.dev/og/posts/1NtJxQpM6.png
og:image:alt: Symbolic Learning in Python and Julia
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Symbolic Learning in Python and Julia

**[Hacker News](https://daily.dev/sources/hn)** · 13 min read · 0 upvotes · 0 comments

## Summary

PySR is an open-source Python and Julia tool for symbolic regression, searching for interpretable mathematical expressions that fit a dataset. It's installed with 'pip install pysr' or via conda, and its search engine runs on the Julia library SymbolicRegression.jl. The scikit-learn-style PySRRegressor launches a multithreaded Julia process that searches for equations fitting the dataset. Results come back as a pandas DataFrame with equations in callable, SymPy, JAX and PyTorch formats. The project also ships an AI agent skill installable via 'npx skills add astroautomata/PySR' for use in agentic coding workflows.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://github.com/astroautomata/PySR>

## Questions this post answers

### How do I install PySR for symbolic regression in Python?

PySR is installed with 'pip install pysr' or 'conda install -c conda-forge pysr'. Julia dependencies are automatically installed at first import, since PySR's search engine runs on the Julia library SymbolicRegression.jl. A Docker or Apptainer container is also available for systems without local install access or root permissions.

_daily.dev surfaces setup details like this for developers adopting symbolic regression tooling._

### What formats can PySR export a fitted symbolic regression equation to?

A fitted PySR model stores equations in a pandas DataFrame that includes a callable lambda format and a SymPy format, accessible via model.sympy(). It also provides differentiable JAX and PyTorch representations through model.jax() and model.pytorch(), making the discovered equation usable directly inside neural network pipelines.

_Developers comparing interpretable modeling tools track export options like these on daily.dev._

### How can symbolic regression be used to interpret a trained neural network?

Symbolic regression can convert a neural network into an explicit analytic equation through a technique called 'Symbolic Distillation', applied for example to N-body physics problems. This approach extends symbolic regression, which works best on low-dimensional data, to higher-dimensional spaces by distilling what a neural net learned into a closed-form expression.

_Those exploring interpretable ML techniques follow approaches like this on daily.dev._

## Community take

How the wider developer community reacted, aggregated from 1 discussion and 17 comments across hackernews (as of 2026-10-25).

**TL;DR:** Technical users engage with PySR's algorithmic choices and related tools, but a detailed critique alleges the project's recent example code is low-quality AI-generated

**Sentiment:** 20% positive · 35% mixed · 45% skeptical

**The case for**

- Some find it notable that the field of symbolic regression is getting mainstream attention.
- The ability to compile the Julia backend via juliac with a single command is seen as a useful feature.

**The pushback**

- A detailed critique argues recent example code in the repo is AI-generated 
-  slop
-  with a flawed, manipulable loss function design that mostly just rediscovers LFSRs.
- Running a Python project that also spins up a Julia process is criticized for adding two interpreters, two garbage collectors, and significant memory overhead with nondeterministic JIT-related performance.
- One commenter argues that anyone still relying on genetic/evolutionary algorithms for symbolic regression, rather than newer deterministic methods, may not fully understand the problem space.

**By community**

- hackernews (mixed): Discussion mixes genuine technical interest (deterministic SR algorithms, Julia compilation, related tools) with a sharp critique calling out apparent AI-generated slop in the example code and overhead concerns about mixing Python and Julia.

**Hottest debate:** Whether the project's quality has declined due to low-effort AI-generated examples with a flawed loss-function design, versus the core tool still being solid.

**Open questions**

- Has anyone tested this on the n-body problem?
- How do you fairly measure and compare prediction quality for symbolic/deterministic models while penalizing complexity?

**Highlights**

> PySR itself is still alright, mostly because of previous development. But not for long. Quality control has collapsed, and e.g. the examples in the repo are now embarrassing vibeslop. Pangram reports 100% AI on most comment blurbs in the examples directory. That in itself is not the problem, AI-generated code could still be valid. But in this case, the AI-generated examples have the characteristic shape of slop: plausible sounding technical jargon, combined with zero actual understanding of either the target domain, or even evolutionary search (loss function design). They were vibed by people who had no idea what they were doing. I suggest taking a look at the "evolved PRNG" example [1]. First, its loss function is basically designed to reward discovering linear feedback shift registers (LFSRs) only. It deliberately gives a massively lower loss to LFSRs than most other functions. The AI slop phrased this in terms of "certifying the period", but the period certificate used only identifies LFSRs of max period, is unsound on the rest of the search space, and gives a meaningless very high loss to most non-LFSRs. So the regression will almost always just return an LFSR. Whoever designed the example (Codex I suppose) also knew that most LFSRs are defective, and make poor random number generators. Thus, they included a "shear" penalty to detect such defective LFSRs, but of course they slopped it together. The 360 correlations they measure should have been added together (having just one strong correlation is bad, and having two strong correlations is twice as bad as havin one). Instead, they take the MEAN of the correlations, so a perfect correlation contributes only 1/360=0.00278 to the loss. And indeed, the result of their example run, reported in the docs [2] has such a perfect correlation: bit 29 is copied to bit 31 every two iterations. [1] https://github.com/astroautomata/PySR/blob/master/examples/p... [2] https://pysr.ai/v2.7.0/examples/objectives#inventing-a-pseud...
> — [saithound on hackernews · 1 comments](https://news.ycombinator.com/item?id=50227137)

> Yay now when you load your python project you have 2 interpreters, 2 gcs, 200mb of ram overhead, and nondeterministic performance due to joat.
> — [thatsabadlook on hackernews](https://news.ycombinator.com/item?id=50224318)

> > by people who had no idea what they were doing. I would personally hold this opinion of anyone still using genetic/evolutionary inspired algorithms for symbolic regression. There are multiple deterministic algorithms that do not have the same inherent drawbacks and are generally quite good. Before I wrote my algo, and was trying to scale out GP, I hit the limits of RNG and had to go find some with seriously huge cycle properties. (howany calls before they reached the end and started over producing the same sequence)
> — [verdverm on hackernews](https://news.ycombinator.com/item?id=50227406)

> How do we measure and compare prediction quality in a symbolic/deterministic context that also punish for complexity? I struggled on this in my phd thesis and had to brew my own Minimum Description Length implementation because I found nothing applicable. The statisticians I interrogated were like "don't try to do model selection on symbolic models, make them probabilistic and work from there"
> — [brumar on hackernews · 2 comments](https://news.ycombinator.com/item?id=50225929)

**Source threads**

- [hackernews](https://news.ycombinator.com/item?id=50171936) · 59 points · 17 comments

## Similar posts on daily.dev

- [PySDR: A Guide to SDR and DSP using Python](https://daily.dev/posts/pysdr-a-guide-to-sdr-and-dsp-using-python-9hdh6uw9y) · Hacker News · 2 upvotes · 0 comments
- [Spyder: Your IDE for Data Science Development in Python – Real Python](https://daily.dev/posts/spyder-your-ide-for-data-science-development-in-python-real-python-lyjb7oq0d) · Real Python · 0 upvotes · 0 comments
- [One API to Rule Them All: py123d \+ FiftyOne for Autonomous Driving Data](https://daily.dev/posts/one-api-to-rule-them-all-py123d-fiftyone-for-autonomous-driving-data-it8xwsrm5) · Medium · 0 upvotes · 0 comments

---

Tags: [#python](https://daily.dev/tags/python), [#data-science](https://daily.dev/tags/data-science), [#distributed-systems](https://daily.dev/tags/distributed-systems), [#automl](https://daily.dev/tags/automl)

[View this post on daily.dev](https://daily.dev/posts/symbolic-learning-in-python-and-julia-1ntjxqpm6)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Symbolic Learning in Python and Julia","url":"https://daily.dev/posts/symbolic-learning-in-python-and-julia-1ntjxqpm6","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/symbolic-learning-in-python-and-julia-1ntjxqpm6"},"datePublished":"2026-10-24T23:10:42.047Z","dateModified":"2026-10-25T02:41:26.809Z","description":"PySR is an open-source Python and Julia tool for symbolic regression, searching for interpretable mathematical expressions that fit a dataset. It's installed...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/17437405769ef93d51a067bf542a49ec?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/17437405769ef93d51a067bf542a49ec?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Hacker News","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Hacker News","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/hn","url":"https://daily.dev/sources/hn"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/symbolic-learning-in-python-and-julia-1ntjxqpm6","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"python,data-science,distributed-systems,automl","timeRequired":"PT13M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Hacker News","item":"https://daily.dev/sources/hn"},{"@type":"ListItem","position":3,"name":"Symbolic Learning in Python and Julia"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/symbolic-learning-in-python-and-julia-1ntjxqpm6#faq","mainEntity":[{"@type":"Question","name":"How do I install PySR for symbolic regression in Python?","acceptedAnswer":{"@type":"Answer","text":"PySR is installed with 'pip install pysr' or 'conda install -c conda-forge pysr'. Julia dependencies are automatically installed at first import, since PySR's search engine runs on the Julia library SymbolicRegression.jl. A Docker or Apptainer container is also available for systems without local install access or root permissions. daily.dev surfaces setup details like this for developers adopting symbolic regression tooling."}},{"@type":"Question","name":"What formats can PySR export a fitted symbolic regression equation to?","acceptedAnswer":{"@type":"Answer","text":"A fitted PySR model stores equations in a pandas DataFrame that includes a callable lambda format and a SymPy format, accessible via model.sympy(). It also provides differentiable JAX and PyTorch representations through model.jax() and model.pytorch(), making the discovered equation usable directly inside neural network pipelines. Developers comparing interpretable modeling tools track export options like these on daily.dev."}},{"@type":"Question","name":"How can symbolic regression be used to interpret a trained neural network?","acceptedAnswer":{"@type":"Answer","text":"Symbolic regression can convert a neural network into an explicit analytic equation through a technique called 'Symbolic Distillation', applied for example to N-body physics problems. This approach extends symbolic regression, which works best on low-dimensional data, to higher-dimensional spaces by distilling what a neural net learned into a closed-form expression. Those exploring interpretable ML techniques follow approaches like this on daily.dev."}}]}
```

