Show HN: Symbolic regression as an MCP tool (SINDy and PySR, free, no install)(occam.fit)
occam.fit
Show HN: Symbolic regression as an MCP tool (SINDy and PySR, free, no install)
https://occam.fit/
2 comments
Python programmers! Complete the interpreter for me!
THIS IS WHAT THE SOURCE CODE LOOKS LIKE: --------------------------------------------------------------------- "ladder - interpreted programming language" "this is a set (S) {1, 2, 3, 4, 5} "" "this is an amount (A) of the set (S) with an interval (I) [0;5) Ai S[i] "" "this is the product (P) of the sum of the "elements of the set (S) and an amount (A) of the set (S) "with an interval (I) I Pi S[i] + A ------------------------------------------------------------ HERE IS A PIECE OF THE INTERPRETER: ------------------------------------------------------------ import sys
SET = []; INTERVAL = []; SUMMA = 0; PRODUCT = 1;
def set_(line): global SET SET = list(map(int, line[1:-1].split(', '))) print(SET)
def interval_(line): global INTERVAL, SUMMA, PRODUCT interval, iterator, expression = line.split(' ') match interval[0]: case '(': l = int(interval[1])+1 case '[': l = int(interval[1]) match interval[-1]: case ')': r = int(interval[-2]) case ']': r = int(interval[-2])+1 INTERVAL = list(range(l, r)) if iterator: match iterator[0]: case 'A': for i in INTERVAL: SUMMA += SET[i] print(SUMMA) case 'P': for i in INTERVAL: PRODUCT = SET[i] print(PRODUCT)
def comment_(line): if line != '""': print(line) if line[-1] == '"': print()
def parse(line): match line[0]: case '"': comment_(line) case '{': set_(line) case '(' | '[': interval_(line) case 'I': print(sum([s*s for s in [e+sum(SET) for e in SET]])) # :-( case _: print(f'ERROR {line}')
def scan(f): for line in f: line = line.strip() if line: parse(line)
if __name__ == '__main__': f = open(sys.argv[1]); scan(f) f.close() ---------------------------------------------------- RESULT -------------------------------------------------- python ladder.py program.l "ladder - interpreted programming language" "this is a set (S) 1 2 3 4 5 "this is an amount (A) of the set (S) with an interval (I) 15 "this is the product (P) of the sum of the "elements of the set (S) and an amount (A) of the set (S) "with an interval (I) 1630
SET = []; INTERVAL = []; SUMMA = 0; PRODUCT = 1;
def set_(line): global SET SET = list(map(int, line[1:-1].split(', '))) print(SET)
def interval_(line): global INTERVAL, SUMMA, PRODUCT interval, iterator, expression = line.split(' ') match interval[0]: case '(': l = int(interval[1])+1 case '[': l = int(interval[1]) match interval[-1]: case ')': r = int(interval[-2]) case ']': r = int(interval[-2])+1 INTERVAL = list(range(l, r)) if iterator: match iterator[0]: case 'A': for i in INTERVAL: SUMMA += SET[i] print(SUMMA) case 'P': for i in INTERVAL: PRODUCT = SET[i] print(PRODUCT)
def comment_(line): if line != '""': print(line) if line[-1] == '"': print()
def parse(line): match line[0]: case '"': comment_(line) case '{': set_(line) case '(' | '[': interval_(line) case 'I': print(sum([s*s for s in [e+sum(SET) for e in SET]])) # :-( case _: print(f'ERROR {line}')
def scan(f): for line in f: line = line.strip() if line: parse(line)
if __name__ == '__main__': f = open(sys.argv[1]); scan(f) f.close() ---------------------------------------------------- RESULT -------------------------------------------------- python ladder.py program.l "ladder - interpreted programming language" "this is a set (S) 1 2 3 4 5 "this is an amount (A) of the set (S) with an interval (I) 15 "this is the product (P) of the sum of the "elements of the set (S) and an amount (A) of the set (S) "with an interval (I) 1630
So I stood up Occam (occam.fit) — a hosted MCP server exposing two tools: run_sindy for sparse identification of dynamics from time series (seconds), and run_pysr for evolutionary symbolic regression returning a Pareto front of expressions by complexity vs. accuracy (10–60s).
The core design decision is a pool of pre-warmed Julia workers running SymbolicRegression.jl v2. Julia processes stay alive between requests so the 2-minute compilation hit is paid once at server startup, not per call.
Free tier, no signup. Happy to answer questions about the architecture or symbolic regression generally, and curious whether anyone has use cases that don't fit the current limits.