Introduction:
With 30 different rides at Disneyland, your possibilities are seemingly endless for what your day could look like. Well, not exactly endless, but pretty close. 86,493,225 possibilities to be exact if you only get on 12 rides that day (30 choose 12). This leaves frequent Disneyland visitors, or individuals interested in Data Science, with an interesting question: What is the ideal day at Disneyland?
How it works:
To attempt to answer this question, I applied a neural network to my MATLAB simulation from my previous article, Predicting Disneyland Wait Times through Population Simulations. That article goes into depth on how the simulation works, but essentially it follows different groups around Disneyland as they make ride choices and keeps a running score of their day. A higher score means they had a better day.
To apply a neural network to this data, I designed it to have just 1 layer, with an output and an input layer. The input layer consists of 60 nodes, with 30 being for the group’s ride history, and 30 being for the ride the group just rode. The output layer consisting of 30 nodes will be all of the possible next rides. The idea is that, given what you have already ridden, and what you just rode, the machine will pick your next ride.
To choose the training data, I want to look at the top 10% of scores from a simulated day at Disneyland. These groups obviously made decisions that resulted in a better day, so we want to train the neural network to make these same decisions. For each of these groups in the top 10%, I will take 5 samples from their ride order. In each of these samples, I will take the ride chosen as the correct output, and the ride before that along with the total ride history for the input. This will result in roughly 2,750 different sets of training data for the neural network (10% of around 5,500 groups, with 5 samples each). Below is an example of how each individual training data is collected from the simulation data matrix.
training_data = zeros(num_groups * 5 * 0.1, 60); % initializes the training matrix
correct_output = zeros(num_groups * 5 * 0.1, 30); % initializes the output matrix
index2 = 0; % initializes an index
index3 = 0; % initializes an index
ridebefore = 0; % establishes a variable
output_ride = 0; % establishes a variable
rides_before = []; % establishes an array
top10 = prctile(group_data(:,43),90);
for a2 = 1:num_groups % for all groups in park
if group_data(a2,43) >= top10 % if score is in top 10%
for a1 = 1:5 % collects 5 samples
index3 = 0; % resets an index
rides_before = []; % clears the ride history array
index2 = index2 + 1; % up one increment for data matrix
for a3 = 1:40 % for up to 40 rides in one day
if ride_history(a2,a3) ~= 0 % counts how many rides the group has been on
index3 = index3 + 1;
end
end
random_num3 = randi(index3); % picks a random number from that count
output_ride = ride_history(a2,random_num3); % finds corresponding ride for that random number
if random_num3 ~= 1 % if it's not the first ride of the day
ridebefore = ride_history(a2, random_num3 - 1); % sets this variable to the ride before the next choice
for a4 = 1:(random_num3 - 1)
rides_before(length(rides_before) + 1) = ride_history(a2,a4); % sets ride history to all rides before next choice
end
else
ridebefore = 0; % resets value
rides_before = []; % resets array
end
for a5 = 1:30 % turns previous ride number into binary string from 1-30
if a5 == ridebefore
training_data(index2,a5) = 1; % all 0's except for previous ride
end
end
for a6 = 1:length(rides_before) % turns ride history numbers into binary string from 1-30
for a7 = 1:30
if rides_before(a6) == a7
training_data(index2,a7 + 30) = 1; % all 0's except for rides previously ridden
end
end
end
for a8 = 1:30 % turns chosen ride into binary string from 1-30
if a8 == output_ride
correct_output(index2,a8) = 1; % all 0's except for group's chosen ride
end
end
end
end
end
Now we have our sets of 60 input node values and the corresponding 30 correct output values. We can now use a supervised Machine Learning algorithm with our learning rate set to 0.05. I will be using a sigmoid activation function to keep all of the output values between 0 and 1. Below is my code for this supervised learning algorithm.
dweights = rand(60,30); % assigns random weights to a 60x30 matrix
alpha = 0.05; % learning rate set to 0.05
epochs = 5000; % repeats for training data
for ii = 1:epochs % loop for each epoch
approx_output = 1./(1 + exp(-1 * training_data * dweights)); % finds approximate output
error = correct_output - approx_output; % finds error
delta = (approx_output .*(1-approx_output)).* error; % applies activation function (sigmoid)
ad = alpha .* delta; % extra step for alpha times delta
trans_training = transpose(training_data); % transposes training data matrix
dweights = dweights + (trans_training * ad); % updates weights
end
save('Weights.mat','dweights'); % saves new weights after all epochs
This code reinforces good decisions throughout the weight matrix. Weights will begin to converge to certain values that will help the machine make decisions. Below is an example of 3 different weights converging to certain values over time.

Now, if you give the algorithm what ride you just rode, along with all of your previous rides, it will give the top 3 next rides for you to choose from. Let’s see what an ideal Disneyland day looks like.
The Ideal Disneyland Day:
We know from my previous article, Predicting Disneyland: Strategies to Better Your Disney Day, that smaller groups get on more rides per day. Here are some other tips to consider:
- Arriving early – groups who arrive before the park opens get on more rides per day on average.
- Picking the right first ride – Space Mountain, Matterhorn, and Indiana Jones resulted in more rides per day when being picked as the first ride.
- Choosing closer rides – groups who walked less in between rides had a better chance of getting a higher scoring day.
Assume you pick Space Mountain as your first ride of the day. It is one of the closest big rides to the entrance, so it is always a good choice right away if you arrive early. After getting off of Space Mountain, you enter into the program [24] for the ride you just rode, and [24] for your ride history (Space Mountain is ride 24 in the Simulation). The algorithm chooses… Matterhorn. This makes sense. It is the next closest big ride, and chances are, the wait time is not that long yet. After Matterhorn, you enter [16] for the ride you just rode, and [24, 16] for your ride history. Next up after Matterhorn is… Pirates of the Caribbean. This cycle can be continued throughout a day in the park, with the algorithm constantly giving you the best 3 rides to choose from.
For the best first 5 rides in terms of expected total rides per day, here are the next 11 rides after that according to the Disneyland Ride Choosing Algorithm:

There is a general pattern that the algorithm has found amongst the top groups. If you knock out 2 of the top 5 rides right away, you are setting yourself up to have a good day in the park. Also, the algorithm has found that choosing rides closer to the one you just rode will save you time, which increases your score. Notice how Matterhorn always follows Space Mountain, or how Pirates of the Caribbean and Big Thunder Mountain are always next to each other.
Realistically, planning out and implementing the ideal Disneyland day is near impossible. Ride breakdowns, bathroom breaks, and long waits at restaurants can make it hard to follow The Disneyland Algorithm. However, there are some decisions that most top 10% groups make that you should consider making yourself.
Top 10% Ride Choosing Decisions:
Below shows the ride choices made by groups who had the highest scoring days.

The top groups heavily rode Big Thunder Mountain (4), Pirates of the Caribbean (21), and Haunted Mansion (10). All of these rides are close to each other, and tend to have moderate wait times all day while still providing good thrills.
Top 10% groups tend to get on Indiana Jones, Space Mountain, and Matterhorn first, and then build up their scores by riding the moderate wait time rides mentioned above. Those are the rides that are usually done multiple times in a day.
Start with the important rides, and end with the important rides. Ride the moderate wait time rides multiple times in the middle of the day. Ride the indoor-type rides during the hottest time of the day. All of these things were done by the best groups in the simulation.
Conclusion:
The Disneyland Algorithm is a great way to end my 3-part series on Disneyland data analysis. Applying a neural network to my simulation proved to be a challenging, yet rewarding task. It showed that within the thousands and thousands of raw data points acquired from my simulation, there are some important patterns that you can implement on your next Disney trip.