I have a dataset is regarding ambulance call data.

Data sample:

     v_type      district   gender  complaint      age  Month
0   Advanced    District 1  Male    Chest Pain      28  jan
1   Advanced    District 2  Male    Heart Problem   50  dec
2   General     District 3  Male    Cardiac Arrest  76  jun
3   Advanced    District 4  Male    Heart Problem   45  oct
4   General     District 5  Female  Cardiac Arrest  52  nov
5   Advanced    District 1  Male    Chest Pain      34  feb
6   Advanced    District 2  Male    Cardiac Arrest  44  jun
7   General     District 3  Female  Heart Problem   55  july
8   Advanced    District 4  Female  Heart Problem   86  may
9   General     District 5  Male    Heart Problem   65  aug
10  General     District 1  Male    Heart Problem   60  nov
11  Advanced    District 2  Male    Chest Pain      36  mar

In the data v_type (Vehicle type) we have Advanced (Advanced featured emergency vehicle) and General (Basic featured emergency vehicle).

How to predict how many advanced or general ambulances should arrange in a district for a particular month?

Example: If in a month (jan) and in district3 has huge complaint then predict and need to show 5 or 6.. Advanced vehicle type is required


1 Answer 1


The first thing to do is to reorganize the data in a way which suits the problem that you're trying to solve: since the goal is to predict the number of each type of vehicle by month, your data should contain a column for this number.

Here you need to count the number of rows for each month and each type of vehicle so that you obtain something like this:

v_type   district    month number
Advanced District 1  jan   1
General  District 1  jan   2
Advanced District 2  jan   0
General  District 2  jan   3
Advanced District 1  feb   2
General  District 1  feb   3

After that you will probably need to represent the month (and year) in a way that a regression algorithm can use, typically an integer starting at month 1.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.