# What are recommended methods for multi-task prediction?

Currently, we are working on a school project which is trying to predict the number of crimes in some area/neighbourhood.

There are 8 different categories for crimes and we've tried to find the correlation among those categories and now we only have 4 left. Instead of building a model for each category, we want to predict these 4 categories simultaneously by some multi-output algorithm.

Our sample size is around 27,000 for 6 years (from 2011 to 2016, 4000+ for each year). We are going to use (maybe) cross-validation to build/test our model.

Would you please list 2-3 algorithms which already have fully or partially implemented library in Python (preferred) or R you would recommend to use with our dataset scale? I only found scikit-learn with this algorithm. But it's for classification rather then prediction numbers.

This is a intro-level ML course project, the group is not very experienced in the field and the time is limited so we don't want to implement an algorithm from scratch.

• Welcome to Data science SE. It is very hard to answer your question since everything depends on the data you have and what you are trying to predict. Moreover, I assume your professor wants you to do research and not get an answer from SE. I would recommend to do your own independent research. Commented Nov 15, 2016 at 6:52
• @Stereo Well actually he encouraged us find answer and suggestion from the community... We've tried to do some research, except for NN, most of the algorithm are about classification. We are doing something similar to a linear regression (Of course, linear regression is a simple one), say, input [x_1=unemployment rate, x_2=avg assessment value, x_3, x_4...] and then try to have a [y_1=homicide #, y_2=robbery #, .. ] as our prediction target. Now we have about 40 features and 3-4 y_i to predict. Commented Nov 15, 2016 at 11:28

For the project, do you need to explain exactly how the input variables gave you the predictions? If so, trees based methods (R library 'tree', 'rpart') and Logistic Regression would be easy to explain to your stakeholder / lecturer.

If this explanation is not that important, or you could get by just showing the relative predictor importance, and you'd like to focus on accuracy. XGBoost is my default recommendation for multi-class predictions that I use at work on a daily basis. If XGBoost has too many parameters for your liking, you could try randomForest which only has 2 main parameters to tune. Both XGBoost and randomForest have functions for variable importance measures. (R Library XGBoost and randomForest)

• Thanks for your suggestion, but the problem is our final target is predicting a value (actually, a group of values) rather than classify the crime category. Say, by using multi-task linear regression, we can build a model to do so. Commented Nov 15, 2016 at 4:30

I am a little confused when I first read your question. I didn't figure out whether it's a multi-label or a multi-target problem. But after your explanation, I assume your goal is to predict multiple properties like homicide and robbery gave unemployment rate, avg assessment value, and some other features.

As you mention, the neural network is not included in possible solutions. But actually, traditional machine learning methods like Support Machine Learning (SVM) and Random Forest (RF) are suitable in this case.

'sklearn' is a very easily handled toolkit in Python for you to build such a model. There are tremendous tutorials you can find online to teach you how to train and fit the dataset. What I want to add and remind is that you need to modify their single-task model to multi-task model using MultiOutputClassifier, which can be imported by from sklearn.multioutput import MultiOutputClassifier. For further reference, just read the following official documents of sklearn.

https://scikit-learn.org/stable/modules/multiclass.html