Categories
Guides and Code Samples Machine Learning Examples

Random Forest Classifier – Scikit-learn Titanic Example

Random Forest Classifier Scikit-learn Titanic Example

Here’s a quick example of how to leverage Scikit-learn on JetML.
Workflow Setup
  1. Add the following python packages to your workflow configuration.
				
					scikit-learn
pandas
dtreeviz
				
			
  1. Add the following Bash command
				
					apt-get install -y graphviz
				
			
  1. Run the workflow.
  2. Copy over the example code below into a notebook on the running workflow (download link at the bottom).
Example Notebook

Titanic Random Forest Classifier Example

Import libraries

from sklearn.ensemble import RandomForestClassifier
from sklearn import tree
import dtreeviz
import matplotlib.pyplot as plt
import pandas as pd

Load titanic dataset

passenger_dataframe = pd.read_csv('https://web.stanford.edu/class/archive/cs/cs109/cs109.1166/stuff/titanic.csv')
passenger_dataframe.head()
Survived Pclass Name Sex Age Siblings/Spouses Aboard Parents/Children Aboard Fare
0 0 3 Mr. Owen Harris Braund male 22.0 1 0 7.2500
1 1 1 Mrs. John Bradley (Florence Briggs Thayer) Cum... female 38.0 1 0 71.2833
2 1 3 Miss. Laina Heikkinen female 26.0 0 0 7.9250
3 1 1 Mrs. Jacques Heath (Lily May Peel) Futrelle female 35.0 1 0 53.1000
4 0 3 Mr. William Henry Allen male 35.0 0 0 8.0500

Encode string characters for scikit learn

full_df = pd.get_dummies(passenger_dataframe)
#full_df

Let's choose which features to use

features = ['Sex_female','Sex_male','Fare','Age','Pclass']
X = full_df.loc[:, features]
X.head()
Sex_female Sex_male Fare Age Pclass
0 0 1 7.2500 22.0 3
1 1 0 71.2833 38.0 1
2 1 0 7.9250 26.0 3
3 1 0 53.1000 35.0 1
4 0 1 8.0500 35.0 3

Lets set if this person survived or not, this is what we'll predict

y = passenger_dataframe.Survived
y.head()
0    0
1    1
2    1
3    1
4    0
Name: Survived, dtype: int64

Let's create a random forest with 100 trees

rf_n_estimators = 100 #100 trees will be created
rf_depth= 4 #4 decision nodes per tree
model = RandomForestClassifier(n_estimators=rf_n_estimators, random_state=1, max_depth=rf_depth) #define the model
model.fit(X, y) #Train/fit the model, map the passenger's features (X) to the survival (y)
predicted = model.predict(X) #Use the model to predict 
passenger_dataframe['predict'] = predicted #add the new predictions to the initial passenger dataframe

Inspect first tree

viz = dtreeviz.model(model.estimators_[0], X, y, feature_names=X.columns,class_names=["died", "survived"], target_name="Target")
viz.view()
findfont: Font family ['Arial'] not found. Falling back to DejaVu Sans.
findfont: Font family ['Arial'] not found. Falling back to DejaVu Sans.
findfont: Font family ['Arial'] not found. Falling back to DejaVu Sans.
findfont: Font family ['Arial'] not found. Falling back to DejaVu Sans.


G


cluster_legend



node3

 
  
   
    
    2023-01-09T20:23:02.626487
    image/svg+xml
    
     
      Matplotlib v3.5.2, https://matplotlib.org/
     
    
   
  
 
 
  
 
 
  
   
  
  
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
     
      
       
      
      
       
      
     
     
      
      
       
        
        
        
        
       
       
       
       
       
      
     
    
    
     
      
       
      
     
     
      
      
       
        
       
       
       
       
       
       
      
     
    
    
     
     
      
       
       
       
      
      
      
      
     
    
   
   
    
     
      
       
      
      
       
      
     
     
      
      
       
      
     
    
    
     
      
       
      
     
     
      
      
       
        
        
       
       
       
      
     
    
   
   
    
   
   
    
   
   
    
    
     
      
      
     
     
     
     
     
    
   
  
 
 
  
   
  
 



node6

 
  
   
    
    2023-01-09T20:23:02.781106
    image/svg+xml
    
     
      Matplotlib v3.5.2, https://matplotlib.org/
     
    
   
  
 
 
  
 
 
  
   
  
  
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
     
      
       
      
      
       
      
     
     
      
      
       
        
       
       
      
     
    
    
     
      
       
      
     
     
      
      
       
        
       
       
      
     
    
    
     
     
      
       
       
       
       
       
      
      
      
      
      
      
      
     
    
   
   
    
     
      
       
      
      
       
      
     
     
      
      
       
        
       
       
      
     
    
    
     
      
       
      
     
     
      
      
       
        
       
       
       
      
     
    
   
   
    
   
   
    
   
   
    
    
     
      
      
      
     
     
     
     
     
    
   
  
 
 
  
   
  
 




leaf4


 
  
   
    
    2023-01-09T20:23:04.872283
    image/svg+xml
    
     
      Matplotlib v3.5.2, https://matplotlib.org/
     
    
   
  
 
 
  
 
 
  
   
  
  
   
    
   
   
    
   
   
    
    
     
      
      
      
      
     
     
     
     
     
    
    
    
     
      
      
      
      
      
      
      
     
     
     
     
     
     
     
     
     
    
   
  
 



node3->leaf4





leaf5


 
  
   
    
    2023-01-09T20:23:04.927903
    image/svg+xml
    
     
      Matplotlib v3.5.2, https://matplotlib.org/
     
    
   
  
 
 
  
 
 
  
   
  
  
   
    
   
   
    
    
     
      
      
      
     
     
     
     
    
    
    
     
      
      
      
      
      
      
      
     
     
     
     
     
     
     
     
     
    
   
  
 



node3->leaf5





leaf7


 
  
   
    
    2023-01-09T20:23:04.982255
    image/svg+xml
    
     
      Matplotlib v3.5.2, https://matplotlib.org/
     
    
   
  
 
 
  
 
 
  
   
  
  
   
    
   
   
    
    
     
      
      
      
     
     
     
     
    
    
    
     
      
      
      
      
      
      
      
     
     
     
     
     
     
     
     
     
    
   
  
 



node6->leaf7





leaf8


 
  
   
    
    2023-01-09T20:23:05.043183
    image/svg+xml
    
     
      Matplotlib v3.5.2, https://matplotlib.org/
     
    
   
  
 
 
  
 
 
  
   
  
  
   
    
   
   
    
   
   
    
    
     
      
      
      
      
     
     
     
     
     
    
    
    
     
      
      
      
     
     
     
     
     
    
   
  
 



node6->leaf8





node2

 
  
   
    
    2023-01-09T20:23:02.934888
    image/svg+xml
    
     
      Matplotlib v3.5.2, https://matplotlib.org/
     
    
   
  
 
 
  
 
 
  
   
  
  
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
     
      
       
      
      
       
      
     
     
      
      
       
        
        
        
        
       
       
       
       
       
      
     
    
    
     
      
       
      
     
     
      
      
       
        
       
       
       
       
       
       
      
     
    
    
     
     
      
       
       
       
      
      
      
      
     
    
   
   
    
     
      
       
      
      
       
      
     
     
      
      
       
      
     
    
    
     
      
       
      
     
     
      
      
       
        
        
       
       
       
      
     
    
   
   
    
   
   
    
   
   
    
    
     
      
     
     
     
     
     
    
   
  
 
 
  
   
  
 



node2->node3





node2->node6





node9

 
  
   
    
    2023-01-09T20:23:03.435171
    image/svg+xml
    
     
      Matplotlib v3.5.2, https://matplotlib.org/
     
    
   
  
 
 
  
 
 
  
   
  
  
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
     
      
       
      
      
       
      
     
     
      
      
       
        
       
       
      
     
    
    
     
      
       
      
     
     
      
      
       
        
       
       
      
     
    
    
     
     
      
       
       
       
       
       
      
      
      
      
      
      
      
     
    
   
   
    
     
      
       
      
      
       
      
     
     
      
      
       
        
       
       
      
     
    
    
     
      
       
      
     
     
      
      
       
       
       
      
     
    
   
   
    
   
   
    
   
   
    
    
     
      
      
      
     
     
     
     
     
    
   
  
 
 
  
   
  
 




node10

 
  
   
    
    2023-01-09T20:23:03.091151
    image/svg+xml
    
     
      Matplotlib v3.5.2, https://matplotlib.org/
     
    
   
  
 
 
  
 
 
  
   
  
  
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
     
      
       
      
      
       
      
     
     
      
      
       
        
       
       
      
     
    
    
     
      
       
      
     
     
      
      
       
        
       
       
      
     
    
    
     
     
      
       
       
       
       
       
      
      
      
      
      
      
      
     
    
   
   
    
     
      
       
      
      
       
      
     
     
      
      
       
        
       
       
      
     
    
    
     
      
       
      
     
     
      
      
       
        
        
       
       
       
      
     
    
   
   
    
   
   
    
   
   
    
    
     
      
      
     
     
     
     
     
    
   
  
 
 
  
   
  
 



node13

 
  
   
    
    2023-01-09T20:23:03.245038
    image/svg+xml
    
     
      Matplotlib v3.5.2, https://matplotlib.org/
     
    
   
  
 
 
  
 
 
  
   
  
  
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
     
      
       
      
      
       
      
     
     
      
      
       
        
        
        
        
       
       
       
       
       
      
     
    
    
     
      
       
      
     
     
      
      
       
        
       
       
       
       
       
       
      
     
    
    
     
     
      
       
       
       
      
      
      
      
     
    
   
   
    
     
      
       
      
      
       
      
     
     
      
      
       
      
     
    
    
     
      
       
      
     
     
      
      
       
       
      
     
    
   
   
    
   
   
    
   
   
    
    
     
      
      
      
     
     
     
     
     
     
    
   
  
 
 
  
   
  
 




leaf11


 
  
   
    
    2023-01-09T20:23:05.104669
    image/svg+xml
    
     
      Matplotlib v3.5.2, https://matplotlib.org/
     
    
   
  
 
 
  
 
 
  
   
  
  
   
    
   
   
    
   
   
    
    
     
      
      
      
      
     
     
     
     
     
    
    
    
     
      
      
      
      
      
      
      
     
     
     
     
     
     
     
     
     
    
   
  
 



node10->leaf11





leaf12


 
  
   
    
    2023-01-09T20:23:05.166020
    image/svg+xml
    
     
      Matplotlib v3.5.2, https://matplotlib.org/
     
    
   
  
 
 
  
 
 
  
   
  
  
   
    
   
   
    
   
   
    
    
     
      
      
      
     
     
     
     
     
    
    
    
     
      
      
      
      
      
      
      
     
     
     
     
     
     
     
     
     
    
   
  
 



node10->leaf12





leaf14


 
  
   
    
    2023-01-09T20:23:05.218768
    image/svg+xml
    
     
      Matplotlib v3.5.2, https://matplotlib.org/
     
    
   
  
 
 
  
 
 
  
   
  
  
   
    
   
   
    
   
   
    
    
     
      
      
      
      
     
     
     
     
     
    
    
    
     
      
      
      
      
      
      
      
     
     
     
     
     
     
     
     
     
    
   
  
 



node13->leaf14





leaf15


 
  
   
    
    2023-01-09T20:23:05.273697
    image/svg+xml
    
     
      Matplotlib v3.5.2, https://matplotlib.org/
     
    
   
  
 
 
  
 
 
  
   
  
  
   
    
   
   
    
    
     
      
      
      
      
     
     
     
     
     
    
    
    
     
      
      
      
     
     
     
     
     
    
   
  
 



node13->leaf15





node9->node10





node9->node13





node1

 
  
   
    
    2023-01-09T20:23:03.590703
    image/svg+xml
    
     
      Matplotlib v3.5.2, https://matplotlib.org/
     
    
   
  
 
 
  
 
 
  
   
  
  
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
     
      
       
      
      
       
      
     
     
      
      
       
        
        
        
        
       
       
       
       
       
      
     
    
    
     
      
       
      
     
     
      
      
       
        
       
       
       
       
       
       
      
     
    
    
     
     
      
       
       
       
      
      
      
      
     
    
   
   
    
     
      
       
      
      
       
      
     
     
      
      
       
      
     
    
    
     
      
       
      
     
     
      
      
       
        
       
       
       
      
     
    
   
   
    
   
   
    
   
   
    
    
     
      
      
      
     
     
     
     
     
     
    
   
  
 
 
  
   
  
 



node1->node2





node1->node9





node16

 
  
   
    
    2023-01-09T20:23:04.619993
    image/svg+xml
    
     
      Matplotlib v3.5.2, https://matplotlib.org/
     
    
   
  
 
 
  
 
 
  
   
  
  
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
     
      
       
      
      
       
      
     
     
      
      
       
        
       
       
      
     
    
    
     
      
       
      
     
     
      
      
       
        
       
       
      
     
    
    
     
     
      
       
       
       
       
       
      
      
      
      
      
      
      
     
    
   
   
    
     
      
       
      
      
       
      
     
     
      
      
       
        
       
       
      
     
    
    
     
      
       
      
     
     
      
      
       
        
       
       
       
       
      
     
    
   
   
    
   
   
    
   
   
    
    
     
      
      
     
     
     
     
     
    
   
  
 
 
  
   
  
 




node19

 
  
   
    
    2023-01-09T20:23:03.751163
    image/svg+xml
    
     
      Matplotlib v3.5.2, https://matplotlib.org/
     
    
   
  
 
 
  
 
 
  
   
  
  
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
     
      
       
      
      
       
      
     
     
      
      
       
        
        
        
        
       
       
       
       
       
      
     
    
    
     
      
       
      
     
     
      
      
       
        
       
       
       
       
       
       
      
     
    
    
     
     
      
       
       
       
      
      
      
      
     
    
   
   
    
     
      
       
      
      
       
      
     
     
      
      
       
      
     
    
    
     
      
       
      
     
     
      
      
       
        
        
       
       
       
      
     
    
   
   
    
   
   
    
   
   
    
    
     
      
      
     
     
     
     
     
     
    
   
  
 
 
  
   
  
 



leaf20


 
  
   
    
    2023-01-09T20:23:05.380072
    image/svg+xml
    
     
      Matplotlib v3.5.2, https://matplotlib.org/
     
    
   
  
 
 
  
 
 
  
   
  
  
   
    
   
   
    
   
   
    
    
     
      
      
      
      
     
     
     
     
     
    
    
    
     
      
      
      
      
      
      
      
     
     
     
     
     
     
     
     
     
    
   
  
 



node19->leaf20





leaf21


 
  
   
    
    2023-01-09T20:23:05.442741
    image/svg+xml
    
     
      Matplotlib v3.5.2, https://matplotlib.org/
     
    
   
  
 
 
  
 
 
  
   
  
  
   
    
   
   
    
   
   
    
    
     
      
      
      
      
     
     
     
     
     
    
    
    
     
      
      
      
     
     
     
     
     
    
   
  
 



node19->leaf21





node17

 
  
   
    
    2023-01-09T20:23:03.910355
    image/svg+xml
    
     
      Matplotlib v3.5.2, https://matplotlib.org/
     
    
   
  
 
 
  
 
 
  
   
  
  
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
     
      
       
      
      
       
      
     
     
      
      
       
        
        
       
       
       
       
      
     
    
    
     
      
       
      
     
     
      
      
       
        
        
        
        
       
       
       
       
       
       
      
     
    
    
     
     
      
       
       
       
       
      
      
      
      
      
     
    
   
   
    
     
      
       
      
      
       
      
     
     
      
      
       
      
     
    
    
     
      
       
      
     
     
      
      
       
        
        
       
       
       
      
     
    
   
   
    
   
   
    
   
   
    
    
     
      
     
     
     
     
     
     
    
   
  
 
 
  
   
  
 



node17->node19





node22

 
  
   
    
    2023-01-09T20:23:04.469192
    image/svg+xml
    
     
      Matplotlib v3.5.2, https://matplotlib.org/
     
    
   
  
 
 
  
 
 
  
   
  
  
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
     
      
       
      
      
       
      
     
     
      
      
       
        
        
        
        
       
       
       
       
       
      
     
    
    
     
      
       
      
     
     
      
      
       
        
       
       
       
       
       
       
      
     
    
    
     
     
      
       
       
       
      
      
      
      
     
    
   
   
    
     
      
       
      
      
       
      
     
     
      
      
       
      
     
    
    
     
      
       
      
     
     
      
      
       
       
      
     
    
   
   
    
   
   
    
   
   
    
    
     
      
      
     
     
     
     
     
     
    
   
  
 
 
  
   
  
 




leaf18


 
  
   
    
    2023-01-09T20:23:05.328156
    image/svg+xml
    
     
      Matplotlib v3.5.2, https://matplotlib.org/
     
    
   
  
 
 
  
 
 
  
   
  
  
   
    
   
   
    
    
     
      
      
      
      
     
     
     
     
     
    
    
    
     
      
      
      
     
     
     
     
     
    
   
  
 



node17->leaf18





node23

 
  
   
    
    2023-01-09T20:23:04.068687
    image/svg+xml
    
     
      Matplotlib v3.5.2, https://matplotlib.org/
     
    
   
  
 
 
  
 
 
  
   
  
  
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
     
      
       
      
      
       
      
     
     
      
      
       
        
       
       
      
     
    
    
     
      
       
      
     
     
      
      
       
        
       
       
      
     
    
    
     
     
      
       
       
       
       
       
      
      
      
      
      
      
      
     
    
   
   
    
     
      
       
      
      
       
      
     
     
      
      
       
        
       
       
      
     
    
    
     
      
       
      
     
     
      
      
       
        
        
       
       
       
      
     
    
   
   
    
   
   
    
   
   
    
    
     
      
      
     
     
     
     
     
    
   
  
 
 
  
   
  
 



node26

 
  
   
    
    2023-01-09T20:23:04.315925
    image/svg+xml
    
     
      Matplotlib v3.5.2, https://matplotlib.org/
     
    
   
  
 
 
  
 
 
  
   
  
  
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
     
      
       
      
      
       
      
     
     
      
      
       
        
        
        
        
       
       
       
       
       
      
     
    
    
     
      
       
      
     
     
      
      
       
        
       
       
       
       
       
       
      
     
    
    
     
     
      
       
       
       
      
      
      
      
     
    
   
   
    
     
      
       
      
      
       
      
     
     
      
      
       
      
     
    
    
     
      
       
      
     
     
      
      
       
       
      
     
    
   
   
    
   
   
    
   
   
    
    
     
      
     
     
     
     
     
     
    
   
  
 
 
  
   
  
 




leaf24


 
  
   
    
    2023-01-09T20:23:05.498777
    image/svg+xml
    
     
      Matplotlib v3.5.2, https://matplotlib.org/
     
    
   
  
 
 
  
 
 
  
   
  
  
   
    
   
   
    
    
     
      
      
      
     
     
     
     
    
    
    
     
      
      
      
      
      
      
      
     
     
     
     
     
     
     
     
     
    
   
  
 



node23->leaf24





leaf25


 
  
   
    
    2023-01-09T20:23:05.551856
    image/svg+xml
    
     
      Matplotlib v3.5.2, https://matplotlib.org/
     
    
   
  
 
 
  
 
 
  
   
  
  
   
    
   
   
    
   
   
    
    
     
      
      
      
      
     
     
     
     
     
    
    
    
     
      
      
      
     
     
     
     
     
    
   
  
 



node23->leaf25





leaf27


 
  
   
    
    2023-01-09T20:23:05.612813
    image/svg+xml
    
     
      Matplotlib v3.5.2, https://matplotlib.org/
     
    
   
  
 
 
  
 
 
  
   
  
  
   
    
   
   
    
   
   
    
    
     
      
      
      
      
      
     
     
     
     
     
     
    
    
    
     
      
      
      
     
     
     
     
     
    
   
  
 



node26->leaf27





leaf28


 
  
   
    
    2023-01-09T20:23:05.673471
    image/svg+xml
    
     
      Matplotlib v3.5.2, https://matplotlib.org/
     
    
   
  
 
 
  
 
 
  
   
  
  
   
    
   
   
    
   
   
    
    
     
      
      
      
      
      
     
     
     
     
     
     
    
    
    
     
      
      
      
     
     
     
     
     
    
   
  
 



node26->leaf28





node22->node23





node22->node26





node16->node17





node16->node22





node0

 
  
   
    
    2023-01-09T20:23:04.773490
    image/svg+xml
    
     
      Matplotlib v3.5.2, https://matplotlib.org/
     
    
   
  
 
 
  
 
 
  
   
  
  
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
   
   
    
     
      
       
      
      
       
      
     
     
      
      
       
        
       
       
      
     
    
    
     
      
       
      
     
     
      
      
       
        
       
       
      
     
    
    
     
     
      
       
       
       
       
       
       
       
      
      
      
      
      
      
      
      
      
     
    
   
   
    
     
      
       
      
      
       
      
     
     
      
      
       
      
     
    
    
     
      
       
      
     
     
      
      
       
        
        
        
       
       
       
       
      
     
    
   
   
    
   
   
    
   
   
    
    
     
      
     
     
     
     
     
    
   
  
 
 
  
   
  
 



node0->node1






node0->node16


>











legend


 
  
   
    
    2023-01-09T20:23:02.377319
    image/svg+xml
    
     
      Matplotlib v3.5.2, https://matplotlib.org/
     
    
   
  
 
 
  
 
 
  
   
  
  
   
    
     
    
    
     
     
      
       
       
       
       
       
       
      
      
      
      
      
      
      
     
    
    
     
    
    
     
     
      
       
       
       
      
      
      
      
      
     
    
    
     
    
    
     
     
      
       
       
       
       
      
      
      
      
      
      
      
      
      
     
    
   
  
 


Notes about this project

This was a simple example of how to run scikit-learn's Random Forest on JetML. Easily adapt this project to your own dataset and build out your full ML workflow.