Explain how text-based data is prepared, wrangled and explored for use in financial forecasting
The idea
Text preparation starts with cleansing: removing HTML tags, most punctuation, and extra white space, and replacing numbers with a placeholder token such as /number/. Preprocessing then tokenises and normalises: lowercasing, removing stop words, and stemming (cutting to a root such as "downgrad") or lemmatisation (mapping to a dictionary word). Exploration studies token frequencies and may use a word cloud. Tokens that appear in nearly every document carry little distinguishing information, and very rare tokens add sparse noise, so both are often removed. Chi-square tests and mutual information rank the remaining tokens. Watch that normalisation does not destroy meaning, for example by removing "not" before sentiment analysis.
Formulas
Chi-square feature selection
chi-square = Σ (O − E)² ÷ E
- chi-square
- the test statistic
- O
- the observed count in a cell
- E
- the count expected if the term and the class were unrelated
A large value, above the critical value, keeps the term as a useful feature.
In the app: 3 practice questions on this outcome, a narrated walkthrough with diagrams, spaced review that brings it back before you forget it.
Take the free diagnostic →More in Big Data Projects
- Recognise the stages of a data analysis project and explain each one
- Set out the aims, stages and examples of data preparation and wrangling
- Judge how well a machine learning algorithm fits
- Set out the aims, techniques and examples of exploring data
- Explain techniques for extracting, choosing and engineering features from text data
- Set out the aims, stages and techniques of training a model