Random forest for exoplanets

## BEM : beyond the exoplanet mass-radius relation with random forest

Predicting the radius of exoplanets based on its planetary and stellar parameters ### Branca Edmée Marques

A portuguese scientist who worked on nuclear physics in France with Marie Curie

### To install bem

```pip install bem
```

or

```git clone https://github.com/soleneulmer/bem.git
cd bem
python setup.py install
```

### A simple decision tree ### How to run bem:

#### 1. Load dataset and model

```# Load exoplanet and solar system planets dataset
# Plot the dataset radius as a function of mass and equilibrium temperature
bem.plot_dataset(dataset)
```
```# Build the random forest model and predict radius of the dataset
regr, y_test_predict, _, train_test_sets = bem.random_forest_regression(dataset)
```

my_planet = [planetary_mass, semi major axis, eccentricity, stellar radius, stellar effective temperature, stellar mass]

```# Predict a new radius
0.034,
0.02,
0.337,
3505.0,
0.342]]),
my_name=np.array(['GJ 357 b']),
regr=regr,
jupiter_mass=False)
```

#### 3. Compute error bars for the radius predictions

```# Load exoplanet and solar system planets dataset with uncertainties
# Compute the error bars for the test set planets
dataset_errors,
train_test_sets)
bem.plot_true_predicted(train_test_sets,
y_test_predict,
```

```# Load the radial velocity dataset
# Predict the radius of the RV dataset
# Plot the predictions of the RV dataset
```

#### 5. Diagnostic plots

```# Plot the learning curve
bem.plot_learning_curve(regr, dataset)
# Plot the validation curves
bem.plot_validation_curves(regr, dataset, name='features')
bem.plot_validation_curves(regr, dataset, name='tree')
bem.plot_validation_curves(regr, dataset, name='depth')
```

#### 6. LIME explanations

see their github

```# Explain the RF predictions
# of the exoplanets from the test set
bem.plot_LIME_predictions(regr, dataset, train_test_sets)
# LIME explanation for your planet
# in this case GJ 357 b
bem.plot_LIME_predictions(regr, dataset, train_test_sets,
my_pred_planet=my_pred_planet,
```

## Project details 1.0.0

This version 0.1.11 0.1.9 0.1.8 0.1.6 0.1.1 0.1

Uploaded `source`