Crime topic modeling

The classification of crime into discrete categories entails a massive loss of information. Crimes emerge out of a complex mix of behaviors and situations, yet most of these details cannot be captured by singular crime type labels. This information loss impacts our ability to not only understand the causes of crime, but also how to develop optimal crime prevention strategies. We apply machine learning methods to short narrative text descriptions accompanying crime records with the goal of discovering ecologically more meaningful latent crime classes. We term these latent classes ‘crime topics’ in reference to text-based topic modeling methods that produce them. We use topic distributions to measure clustering among formally recognized crime types. Crime topics replicate broad distinctions between violent and property crime, but also reveal nuances linked to target characteristics, situational conditions and the tools and methods of attack. Formal crime types are not discrete in topic space. Rather, crime types are distributed across a range of crime topics. Similarly, individual crime topics are distributed across a range of formal crime types. Key ecological groups include identity theft, shoplifting, burglary and theft, car crimes and vandalism, criminal threats and confidence crimes, and violent crimes. Though not a replacement for formal legal crime classifications, crime topics provide a unique window into the heterogeneous causal processes underlying crime.

discuss whether automated procedures could be used to cross-check the quality of official crime classifications.

Keywords:
Machine learning; Non-negative matrix factorization; Text mining; Crime.

Introduction
Upon close inspection, most criminal events arise from subtle interactions between situational conditions, behavioral routines, and the boundedly-rational decisions of offenders and victims (Brantingham and Brantingham 1993).Consider two crimes.In one event, an adult male enters a convenience store alone in the middle of the night.Brandishing a firearm, he compels the store attendant to hand over liquor and all the cash in the register (Wright and Decker 1997:89).This event may be contrasted with a second involving female sex worker who lures a john into a secluded location and takes his money at knife point, literally catching him with his pants down (Wright and Decker 1997:68).In spite of the fine-grained differences between these events, both end up classified as armed robberies.As a matter of law, the classification makes perfect sense.The law favors a bright line to facilitate classification of behavior into that which is criminal and that which is not (Casey and Niblett 2015;Glaeser and Shleifer 2002).The loss of information that comes with condensing complex events into singular categories, however, may severely hamper our ability to understand the immediate causes of crime and what might be done to prevent them, though the quantitative tractability gained may certainly offset some of the costs.
The present paper explores novel methods for crime classification based directly on textual descriptions of crime events.Specifically, we borrow methods from text mining and machine learning to examine whether crime events can be classified using text-based latent topic modeling (e.g., Blei 2012).Our approach hinges on the idea that criminal events are composed of mixtures of behavioral and situational conditions that are captured at least partially in textual descriptions of those events.Over a corpus of events, the relative frequency of situational and behavioral conditions is captured by the relative frequency of different words in the text-based descriptions of those events.Topic modeling of the text then allows one to infer the latent behavioral and situational conditions driving those events.
Latent topic modeling offers two unique advantages over standard classification systems.
First, latent topic models potentially allow higher-level class structures to emerge autonomously from lower-level data, rather than being imposed a priori.Simpler or more complex class structures, relative to the formal system in place, may be one result of autonomous classification.
Such emergent classifications may also be ecologically more meaningful.Second, latent topic models allow for soft clustering of events.Common crime classification systems require socalled hard clustering into discrete categories.A crime either is, or is not a robbery.Softclustering, by contrast, allows for events to be conceived of as mixtures of different latent components, revealing nuanced connections between behaviors, settings and crime.An event that might traditionally be considered a robbery, for example, may actually be found to be better described as a mixture of robbery and assault characteristics.
The remainder of this paper is structured as follows.Section 1 reviews several longstanding issues surrounding crime classification and causal inference.Section 2 introduces textbased latent topic modeling at a conceptual level.This forms a basis for describing how the models may be applied to the problem of crime classification.Section 3 presents methodological details underlying non-negative matrix factorization as a method for topic modeling (Lee and Seung 1999).Here we also introduce methods for evaluating topic model classifications using the official classifications as a benchmark.In this context we can measure the distance between different classifications in terms of their underlying topic structure.Section 4 introduces the empirical case and data analysis plan.We analyze all crimes occurring in the City of Los Angeles between Jan 1, 2009 and July 19, 2014 using data provided by the Los Angeles Police Department (LAPD).Section 5 presents results.The paper closes with a discussion of the implications of this work and future research directions.

Causal Heterogeneity and Crime Classification
Our starting premise is that situational conditions drive crime events.This is a wellestablished position linked to both situational crime prevention (Clarke 1983;Clarke 1980) and crime pattern theory (Brantingham andBrantingham 1978, 1984).Situational crime prevention sees offenders as making boundedly-rational choices in response to situational cues about the quality of crime opportunities (Clarke and Cornish 1985).Crime pattern theory goes further to argue that offender decision making, if it produces successful crimes, quickly evolves into behavioral templates or scripts that are triggered with little rational thought at the time of offending (Brantingham and Brantingham 1978;Brantingham and Brantingham 1993).Crime cues are typically localized to relatively small geographic places (Groff, Weisburd, and Yang 2010;Weisburd, Groff, and Yang 2012), but may be variably fleeting or stationary in time (see Belk 1975).Overall, situational crime prevention and crime pattern theory posit a close match between situational conditions and the behavioral repertoires underlying different types of crimes.
While the above perspectives offer a comprehensive theory of situational crime causation, the formal process of crime classification makes it difficult to operationalize in practice.Most if not all situational information is discarded in applying crime type labels to events, leaving behind a bare minimum of behavioral information sufficient to satisfy to narrow legal criteria (but seeBrantingham 2016; Brennan 1987).For example, the California Penal Code defines robbery as "the felonious taking of personal property in the possession of another, from his person or immediate presence, and against his will, accomplished by means of force or fear" (CA PEN § 211).This definition provides few constraints on what property is involved, why that property was seen as a suitable target, what constitutes possession by the victim, or how force or fear was deployed.And these gaps in information concern only the most immediate situational conditions surrounding the criminal act itself.
One recourse for filling the gap in situational information about crime is to emphasize detailed observational or ethnographic studies of offending (e.g., Wright and Decker 1994;Wright and Decker 1997).Rich ethnographic observations provide convincing detail linking situational conditions to crime.However, sampling constraints necessarily limit how statistically representative such studies can ever be.Alternatively, experimental studies can seek to test how offenders make decisions in response to controlled manipulation of environmental cues (Keizer, Lindenberg, and Steg 2008;Wright, Logie, and Decker 1995).The ecological validity of such studies may be questioned depending upon how artificial experimental tasks are.
A majority of studies adopt a third approach emphasizing spatio-temporal patterns of specific crime types in relation to independent measures of crime situations (see Clarke 1980: 139).The regular covariation between specific crime types and measured situational conditions is taken as evidence of a causal process.An advantage of this distributional approach is that sample sizes may be large enough to be representative of the behavioral situations surrounding crime events for a full spectrum of crime types, though there will always be conditions that go unmeasured given the complexity of real-world environments (Brantingham 2016).
Less often appreciated is the fundamental impact that formal classification has on causal inference, though recognition of these challenges is not new (Brennan 1987;Gibbs 1960;Sellin 1938).In an ideal world, crime types would be defined such that all events in a crime type category share a common cause.In other words, ideal crime types are causally homogeneous (Brennan 1987).Both forward prediction and backward inference are straightforward under such circumstances.With causal homogeneity, observation of a situational condition, even if it is done independently of the event itself, makes it easy to predict the corresponding type of crime.
Conversely, observing a particular type of crime makes it easy to infer the situational conditions that must have been present at the time the offense was committed.
Most formally recognized crime types are not causally homogeneous, but causally heterogeneous (Brennan 1987).This heterogeneity is not simply a result of classification error where events of one type are incorrectly assigned another type and thereby erroneously mix causes (Gove, Hughes, and Geerken 1985;Maltz and Targonski 2002;Nolan, Haas, and Napier 2011).Rather crime itself arises under an array of overlapping situational conditions.Formal classification only makes crime seem more causally homogenous than it actually is.
The consequences of this apparent homogeneity are profound.Forward and backward causal models are difficult to apply without error.If the relationship between situational conditions and formal crime types is one-to-many, then forward prediction is compromised.
Having observed a singular situational condition, many different crime types might be predicted to occur.If the relationship between situational conditions and crime types is many-to-one, then backwards inference is compromised.Having observed a specific crime type, many different situational conditions might be causally responsible for the event.Alas, in real-world settings, the relationship between formal crime types and situational conditions is likely many-to-many meaning that both forwards and backwards causal models are compromised.Mapping formal crime types in relation to larger and larger lists of independently measured situational conditions is unlikely to rectify the problem since causal heterogeneity is an unavoidable byproduct of typological system itself.Indeed, one wonders whether the inability of criminology to make much progress in explaining crime has as much to do with the imperfections in crime typology as the failures of theory (Gibbs 1960:322-323;Weisburd and Piquero 2008).What is needed is an approach to crime classification that allows simultaneous scoring of multiple behavioral and situational conditions (Brennan 1987: 215).
While the broader theoretical challenges here are significant, a more immediate problem concerns how to garner such behavioral and situational information to facilitate the construction of situational crime types.As discussed above, ethnographic methods cannot scale sufficiently to provide a statistically representative picture for crime in general.Mapping official crime types with respect to independent situational measures may simply perpetuate the effects of causally heterogeneous formal crime type categories.Here we turn to novel methods from computational linguistics and apply them to textual narratives associated with crime events.These methods allow crime classifications to emerge naturally from situational information associated with individual crime events.The approach positions the situation as the unit of analysis.It allows crime events to be viewed as overlapping mixtures of situations.The heterogeneous causal connections between different crime types therefore can be more directly measured.

Latent Topic Modeling for Text Analysis
Latent topic modeling is a core feature of contemporary computational linguistics and natural language processing.It is a dominant analytical technique deployed in the study of social media (Blei 2012;Hong and Davison 2010).The conceptual motivation for topic modeling is quite straightforward.Consider a collection of Tweets1 .Each Tweet is a bounded collection of words (and potentially other symbols) published by a user.In computational linguistics, a Tweet is called a document and a collection of Tweets a corpus.When viewed at the scale of the corpus we might imagine that there are numerous conversations about a range of topics both concrete (e.g., political events) and abstract (e.g., the meaning of life).That these topics motivate the social media posts might not be immediately obvious when examining any one individual Tweet.
But viewed as a whole corpus the dimensions and boundaries of the topics may be resolvable.Section 3 will introduce the mathematical architecture for how topics are discovered from a corpus of documents.The key point to highlight here is that each topic is defined by a mixture of different words.Each document is therefore potentially a mixture of different topics by virtue of the words present in that document.
We make a conceptual connection between text-based activity and crime at two levels.
The more abstract connection envisions individual crimes as the analog of documents.A collection of crimes such as all reported crimes in a jurisdiction during one week is therefore the analog of the documents in a corpus.We might imagine that the environment consists of a range of complex behavioral and situational factors, some very local and others global, which co-occur in ways that generate different types of crimes.These co-occurring factors are the analogs of different topics.How 'crime topics' actually generate crime might not be immediately obvious when examining any one crime.But when crimes are aggregated into a lager collection, the dimensions and boundaries of 'crime topics' might be discernable.Likewise, the specific combination of behavioral and situational factors involved in a single crime are the analog of words in a document.The key point to emphasize here is that 'crime topics' are mixtures of behaviors and situations.Each crime is therefore a mixture of 'crime topics' by virtue of the situations and behaviors present at the time of the crime.
The more concrete connection appeals directly to text-based descriptions of crimes as a source of information about the complex environmental backcloth of crime (Brantingham and Brantingham 1993).Specifically, we treat text-based descriptions of crime compiled by reporting police officers as a record of some fraction of the behavioral and situational factors deemed most relevant to that crime.As a result, we seek to apply topic modeling directly to the text-based descriptions of crime accompanying many crime records.

Methods
The goal of the current section is to describe methods for building latent topic models using text-based descriptions of crimes.We take a linear algebraic approach due to its computational efficiency and scalability to massive data sets, for example the text descriptions of nearly one million crimes discussed in Section 4. The linear algebraic approach contrasts with probabilistic methods such as the popular latent Dirichlet allocation (LDA) (Blei, Ng, and Jordan 2003), which is computationally expensive.Our approach does not yield a probabilistic interpretation and rigorously should be called a "document clustering" method.Recent research, however, has built connections between linear algebraic and probabilistic methods for topic modeling (Arora et al. 2013), supporting the usefulness of linear algebraic methods as an efficient way to compute topic models.

Text Preprocessing
Text-based narratives are typically very noisy, including typos and many forms of abbreviation of a same word.To obtain reliable results that are less sensitive to noise, we run a few preprocessing steps on the raw text accompanying crime events including removal of socalled stop-words (see e.g., Rajman and Besançon 1998).Stop-words refer to the most common words in a language, which can be expected to be present in a great many documents regardless of their content or subject matter.We augment a standard list of stop-words (e.g.a, the, this, her, …) with all the variations of the words "suspect" and "victim", since these two words are almost universally present in all descriptions of crime and do not provide useful contextual information (though they would be useful for other studies).The linguistic variations include all the prefixes such as "S", "SUSP", "VIC" and anything followed by a number (e.g."V1", "V2").
All the stop-words are then discarded.We also discard any term appearing less than 5 times in the entire corpus.Finally, any document containing less than 3 words in total is discarded.This procedure runs in an iterative manner until no more terms or documents can be discarded.

Term Frequency-Inverse Document Frequency (TF-IDF)
The term-document matrix, denoted as , plays a central role in our analysis (see Manning, Raghavan, and Schütze 2008).Each row of  corresponds to a unique word in the vocabulary, and each column of  corresponds to a document (Figure 1).The (, )-th entry of  is the term frequency (TF) of the -th word appearing in the -th document.Note that the term-document matrix ignores the ordering of words in the documents.Following convention, we include inverse document frequency (IDF) weighting for each term in the vocabulary (Manning, Raghavan, and Schütze 2008).This weighting scheme puts less weight on the terms that appear in more documents, and thus less emphasis is given to terms with less discriminative power.

Non-negative Matrix Factorization (NMF)
We focus on a particular linear algebraic method in unsupervised machine learning, namely nonnegative matrix factorization (NMF) (Lee and Seung 1999).NMF is designed for discovering interpretable latent components in high-dimensional unlabeled data such as the set of documents described by the counts of unique words.NMF uncovers major hidden themes by recasting the term-document matrix  into the product of two other matrices, one matrix representing the topics and another representing the documents in the latent topic space (Figure 1) (Xu, Liu, and Gong 2003).In particular, we would like to find matrices  ∈ ℝ * +×-and  ∈ ℝ * -×/ to solve the approximation problem  ≈ , where ℝ * is the set of all nonnegative numbers and m, n and k are the numbers of unique words, documents, and topics, respectively. is the term-document matrix given as the input, while  and  enclose the latent term-topic and topic-document information.
Numerous algorithms exist for solving  ≈  (Cichocki et al. 2009;Kim, He, and Park 2014), but most would take several hours to run on large-scale data sets consisting of millions of documents.We employ a highly efficient "hierarchical rank-2 NMF" algorithm that is orders of magnitude faster than directly solving  ≈  (Kuang and Park 2013).The algorithm first constructs a hierarchy of topics in the form of a binary tree, and then flattens the hierarchy to generate a traditional topic model.While the topic hierarchy is useful for explorative analysis, the flat level of topics enables easier quantitative evaluation.We show both forms in our analysis of crime data.In contrast to the hierarchical LDA (Teh et al. 2006), which is more computationally expensive than LDA, hierarchical NMF can process web-scale data containing millions to billions of documents such as Tweets or the crime narratives used in our study.

Cosine Similarity & Crime Type Clusters
Text-based topic modeling typically reveals that any one document is a mixture of different topics.Therefore, in principle, the distance between any two documents can be measured by comparing how far apart their topic mixture distributions are.Here we extend this idea to consider officially recognized crime types as mixtures of different crime topics.The distance between any two official crime types can be measured using the topic mixtures observed for those two crime types.We use cosine similarity (Steinbach, Karypis, and Kumar 2000) to compute such measures.
Consider two hypothetical crime types A and B. Type A might represent aggravated assault and type B might represent residential burglary.Inspection of all of the events formally classified as assault with a deadly weapon might show that 40% fall into crime topic i = 1, 30% fall into topic 4, 20% into topic 9, and 10% into topic 12. Similarly, for all the events formally classified as residential burglary, 5% might fall into topic i = 9, 15% into topic 12, 60% into topic 15 and 20% into topic 19.Assault with a deadly weapon and residential burglary are similar only in events falling into topics 9 and 12.More formally, the similarity between any two official crime types A and B is given as: where A i is the frequency at which events formally classified as crime type A belongs to topic i and equivalently for events formally classified as crime type B i .
We choose cosine similarity over other measures such as KL-divergence and chi-square distances because cosine similarity is bounded, taking values between -1 and 1, and is a good measure for graph-based crime type clustering (discussed below).Negative values reflect distributions that are increasingly diametrically opposed and positive values distributions that point in the same direction.Values of cosine similarity near zero reflect vectors that are uncorrelated with one another.In our case, cosine similarity will only assume values between 0 and 1 because NMF returns only positive valued matrices.
Viewing the collection of official crime types as a graph, where each crime type is a node and cosine similarities define the weights of the edges between nodes, we use average linkage clustering (Legendre and Legendre 2012) on this graph to partition the crime types into ecologically meaningful groups (see also Brennan 1987: 228).Crime types are clustered in an agglomerative manner.Initially, each crime type exists as its own isolated cluster.The two closest clusters are then merged in a recursive manner, with the new cluster adopting the mean similarity from all cluster members.The process continues until only C clusters are left.The number C can be chosen automatically by a cluster validation method such as predictive strength (Tibshirani and Walther 2005), or manually for easier interpretation.We manually set the number of clusters.

Data and Analysis Plan
The above modeling framework is flexible enough in principle to handle any form of data (e.g., Chen, Wang, and Dong 2010), not just text.In spite of this flexibility, we do not stray far from its most common application in text mining.Here we exploit the presence of short text descriptions associated with individual crime events to compute text-based hierarchical NMF.Angeles is both surrounded by and encompasses independent cities with their own police forces.
The total number of reported crimes handles by the LAPD during the sample period was 1,027,168.In a typical year, the LAPD collected reports on 180,000 crimes.On average 509 crimes were recorded per day, with crime reports declining over the entire period.During the first year of the sample, LAPD recorded on average 561.5 crimes per day.During the last year they recorded 463.8 crimes per day.The crime coding system used by the LAPD includes 226 recognized crime types.This is considerably more finely resolved than either the FBI Uniform Crime Reports (7 Part I and 21 Part II offenses), or National Incident Based Reporting System (49 Group and 90 Group B offenses).Aggravated assault, for example, is associated with four unique crime codes including assault with a deadly weapon, assault with a deadly weapon against a police officer, shots fired at a moving vehicle, and shots fired at a dwelling.These crime types could be considered a type of ground truth against which topic model classifications can be evaluated.We are here interested in the degree of alignment of the LAPD crime types and topic models derived from text-based narratives accompanying those crimes.
In addition to this rich coding system, a large fraction of the incidents recorded in the sample include narrative text of the event.Of the 1,027,168 recorded crimes, 805,618 (78.4%) include some form of text narrative.On average 397.6 events per day contain some narrative text describing the event.The fraction of events containing narrative text increased over time from 76.6% of events, in the first six months of the sample, to 87.0%, in the last six months.
There are pointed differences in the occurrence of narrative text by official crime types (Table 2).Virtually all violent crimes are accompanied by narrative text.Robbery and homicide have associated narrative text for 98.9% and 98.2% of events, respectively.Assault and kidnapping have 97.8% and 97.4% of events associated with narrative text.Burglary shows narrative text occurrence on par with the most serious violence crimes (98.6%).For less serious property crimes, narrative text reporting falls off to 91.1% for theft and 74.3% for vandalism.
The lowest occurrence of narrative text is seen for arson (37.8%) and motor vehicle theft (4.3%).
In the former case it must be acknowledged that most arson reporting responsibilities lie with the fire department, so low narrative load might be expected.In the latter case, either the vehicles are not recovered (about 40% of the cases) and therefore the circumstances of the theft are not known, or detailed circumstances beyond make, model and year of the car-all recorded in separate fields-are not deemed as relevant to recording of the crime.
Overall, the text narratives associated with crime events total 7,649,164 discrete words, after preprocessing (see above).These are unevenly distributed across events.The mean number of words contained in a single narrative is 18.57(s.d.6.72), while the maximum number of words is 41 (see Table 1).Individual words are also unevenly distributed, though not massively so (Table 3).For example, the word "unknown" is the most common word in the corpus appearing 635,099 times.However, this still represents only 8.3% of all words.The next most common word is "property" occurring 305,014 times, but represents only 4% of all words.
Words that are strongly indicative of crime type are extremely rare.The word homicide appears only 45 times in the entire text corpus, a frequency of 5.88x10 -6 overall.Burglary appears 252 times, robbery 286 times, assault 457 times, and theft 969 times.When they do appear, diagnostic words are not generally coincident with the corresponding formal classifications.For example, of the 1,593 formally classified homicides in the dataset, only 11 of those events also find the word homicide as part of the narrative text.Thus, 1,582 formally classified homicides are not explicitly marked as such in the narrative text.The 34 events that include the word homicide in the narrative, but are not classified as homicides, include 17 events labeled as "other" (primarily threatening letters or phone calls), nine aggravated assaults, seven vandalism events, and one robbery.In general, narrative text provides context rather than strictly redundant typological detail.It is important to note, however, that narrative text and formal crime type classifications are unlikely to be completely decoupled.Ultimately, it is the job of police officers in the field to recognize and record behavioral and circumstantial evidence consistent with legal definitions of different crime types.Thus we should expect that specific narrative words correlate to some degree with formally recognized crime types.
The analysis that follows includes three parts.First, we present results for hierarchical topic models.We do this for all crimes combined and then turn our attention to analyses of the subset of crimes formally classified as aggravated assault and homicide.Second, we explore how formally recognized crime types are found distributed across different topics.The corollary that individual topics are distributed across different crime types is also discussed.Finally, recognizing that different formally recognized crime types are distributed across topics, we measure the 'distance' between different crime types based on the similarity in their topic mixtures.

Hierarchical Models for All Crimes
Figure 2 presents a hierarchical topic model applied to all crime events in the LAPD corpus associated with narrative text.After preprocessing the data set includes 711,119 events.
Each node in the tree represents a latent topic characterized by key words appearing in the topic.
Summary statistics for the number of events, the percent violent and property crime, and the topten words for each topic node are shown in tabular format.The hierarchical structure is shown in graph form.Terminal leaf nodes are highlighted in gray.
The topic tree has three major components.The topics associated with the left branch (Nodes A-O) is linked to property crimes (Figure 2).Words such as property and vehicle identify key targets of crime, while words such as window, door, enter, remove, and fled describe the behavioral steps or sequences involved in commission of a crime.The validity of the property crime label for this component may be tested by using the formally recognized crime types in the LAPD ground truth.For example, 93.4% of the events associated with terminal leaf node C are formally recognized by the LAPD as property crimes.None of the intermediate or terminal nodes in the left branch (Nodes A-O) captures less than 89.9% property crimes.
By contrast, the right branch (Nodes P-AG) stands out for its connection to violent crime (Figure 2).Words such as face, head and life identify key targets of crime, while words such as approach, verbal, and punch identify sequences of behaviors involved in violent actions.The LAPD ground truth supports the broad label of topics P-AG as violent crime.For example, 90.5% of all the events associated with terminal topic S are formally recognized as violent crime types.With the exception of nodes P and Y, no other topic in this component captures less than 70% of formally recognized violent crimes.Terminal node Y appears to be an association of violations of court orders and/or annoying communications, which are reasonable ecological precursors to or consequences of other violent crimes.
Intermediate node P is a bridge between crime topics that are clearly associated with violent crime (Nodes Q-AG) and a series of crime topics we label as deception-based property crime (Nodes AH-AL).Words indicative of shoplifting and credit card fraud stand out in this group of topics.Why such topics trace descent through a branch more closely with violent is unclear.

Hierarchical Models for Aggravated Assault & Homicide
Figure 3 presents topic modeling results for the subset of crimes formally classified by the LAPD as aggravated assaults (LAPD code 230) and homicide (LAPD code 110).This is a semi-supervised analysis in the sense that we have used information external to narrative data to partition or stratify the collection of events into a priori groups.Our goal is to assess topic distinctions that arise within these serious violent crimes.A total of 40,208 events are classified as either aggravated assaults (38,626 events) or homicides (1,582 events).Notionally, these events are separated on the basis of outcome (i.e., death), but such a distinction is not visible within the classification hierarchy.Rather, the key distinction is between topics involving weapons other than firearms (Nodes A-I) and those involving firearms (Nodes J-R).Homicide looms large in terms of legal and harm-based classification (Ratcliffe 2015; Sherman 2011), but is not resolved within the larger volume of aggravated assaults.Homicides never make up more than 2.1% of any of the non-gun violence topics (Nodes A-I) (Figure 3).Homicides never rise above 11.8% in the gun violence topics (Nodes J-R).Notably, the greater lethality of guns is clearly visible when comparing the percent of homicides that are gun-related and those that are not.The most lethal crime topic is terminal node N, with key words approach, handgun, multiple, shot, and fled.Node P stands out with an emphasis on the use of vehicles as a weapon, but still tracing a pattern of descent linked to gun violence.Inspection of the top 100 words in this topic confirms that gun-related terms do not appear in topic P. The close connection to topic Q, which links guns and vehicles, is clearly through the common element of vehicles not guns.
Figure 4 shows that removing homicides from the subset of events does not fundamentally change the structure of the resulting topics.Indeed, it seems clear that assaults provide the overriding structure for crimes of interpersonal violence.This outcome may reflect the relatively low volume of homicides relative to aggravated assaults, but also the fact that homicides and aggravated assaults are ecologically very closely related (Goldstein 1994).Topic nodes A-I are notable for making fine-grained distinctions between the targets of violence, including head, face, hand, and arm, the weapons used, including metal object, bottle, and knife, and the action, including hit, threw, punch, kick, stab, and cut.The topics appear tactically very exacting.For example, the topics consistently show knives being used to target the body, while bottles/blunt object are used to target the head (Ambade and Godbole 2006; Webb et al. 1999).

Hierarchical model for homicides
Figure 5 presents the results of hierarchical NMF analysis of text narratives associated with formally classified homicides.There are clear distinctions that surface within formally classified homicides in spite of the much smaller numbers of events (1,414 with more than three words).The primary split is between homicides involving firearms (Node A and all of its daughters) and those where firearms are not indicated (Node R).Node R in fact features words stab and head, which we know from the broader analysis of aggravated assaults are two terms associated with knife violence and blunt-force violence, respectively (see Figure 3 and Figure 4).

Crimes as Mixtures of Topics
The above discussion points to key terms such as knife, gun, and glass, or stab, shot, hit, that are useful in discriminating types of events from a range of behaviors and settings associated with different crimes.However, terminal topics are not themselves discrete.Rather, there is considerable overlap in the words or terms that populate different topics.This observation leads to a conceptualization of crimes as mixtures of crime different topics.
Table 4 shows a confusion matrix for formal crime types assigned by the LAPD against the topics associated with each crime event.A confusion matrix is typically used for evaluating the performance of a predictive algorithm (Fielding and Bell 1997).Here a confusion matrix is used to illustrate both how official crime types exist as mixtures of topics and how individual topics are associated with many different official crime types.We use a refined version of the leaf nodes from hierarchical clustering for all crime types and number the topics from 1 to 20 (see Figure 2).We also restrict the confusion matrix to the thirty most common crime types in the dataset for readability.Clustering analyses below restrict the analysis to the forty most common crime types.
Official crime types mix topics in unique ways.Row counts in Table 4 give the number of events of a given official crime type that are assigned to different discovered crime topics.
For example, 29,497 (32.94%) of the 89,552 events officially classified by the LAPD as burglary from vehicle are assigned to Topic 1.This topic is marked by words smash/broke, rear/passenger/side/driver/front, window, and remove, all of which provide clear target and behavioral information intuitively consistent with the official crime type.However, other topics also grab significant numbers of burglary from vehicle events.Topics 3 (7.25%), 5 (5.02%), 8 (14.14%), 10 (10.87%), 14 (8.79%), and 19 (9.09%) each represent at least 5% of total events (Table 4).Topic 8 shares a connection on property crime with Topic 1, but otherwise emphasizes a very different focus, marked by words such as force/gain, access/entry, tool, remove and property.Topic 8 sounds considerably more generic and is consistent with burglary in general.Similarly, Topic 10 also grabs a large number of burglary from vehicle events, but here the focus is more clearly on vandalism, marked by words such as kei ([sic] i.e., key), scratch and tire.A more formal analysis of mixture characteristics is presented below.
Topic mixtures also characterize violent crimes.For example, aggravated assault (or assault with a deadly weapon) has events distributed evenly across Topics 2 (7,689 events or 18.02%), 6 (8041 events, 18.84%) and 9 (8,038 events, 18.83%).Topic 2 is characterized by words such as punch/kick, hit/struck, face/head, without prominent occurrence of words related to weapons.Topic 6, by contrast, features words such as gun/handgun as well as approach, demand and money.Topic 9 involves words such as verbal, argument/dispute, grab, push, and hand.While aggravated assaults appear to be evenly divided among these three topics, the topics themselves suggest heterogeneity in crime contexts.Topic 8 clearly stands out as related to robbery.
Crime topics are also not exclusively linked to individual crime types (Table 4).Rather single topics are spread across crime types at different frequencies.For example, 58.63% (24,497) of the Topic 1 events fall within burglary from vehicle.However, 12.99%, 10.77% and 9.7% of Topic 1 events are classified as petty vandalism under $400, vandalism over $400 and burglary, respectively.Topic 1 thus reveals connections among three different crime types.Such is the case for each topic.For example, 14.3% (8,041) of Topic 6 events are aggravated assaults, though robbery is the single most common crime type attributed to this topic (41.15% or 23,112 events).Battery (9.17% or 5,147 events), attempted robbery (6.8% or 3,820 events) and theft from person (5.3% or 2,979 events) are all also heavily represented within Topic 6.
Overall, the confusion matrix gives the sense that crimes may be related to one another in subtle ways and that these subtle connections can be discovered in the narrative descriptions of those events.A more formal way to consider such connections is to measure the similarities in their topic mixtures.The premise is that two crime types are more similar to one another if their distribution of events over topics is similar.For example, burglary from vehicle and petty vandalism show similar relative frequencies of events within Topic 3 (7.3% and 5.0%, respectively), Topic 5 (5.0% and 7.8%) and Topic 10 (10.9% and 12.2%) (Table 4).This gives the impression that burglary from vehicle and petty vandalism are closely related to one another.

Distances Between Crime Types & Crime Topic Clustering
To develop a more rigorous quantitative understanding of the relationships among formally recognized crime types we turn to the cosine similarity metric (Steinbach, Karypis, and Kumar 2000).Figure 6 shows the cosine similarity between formally recognized crime types as a matrix plot where the gray-scale coloring reflects the magnitude of similarity.The matrix is sorted in descending order of similarity.The darkest matrix entries are along the diagonal confirming that any one crime type is most similar to itself in the distribution of events across topics.More revealing is the ordering of crime types in terms of how far their similarities extend.For example, the rank 1 crime type, 'other miscellaneous crimes', has a topic distribution that is broadly similar to the topic distributions for every other crime type (Figure 6).The classification 'other miscellaneous crime' is a grab-bag for events that do not fit well into other categorizations.It is reasonable to expect that such crimes will occur randomly with respect to setting and context and therefore share similarities with a wide array of other crime types.What is astonishing is that this broad pattern of connections is picked up in the comparison of topic profiles.
More surprising perhaps are the widespread connections shared by shots fired (rank 2) and aggravated assault (assault with a deadly weapon) (rank 3) with other crimes.Guns appear to mix contextually with many other formally recognized crime types.By contrast, robbery and attempted robbery show a more limited set of connections.Both of these latter crime types display particularly weak connections to burglary and vandalism.Identity theft appears to be largely isolated in its topic structure from other crimes (rank 20).
Figure 7 goes one step further to identify statistical clusters, or communities within similarity scores using average linkage clustering (Legendre and Legendre 2012).We focus on a six cluster solution using this method.Consistent with Figure 6, identity theft is clustered only with itself (pink).This is also the case for shoplifting (brown).The first major cluster (purple) includes burglary, petty and grand theft, attempted burglary, trespassing, bike theft, and shots fired at an inhabited dwelling.The second cluster (red) includes burglary from vehicle, petty and serious vandalism, petty and grand theft from vehicle, embezzlement, and vehicle stolen.The third cluster (green) includes criminal threats, forged documents, other miscellaneous crimes, annoying behavior, violation of a court or restraining order, child endangering, bunco and disturbing the peace.The final and largest cluster (orange) incudes violent crimes such as battery, robbery, aggravated assault (assault with a deadly weapon), attempted robbery, theft from person, brandishing a weapon, battery on a police officer, shots fired, homicide, resisting arrest and kidnapping.

Discussion and Conclusions
The application of formal crime classifications to criminal events necessarily entails a massive loss of information.We turn to short narrative text descriptions accompanying crime records to explore whether information about the complex behaviors and situations surrounding crime can be automatically learned and whether such information provides insights in to the structural relationships between different formally recognized crime types.
We use a foundational machine learning method known as non-negative matrix factorization (NMF) to detect crime topics, statistical collections of words reflecting latent structural relationships among crime events.Crime topics are potentially useful for not only identifying ecologically more relevant crime types, where the behavioral situation is the focal unit of analysis, but also quantifying the ecological relationships between crime types.
Our analyses provide unique findings on both fronts.Hierarchical NMF is able to discover a major divide between property and violent crime, but below this first level the differences between crime topics hinge on quite subtle distinctions.For example, six of eight final topics within the branch linked to property crime involve crimes targeting vehicles or the property therein (see Figure 2).Whether entry is gained via destructive means, or nondestructive attack of unsecured cars seems to play a key role in distinguishing between crimes.
Such subtleties are also seen in the topics learned from arbitrary subsets of crimes.For example, among those crimes formally classified as aggravated assault and homicide shows a clear distinction between topics associated with knife/sharp weapon and gun violence (see Figures 3, 4 and 5).A distinction is also seen between violence targeting the body and that targeting the face or head.Few would consider knife and gun violence equivalent in a behavioral sense.That this distinction is discovered and given context is encouraging.
Individual crime types are found distributed across different topics, suggesting subtle variations in behaviors and situations underlying those crimes.Such variation also implies connections between different formally recognized crime types.Specifically, two events might be labeled as different crime types, but arise from very similar behavioral and situational conditions and therefore be far more alike than their formal labels might suggest.Clustering of crimes by their topic similarity shows that this is the case.As presented in Figure 7, some crime types stand out as isolated from all other types (e.g., identity theft, shoplifting).Other crime types cluster more closely together.For example, the formal designation 'shots fired' does connect more closely with other violent crime types such as assault, battery and robbery, even though 'shots fired' is found widely associated with many other crimes as well.Burglary from vehicle clusters more closely with vandalism and embezzlement than it does with residential or commercial burglary.
The similarity clusters confirm some aspects of intuition.Violent crimes are naturally grouped together.Burglary and theft are grouped together.Burglary from vehicle, car theft and vandalism are grouped together.Less intuitive perhaps is the group that combines criminal disturbance with 'confidence' crimes such as forged documents and bunco.

Implications
We can think of the clusters identified in Figure 7 as ecological groups that are close to one another in the behaviors and situations that drive the occurrence of those crimes.This observation has potential implications for understanding causal processes as well as designing avenues for crime prevention.It is possible that crimes that are closer together in terms of their topic structure share common causes, while those that occupy different clusters are separated along causal lines.For example, it is intriguing that burglary occupies a separate cluster (i.e., is topically more distant) from burglary from vehicle (Figure 7).Clearly the differences between targets (i.e., residence vs vehicle) plays a key role here, but other behavioral and situational differences might also prove significant.For example, the tools and methods for gaining entry to each type of target are quite different, and words associated with such tools-of-the-trade and stand out for their discriminative value (see Figure 2).Other hidden structures might also tie crimes together.The grouping of burglary with theft suggests a focus on loss of property, while the grouping of burglary from vehicle with vandalism suggests a focus on property destruction.It is also possible that degrees of professionalism or skill are part of the structural mapping.
Vandalism is reasonably considered a crime requiring a bare minimum of skill and therefore presents very few barriers to entry.Burglary from vehicle requires perhaps only a small increase in skill above this baseline.Theft and burglary, by contrast, may require a minimum degree of expertise and planning (Wright, Logie, and Decker 1995), though it would be a stretch to describe these as high-skill activities.
Several distinctions also stand out with respect to violent crimes.Notably, several crimes that might be thought of as precursors of violence do not cluster directly with violent crime.For example, criminal threats, violations of court and restraining orders, and threatening phone calls all occupy a cluster along with the catch-all 'other crime'.Conversely, theft from person (i.e., theft without threat of force) clusters with violent crimes, though in a technical sense it is considered a non-violent crime.Robbery is a small step away from theft from person and one wonders whether routine activities that facilitate the less serious crime naturally lead to the more serious one.
The clustering shown in Figure 7 may also imply something about the ability to generalize crime prevention strategies across crime types.It may be the case that crimes that cluster together in topical space may be successfully targeted with a common set of crime prevention measures.The original premise behind 'broken windows policing' was that efforts targeting misdemeanor crimes impacted the likelihood of felony crime because the same people were involved (Wilson and Kelling 1982).It is also possible that policing efforts targeting certain misdemeanor crime types may have an outsized impact on certain felony crime types because they share similar behavioral and situational foundations, whether or not the same people are involved.Figure 7 suggests, for example, that targeting the conditions that support theft from person might impact robberies.Efforts targeting vandalism might impact burglary from vehicle.In general, we hypothesize that the diffusion of crime prevention benefits across crime types should first occur within crime type clusters and only then extend to other crime clusters.

Limitations
There are several limitations to the present study.The first concerns unique constraints on text-based narratives associated with crime event records.These narratives are unlikely to be completely free to vary in a manner similar to other unstructured text systems.Tweets are constrained in terms of the total number of characters allowed.Beyond this physical size constraint, however, there is literally no limit to what can be expressed topically in a Tweet.
Additional topical constraints are surely at play in the composition of narrative statements about crime events.For example, the total diversity of crime present in an environment likely has some upper limit (Brantingham 2016).Thus, narratives describing such crimes may also have some topical upper limit.In addition, we should recognize that the narrative text examined here has a unique bureaucratic function.Text-based narratives are presumably aimed at providing justification for the classification of the crime itself.As alluded to above, this likely means that there is a preferred vocabulary that has evolved to provide minimally sufficient justification.
Thus we can imagine that there has been a co-evolution of narrative terms and formal crime types that impacts how topics are ultimately resolved.The near complete separation of property from violent crimes in topic space may provide evidence that such is the case.
A second limitation surrounds our ground truth data.We assumed that the official crime type labels applied to crime events are accurate.However, crime type labels may harbor both intentional and unintentional errors (Gove, Hughes, and Geerken 1985;Maltz and Targonski 2002;Nolan, Haas, and Napier 2011).The application of a crime type label is to some extent a discretionary process and therefore the process is open to manipulation.Additionally, benign classification errors both at the time of report taking and data entry are certainly present.If such mislabeling is not accompanied by parallel changes in the event narrative text, then there are sure to be misalignments between official crime types and discovered crime topics.What would be needed is a ground truth crime database curated by hand to ensure that mislabeling of official crime types is kept to a minimum.Curation by hand is not practical in the present case with ~1 million crime records.
The challenge of mislabeling suggests a possible extension of the work presented here.It is conceivable that a pre-trained crime topic model could be used as an autonomous "crosscheck" on the quality of official crime type labels.We envision a process whereby a new crime event, consisting of an official crime type label and accompanying narrative text, is fed through the pre-trained topic model.The event is assigned to its most probable topic based on the words occurring in the accompanying narrative text.If there is a mismatch between the officially assigned crime type and the one determined through crime topic assignment, then an alarm might be set for additional review.
More ambitious is the idea that a ground-truth topic model could be used for fully autonomous classification.Here a new event consisting only of narrative text would be evaluated with an official crime type assigned based on the most probable classification from the topic model.No human intervention would be needed.Exploratory work on this process shows, however, that the narrative texts accompanying crime events in our data sample provides too little information for autonomous classification to be accurate at the scale of individual crime types.Police will almost always have more complete information at the time of assigning official crime type labels.While text-based topic models exploit novel information in a novel way, we must conclude for the moment that the crime topic model presented here is insufficient for fully autonomous classification, especially given the legal demands that would be placed on assigned crime types.
Nevertheless, the analyses presented here suggest that larger scale crime classes can be learned automatically from unstructured text descriptions of those crimes.Individual crimes existing as mixtures of different crime topics and, simultaneously, individual crime topics being distributed across nominally different crime types.Reiterating the conceptual connection with traditional topic modeling methods, the situation with crime parallels the idea that a single Tweet may draw on a mixture of different topics, while a single topic may be distributed across many quite distinctive Tweets.Our view is that latent 'crime topics' capture features of the behaviors and situations underlying crimes that are often impractical to observe and almost completely lost when adopting formal crime classifications.Crime topics also hold potential for greater understanding of the situational causes of crime less constrained by the byproducts of formal crime type classifications.Extending causal inferences using crime topics will be the subject of future work.Table 1.Examples of official crime classifications and the narrative text tied to the event.

Homicide
VICT    Deception-based property crimes form a distinct tree in the right branch.Tables show topic labels, number of events in each topic, number of events of the top 40 most frequent crime types in each topic, the percent of events for the topic that are formally classified as violent crime (v%) or property crime (p%), and the topten topic words.Terminal leaves of the topic model are marked in gray.
Figure 1.Conceptual illustration of non-negative matrix factorization (NMF) decomposition of a matrix consisting of m words in n documents into two non-negative matrices of the original n words by k topics and those same k topics by the m original documents.

Figure 2 .
Figure 2. Hierarchical NMF topic structure for the entire corpus of events.The left branch captures property crimes.The right branch captures violent crimes.

Figure 3 .
Figure 3. Hierarchical NMF for subset of crimes formally classified as aggravated assault and homicide.Terminal leaves of the topic model are marked in gray.

Figure 4 .
Figure 4. Hierarchical NMF for subset of crimes formally classified as aggravated assaults.Terminal leaves of the topic model are marked in gray.

Figure 6 .
Figure 6.Cosine similarity between crime type pairs sorted in descending order of similarity.

Figure 7 .
Figure 7. Average linkage clustering for cosine similarity between crime type pairs sorted by cluster proximity.

Table 1
illustrates several examples of individual crime events and the associated text descriptions of the events.We focus on the complete set of crimes reported to the Los Angeles Police Department (LAPD) from January 1, 2009 and July 19, 2014.The end date of the sample is arbitrary.Los Angeles is a city of approximately 4 million people occupying an area of 503 square miles.The Los Angeles Police Department is solely responsible for policing this vast area, though Los

Table 2 .
Counts of events with and without accompanying narrative text by official crime type.

Table 3 .
The top twenty-five most common words in the full text corpus consisting of 7,649,164 discrete words.
Figure 5. Hierarchical NMF for subset of crimes formally classified as homicides.Terminal leaves of the topic model are marked in gray.