Skip to content
forked from dtamayo/spock

🖖 A package to determine whether planetary orbital configurations will live long and prosper

License

Notifications You must be signed in to change notification settings

bhaskarbharat/spock

 
 

Repository files navigation

SPOCK 🖖

Stability of Planetary Orbital Configurations Klassifier

image image image image image image

image

Quickstart

Let's predict the probability that a given 3-planet system is stable past 1 billion orbits with the XGBoost-based classifier, and then compute its median expected instability time with the deep regressor:

import rebound
from spock import FeatureClassifier, DeepRegressor
feature_model = FeatureClassifier()
deep_model = DeepRegressor()

sim = rebound.Simulation()
sim.add(m=1.)
sim.add(m=1.e-5, P=1., e=0.03, l=0.3)
sim.add(m=1.e-5, P=1.2, e=0.03, l=2.8)
sim.add(m=1.e-5, P=1.5, e=0.03, l=-0.5)
sim.move_to_com()

# XGBoost-based classifier
print(feature_model.predict_stable(sim))
# >>> 0.011505529

# Bayesian neural net-based regressor
median, lower, upper = deep_model.predict_instability_time(sim, samples=10000)
print(int(median))
# >>> 419759

Examples

Colab tutorial for the deep regressor.

The example notebooks contain many additional examples: jupyter_examples/.

Installation

SPOCK is compatible with both Linux and Mac.

Install from master with:

pip install git+https://github.com/dtamayo/spock

SPOCK relies on XGBoost, which has installation issues with OpenMP on Mac OSX. If you have problems (dmlc/xgboost#4477), the easiest way is probably to install homebrew, and:

brew install libomp
pip install git+https://github.com/dtamayo/spock

About

🖖 A package to determine whether planetary orbital configurations will live long and prosper

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 99.9%
  • Shell 0.1%