# Machine learning project experimental design. Repeated observations, time series data

I have a dataset related to work-safety that covers over 100,000 worksites over a course of 15 years. I would like to experiment with machine learning models to predict the number of injuries that will occur the next year. The objective is to create a tool that takes as input an identifier for the site and returns a prediction for the number of injuries in the upcoming year. My dataset contains indicator variables, continuous variables and categorical variables. Can you suggest models that would best leverage this data. The correlation coefficient between the average number of injuries by site and the number that occurred in the previous year on record is 0.70. How can I have my model make use of this information?

Indicator variables include whether specific types of safety gear and protocols are required, if the site is remote, the presence of a health and safety committee, the presence of hazardous substances. Categorical variables include the NAICS code, geographical region, the severity rating of the site (low, medium, high). The continuous variables include the total number of injuries, explosions, the number of assignments/inspectors that visited the site in previous year, the number of health and safety violations, the number of people employed at the site, the number of training sessions and corrective assignments charged to the site. The data is highly variable. The levels of risk vary with the line of work. Some sites require no safety material, have no violations and report no injuries. Other sites report hundreds of injuries. Given this, I would like to be able to use this data to predict the number of injuries that will occur the upcoming year.

• Can you say something more of the data, what variables do you have, how many? How do you measure exposure, like total number of hours worked at the workplace, per year? Are the levels of risk at the workplaces similar, or do it vary much? Do you have some variables measuring relative risk? How do you measure work-safety? Number of injuries/year, number of lost work-hours? ... – kjetil b halvorsen May 30 '17 at 16:13

You have a count data problem, so I would start out with Poisson regression. That could change, as a result of preliminary analysis, with some other count-data model, like maybe negative binomial regression. The risk exposure of the sites will vary, first as a function of the size of site, measured by number of employees. So, number of employees could be used as an offset (with a log link function, use offset(log(NrEmployees)) in R). For more about use of offset, see Goodness of fit and which model to choose linear regression or Poisson. Then you use your other predictor variables in the linear predictor, categorical variables coded with dummys. For the continuous predictor variables, you could check for nonlinearities by including them with splines. Maybe interactions?