seen from United States
seen from China
seen from United States
seen from United States

seen from China
seen from United States
seen from Bulgaria

seen from Malaysia
seen from China
seen from United States
seen from China
seen from China
seen from Japan
seen from China

seen from United States

seen from United Kingdom
seen from Indonesia
seen from Türkiye
seen from China

seen from Austria
Running a Classification Tree
Figure 1: Classification Tree (N=2745) for predicting Smoking based on Cigarette Availability and GPA
The decision tree was generated using Cigarette Availability and GPA as explanatory variables and TREG1 as the binary category response variable. The Max Depth of the tree was set to 2.
The First variable used is the GPA of the population which separates it into two subgroups. Low GPA holders tend to smoke more than High GPA holders.
The subgroups are made using the Cigarette Availability. Based on the subdivisions it tells us that Low GPA holders (1152) with easy Cigarette Availability (763) have higher probability of being a Regular Smoker (609/763). High GPA holders (1593) with no easy Cigarette Availability (1158) have lower probability of being a Regular Smoker (1056/1593).
The following syntax was used to generate the above tree
predictors = data_clean[['cigavail','GPA1']]
targets = data_clean.TREG1
classifier=DecisionTreeClassifier(max_depth=2)classifier=classifier.fit(pred_train,tar_train) predictions=classifier.predict(pred_test)
Air Force Social Media Response Tree