# spock.nbodyregressor #

## NbodyRegressor Objects #

```
class NbodyRegressor()
```

#### predict_instability_time #

```
| predict_instability_time(sim, tmax=None, archive_filename=None, archive_interval=None, n_jobs=-1, match_training=False)
```

Predict instability time through N-body integration.

**Arguments**:

`sim`

*rebound.Simulation, or list*- Orbital configuration(s) to test`tmax`

*float*- Maximum time to integrate for (in Simulation time units). If passing a list of sims, need to pass a list of tmax of equal length. Defaults to 1e9 innermost planet orbits.`archive_filename`

*str*- Path and filename to store a rebound SimulationArchive of snapshots`archive_interval`

*float*- Time between snapshots for SimulationArchive (in Simulation time units)`n_jobs`

*int*- Number of cores to use for calculation (only if passing more than one simulation). Default: Use all available cores.`match_training`

*bool*- In order to match the exact chaotic trajectory given an input orbital configuration from our training set, need to set match_training=True. False gives an equally valid chaotic realization, and gives a factor of ~2 speedup in evaluation.

**Returns**:

`float`

- Time of instability (Hill sphere crossing), in Simulation time units, or tmax if stable`int`

- 1 if integration reached tmax, 0 if Hill spheres crossed

#### predict_stable #

```
| predict_stable(sim, tmax=None, archive_filename=None, archive_interval=None, n_jobs=-1, match_training=False)
```

Predict whether system is stable up to time=tmax through N-body integration.

**Arguments**:

`sim`

*rebound.Simulation*- Orbital configuration to test`tmax`

*float*- Maximum time to integrate for (in Simulation time units)`archive_filename`

*str*- Path and filename to store a rebound SimulationArchive of snapshots`archive_interval`

*float*- Time between snapshots for SimulationArchive (in Simulation time units)`n_jobs`

*int*- Number of cores to use for calculation (only if passing more than one simulation). Default: Use all available cores.`match_training`

*bool*- In order to match the exact chaotic trajectory given an input orbital configuration from our training set, need to set match_training=True. False gives an equally valid chaotic realization, and gives a factor of ~2 speedup in evaluation.

**Returns**:

`float`

- Time of instability (Hill sphere crossing), in Simulation time units, or tmax if stable`int`

- 1 if integration reached tmax, 0 if Hill spheres crossed