- Feature is an interesting part of the larger raw data
- Feature Function is a function that extracts a particular feature from the larger raw data
- Feature Engineering is the process of using domain knowledge to extract features from raw data and creating feature functions
- Feature-Based Model is a model constructed out of features
Features in Specific Domains
- Computer Vision’s Image Features - Feature Detection - Feature Detectors
- NLP’s Information Retrieval (IR) - Information Extraction (IE)
Feature Functions 𝑓𝑖(𝑦,𝒙)
𝑓𝑖: 𝑿×𝑌 → scalar or nominal
- inputs:
- 𝑿=𝒙: observed data
- 𝑌=𝑦: target value
- outputs either:
- scalar variable
- nominal variable (e.g. {0,1}, {0, 1, 2}, etc)
feature function properties:
feature function expectation
empirical expectation of a feature function 𝑓𝑖:
- 𝐄𝑒𝑚𝑝𝑖𝑟𝑖𝑐𝑎𝑙[𝑓𝑖] = 𝛴(𝑦,𝒙)∊𝑑𝑎𝑡𝑎[𝑓𝑖(𝑦,𝒙)]
model expectation of a feature function 𝑓𝑖:
- 𝐄𝑚𝑜𝑑𝑒𝑙[𝑓𝑖] = 𝛴(𝑦,𝒙)∊𝑿×𝑌[𝐏(𝑦,𝒙)·𝑓𝑖(𝑦,𝒙)]
Feature Conversions - To Numerical
Feature-Based Models
feature-based models:
- have a set of 𝑛 feature functions {𝑓1, …, 𝑓𝑛}
- will assign a weight 𝜃𝑖 to each feature function 𝑓𝑖:
- a POSITIVE weight says a particular observation 𝒙 MATCHES a particular class 𝑦
- a NEGATIVE weight says a particular observation 𝒙 DOES NOT MATCH a particular class 𝑦
some feature-based model types:
Feature-Based Models - Choosing the Right Features
Feature-Based Linear Models - As Probabilistic Model
make a probabilistic model from the linear combination:
- 𝛴1≤𝑖≤𝑛[𝜃𝑖𝑓𝑖(𝑦,𝒙)]
since 𝛴1≤𝑖≤𝑛[𝜃𝑖𝑓𝑖(𝑦,𝒙)] can be negative, we need to constrain it above 0. Thus we take the exponential:
- 𝑒𝛴1≤𝑖≤𝑛[𝜃𝑖𝑓𝑖(𝑦,𝒙)]
next we normalize it
- 𝐏(𝑌=𝑦|𝑿=𝒙) = 𝑒𝛴1≤𝑖≤𝑛[𝜃𝑖𝑓𝑖(𝑦,𝒙)]/ [ 𝛴𝑦’∊𝑌[𝑒𝛴1≤𝑖≤𝑛[𝜃𝑖𝑓𝑖(𝑦’,𝒙)]] ]