dtamayo / spock

🖖 A package to determine whether planetary orbital configurations will live long and prosper
GNU General Public License v3.0
64 stars 15 forks source link

Quickstart Code RuntimeError #18

Closed Rob685 closed 3 years ago

Rob685 commented 3 years ago

The following error arises from Quickstart on the main GitHub SPOCK repo:


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

RuntimeError: The reset parameter is False but there is no n_features_in_ attribute. Is this estimator fitted?
dtamayo commented 3 years ago

See if #17 fixes this for you

Rob685 commented 3 years ago

It does, thanks again!