This page uses a fictional stock dataset to build a classification tree and test its rules.
Allow 10–20 minutes. Use the fictional stock dataset below to draw a flowchart and classify a new entry. A stock is a share in a company. Here, “Buy” is the category to predict in a teaching exercise.
Read the columns: volatility describes how much prices fluctuate; analyst rating records a Buy, Neutral, or Sell opinion; trend records whether the price moves up or down. The final Buy: Yes/No column is the label the tree must predict. It is separate from the analyst’s opinion.
| Stock | Volatility | Analyst Rating | Trend | Buy |
|---|---|---|---|---|
| 1 | High | Buy | Up | Yes |
| 2 | Moderate | Neutral | Down | No |
| 3 | Low | Sell | Down | No |
| 4 | High | Buy | Up | Yes |
| 5 | High | Sell | Down | No |
| 6 | Moderate | Buy | Up | Yes |
| 7 | Low | Neutral | Up | Yes |
| 8 | Moderate | Sell | Up | No |
| 9 | Low | Neutral | Down | No |
| 10 | Moderate | Buy | Up | Yes |
| 11 | Low | Sell | Up | No |
| 12 | High | Neutral | Up | Yes |
| 13 | Low | Buy | Down | Yes |
| 14 | High | Buy | Down | No |
- Use Buy: Yes/No as the target class. Start by testing Analyst Rating.
- Draw branches for Buy, Neutral, and Sell. Add volatility or trend questions where the target class is still mixed.
- Follow your tree for all 14 rows. Revise any rule that does not match the dataset.
- Test a new case: High volatility, Buy rating, Down trend. Explain the path and result.
- Write what further evidence you would need before trusting the tree on new data.
See One Tree That Fits the Dataset
| Path | Class |
|---|---|
| Rating = Sell | No |
| Rating = Neutral and trend = Up | Yes |
| Rating = Neutral and trend = Down | No |
| Rating = Buy and volatility = Moderate or Low | Yes |
| Rating = Buy and volatility = High and trend = Up | Yes |
| Rating = Buy and volatility = High and trend = Down | No |
The new case follows Buy → High volatility → Down trend → No. This is one tree consistent with all 14 rows, rather than proof of how it will perform outside this teaching dataset.
You have identified uncertainty, examined assumptions, compared trade-offs and tested rules. Section E applies this toolkit to quantum threats, where a reliable timeline is unavailable.
