Trainable Classifiers
Earn 25 points (50 with Pro) in two steps
- ① Read through the lesson — each section gets a ✓ as you scroll through it.
- ② When every section has a ✓, tap Complete lesson.
0 of 10 read · keep scrolling
✦ See fewer ads and earn double points — 50 a lesson instead of 25 — with Pro
Module: Implement Information Protection
Section: Sensitive Information Types
Lesson Title: Trainable Classifiers
In the world of data protection, identifying what information needs to be secured is the first and most critical step. For years, organizations relied on pattern matching—looking for specific strings of numbers like credit card digits or social security numbers. While effective for structured data, this approach fails when it comes to unstructured content. How do you tell a computer to identify a "contract," a "legal brief," or "source code" when there is no single specific pattern to look for? This is where trainable classifiers come into play.
Trainable classifiers use machine learning to identify documents based on what they are, rather than just what they contain in terms of specific strings. Instead of looking for a regular expression (RegEx) or a keyword list, a classifier looks at the overall context, structure, and language used in a file. This lesson will dive deep into how these classifiers work, how to build your own, and how to integrate them into your broader Microsoft Purview information protection strategy.
Not read yet
Understanding the Shift: From Patterns to Context
Traditional Sensitive Information Types (SITs) are the backbone of most data loss prevention (DLP) strategies. They are fantastic for finding "fingerprints"—well-defined patterns like a 16-digit credit card number or a specific employee ID format. However, business communication is rarely that structured. A "Project Proposal" might contain various keywords, but no single keyword proves it is a proposal. It is the combination of the executive summary, the budget tables, the timeline, and the formal tone that defines the document type.
Trainable classifiers bridge this gap by using a method called "classification by example." Instead of writing code to describe a document, you provide the system with examples of the document you want it to find. The machine learning model analyzes these examples to find commonalities in syntax, word proximity, and document structure. This allows the system to identify complex categories of information that were previously invisible to automated scanning tools.
Callout: Pattern Matching vs. Machine Learning
Pattern Matching (SITs): Relies on rigid rules. If a document has 9 digits in a specific format, it is a Social Security Number. It is highly accurate but brittle; if the format changes slightly, the rule fails.
Machine Learning (Trainable Classifiers): Relies on statistical probability. It looks at the "vibe" and structure of the document. It is flexible and can identify types of documents that have no fixed format, such as resumes or harassment in emails.
Not read yet
Pre-trained Classifiers: The Out-of-the-Box Solution
Microsoft provides a significant number of pre-trained classifiers that are ready to use immediately. These have been trained on massive datasets and cover common business and regulatory needs. Understanding these is important because you should always check if a pre-trained model exists before spending the time and resources to build a custom one.
1. Communication Compliance Classifiers
These are designed to detect workplace conduct issues. They look for specific types of language in emails, Teams messages, and other communication channels:
- Harassment: Identifies offensive language or targeted attacks against individuals or groups.
- Profanity: Detects vulgar language that violates corporate policy.
- Threat: Identifies language that suggests physical harm or violence.
2. Business Document Classifiers
These help organize and protect intellectual property and administrative data:
- Source Code: Identifies various programming languages (C#, Python, Java, etc.). This is vital for tech companies wanting to prevent their proprietary code from leaking.
- Agreements: Detects legal contracts, service level agreements, and non-disclosure agreements.
- Resumes: Identifies CVs and resumes, which is essential for HR departments managing PII (Personally Identifiable Information).
- Invoices: Recognizes billing documents, helping finance departments track and secure financial data flow.
3. Industry-Specific Classifiers
Microsoft also provides classifiers tailored to specific sectors, such as healthcare (Medical Records) and finance (Financial Statements). These are updated by Microsoft periodically to reflect evolving document standards and language usage.
Not read yet
Building a Custom Trainable Classifier: The Lifecycle
When the pre-trained models don't meet your specific needs—perhaps you need to identify a very specific type of internal research report or a unique engineering schematic description—you must build a custom classifier. This process is iterative and requires a clean set of data.
Step 1: Gathering the Seed Set
The "Seed Set" is the foundation of your classifier. You need two groups of documents:
- Positive Examples: Between 50 and 500 samples of the documents you want to identify. These must be "clean"—meaning they are definitive examples of that document type.
- Negative Examples: A similar number of documents that are not what you are looking for. Ideally, these should be "near misses." For example, if you are training a classifier for "Sales Contracts," your negative examples should include "Sales Training Manuals" or "General Invoices." This teaches the model the nuances between similar but different categories.
Step 2: Training and Analysis
Once you upload your seed set to Microsoft Purview, the system begins the training phase. This typically takes 24 to 48 hours. During this time, the machine learning model builds a map of the features that define your positive samples.
Note: The quality of your seed set is more important than the quantity. If you provide 500 documents but 50 of them are mislabeled, the resulting classifier will be significantly less accurate. It is better to have 100 perfectly curated samples than 500 "mostly correct" ones.
Step 3: Testing and Feedback (The Human-in-the-Loop)
After the initial training, the classifier isn't ready for production yet. You must enter the "Testing" phase. The system will present you with a new set of documents (around 10,000 items from your environment) and ask you to verify its predictions.
- You will see a document and the classifier's guess (e.g., "Match" or "No Match").
- You must provide feedback: "Yes, this is a match" or "No, this is a false positive."
- This feedback loop is what refines the model's accuracy. You usually need to review several hundred items to reach a high level of precision.
Not read yet
Step-by-Step: Creating a Custom Classifier
If you are tasked with creating a classifier for "Internal Project Charters," follow these steps within the Microsoft Purview compliance portal.
1. Prepare Your Data
Create two folders on a local drive or a secure cloud location.
- Folder A: "Project_Charters_Positive" (100 files)
- Folder B: "Non_Charters_Negative" (100 files) Ensure the files are in supported formats (PDF, DOCX, etc.) and that they contain actual text (not just scanned images without OCR).
2. Initiate the Creation in Purview
- Navigate to the Microsoft Purview compliance portal.
- Go to Data classification > Trainable classifiers.
- Select Create trainable classifier.
- Give it a name (e.g., "Internal Project Charters") and a clear description. This description is helpful for other admins who might use your classifier in DLP policies later.
3. Upload the Seed Samples
Follow the wizard to upload your positive and negative sets. Purview uses a temporary Azure blob storage location to process these files. Once uploaded, click Finish. At this point, the status will change to "In progress."
4. Review and Publish
Wait for the training to complete. Once the status changes to "Need test items," you will begin the manual review process described in the previous section.
- Click on your classifier.
- Select the Tested items tab.
- Review the items and mark them as Match or Not a match.
- Once the "Accuracy" and "Recall" metrics reach a satisfactory level (usually above 80%), click Publish.
Warning: Do not publish a classifier with low precision. If a classifier has a 50% precision rate, it means half of the alerts it generates in your DLP policy will be false positives, leading to "alert fatigue" for your security team.
Not read yet
Technical Integration with PowerShell
While most management happens in the UI, you can use the Security & Compliance PowerShell module to view and manage classifiers. This is particularly useful for auditing what classifiers are available across a large tenant.
To get started, you need to connect to the module:
# Connect to Security & Compliance PowerShell
Connect-IPPSSession -UserPrincipalName [email protected]
Once connected, you can list all trainable classifiers:
# List all trainable classifiers and their current status
Get-TrainableClassifier | Select-Object Name, Status, Publisher
If you need to find the specific ID of a classifier to use in a custom script or a more complex policy configuration:
# Get details for a specific classifier
$MyClassifier = Get-TrainableClassifier -Identity "Internal Project Charters"
$MyClassifier.Guid
Understanding the GUID is important because, in some advanced XML-based DLP configurations, you reference the classifier by its unique identifier rather than its display name.
Not read yet
Practical Use Cases for Trainable Classifiers
Where do these actually live once they are published? They are integrated into the core components of Microsoft Purview.
1. Data Loss Prevention (DLP)
You can create a DLP policy that triggers when a "Source Code" classifier detects content being sent to an external recipient. This is more effective than keyword-based DLP because it can distinguish between a technical discussion (which might use some keywords) and an actual block of code.
2. Auto-labeling with Sensitivity Labels
You can configure a sensitivity label to be automatically applied to a document if it matches a trainable classifier. For example, any document identified as a "Legal Agreement" can be automatically labeled as "Confidential - Legal" and encrypted, regardless of where it is saved in SharePoint or OneDrive.
3. Retention Policies
In the "Records Management" section of Purview, you can use classifiers to trigger retention. If a document is identified as an "Invoice," the system can automatically apply a 7-year retention period to ensure compliance with financial regulations.
Not read yet
Comparison: SITs vs. Trainable Classifiers vs. EDM
It is important to know which tool to pick for the job. Using a trainable classifier for something simple like a phone number is a waste of resources, and using a SIT for a complex document type will result in poor accuracy.
| Feature | Sensitive Info Types (SIT) | Exact Data Match (EDM) | Trainable Classifiers |
|---|---|---|---|
| Best For | Generic patterns (Credit Cards, SSN) | Specific database records (Customer IDs) | Document types/Context (Contracts, Code) |
| Logic | RegEx, Keywords, Checksums | Exact match against a hash of your data | Machine Learning / Statistical probability |
| Setup Effort | Low (Built-in or simple RegEx) | Medium (Requires data upload/hashing) | High (Requires seed sets and training) |
| Flexibility | Rigid | Extremely specific | Very flexible and contextual |
| False Positives | Moderate (depends on keywords) | Very Low | Low (after proper training) |
Best Practices for Success
Working with machine learning requires a different mindset than working with traditional IT rules. Here are the industry standards for maintaining high-quality classifiers.
1. Focus on the "Near Misses"
When providing negative samples during the seed phase, don't just provide random documents like "Pictures of the office party" or "Lunch menus." If you want to detect "Employment Contracts," use "Employee Handbooks" or "Performance Review Templates" as your negative samples. This forces the model to learn the specific language that distinguishes a contract from other HR documents.
2. Maintain Data Diversity
If you are training a classifier for "Invoices," don't just use invoices from one vendor. If all your samples are from "Vendor A," the model might accidentally learn to identify "Vendor A's Logo" or "Vendor A's Address" instead of the concept of an invoice. Use samples from 20 different vendors to ensure the model learns the universal structure of an invoice.
3. Monitor for "Drift"
Document formats change over time. An invoice from 2010 looks different than a digital invoice from 2024. Periodically review the performance of your custom classifiers. If you notice an increase in false negatives (missing items), it might be time to retrain the model with more recent samples.
4. Permissions and Privacy
Only users with the Content Explorer Content Viewer role can see the actual content of the files during the testing/feedback phase. Ensure that the person training the classifier is authorized to view the sensitive data they are classifying.
Callout: The "Precision vs. Recall" Balance
Precision: Out of all the times the classifier said "This is a contract," how many were actually contracts? High precision means fewer false positives.
Recall: Out of all the contracts in your environment, how many did the classifier actually find? High recall means fewer false negatives (missing data).
In data protection, we usually aim for high precision first to avoid overwhelming the security team with false alerts.
Not read yet
Common Pitfalls and How to Avoid Them
Even with the best intentions, classifier projects can go off the rails. Here are the most common mistakes seen in the field.
1. Using Overlapping Categories
If you try to create one classifier for "Legal Documents" and another for "Contracts," you are going to have a bad time. Contracts are legal documents. The machine learning model will get confused because the samples will look nearly identical.
- Solution: Be specific. Instead of "Legal Documents," create "Non-Disclosure Agreements," "Litigation Briefs," and "Patent Filings." Ensure there is clear daylight between the definitions of your categories.
2. Insufficient Testing
Many admins publish a classifier after reviewing only 10 or 20 items in the test phase. This is not enough data for the model to stabilize.
- Solution: Commit to reviewing at least 200-300 items before publishing. It is a tedious process, but it is the only way to ensure the model is reliable in a production environment.
3. Ignoring Pre-trained Classifiers
Sometimes teams spend weeks gathering samples for a "Source Code" classifier, only to realize Microsoft already provides one that is trained on millions of lines of code.
- Solution: Always audit the list of
Get-TrainableClassifierbefore starting a custom project. Microsoft adds new ones frequently.
4. Expecting Instant Results
Training and testing take time. Between the initial 48-hour training period and the manual review of 10,000 test items, a high-quality classifier can take a week or two to fully deploy.
- Solution: Build this time into your project plan. Don't promise a "Source Code" DLP policy by tomorrow morning if you haven't started the training yet.
Not read yet
Advanced Concept: Combining Classifiers with Other SITs
You don't have to use trainable classifiers in a vacuum. In fact, they are most powerful when combined with other detection methods in a single DLP policy.
Consider a "Sensitive Project" scenario. You might create a policy that looks for:
- A Trainable Classifier: "Engineering Schematics"
- AND a keyword list: "Project X," "Project Manhattan," "Top Secret"
- AND a Sensitive Information Type: "IP Address"
By using "AND" logic, you significantly reduce false positives. The policy won't trigger for a random document that mentions "Project X," nor will it trigger for a generic engineering drawing. It will only trigger when it finds an engineering drawing that specifically mentions "Project X." This layered approach is the hallmark of a mature information protection strategy.
Summary and Key Takeaways
Trainable classifiers represent the next evolution in data classification. By moving beyond simple text strings and into the realm of machine learning, they allow organizations to protect their most valuable and complex intellectual property.
- Context is King: Trainable classifiers identify documents based on their nature and structure (what they are), not just specific characters (what they contain).
- Start with Pre-trained: Microsoft offers a wide array of built-in classifiers for communication compliance, legal, HR, and finance. Use these first.
- Quality Over Quantity: When building custom classifiers, 100 high-quality, diverse samples are better than 500 messy or repetitive ones.
- The Feedback Loop is Essential: You must participate in the "Human-in-the-Loop" testing phase to refine the model's precision and recall.
- Strategic Integration: Classifiers are not standalone tools; they should be integrated into DLP policies, auto-labeling rules, and retention schedules.
- Avoid Overlap: Ensure your custom categories are distinct. Overlapping definitions lead to confused models and inaccurate results.
- Patience and Persistence: Machine learning models require time to train and human effort to validate. Do not rush the publishing process.
By mastering trainable classifiers, you move from a reactive security posture—where you only protect what you can define with a RegEx—to a proactive posture where the system understands the value of your data as well as your employees do.
Not read yet
Each section gets a ✓ as you scroll through it. Tap the button to jump to the next one.
- Introduction to Information Protection
- Introduction to Information Protection Quiz5q
- Understanding Sensitivity Labels
- Understanding Sensitivity Labels Quiz5q
- Creating Sensitivity Labels
- Creating Sensitivity Labels Quiz5q
- Label Priority and Hierarchy
- Label Priority and Hierarchy Quiz5q
- Sublabels and Label Scopes
- Sublabels and Label Scopes Quiz5q
- Publishing Sensitivity Labels
- Publishing Sensitivity Labels Quiz5q
- Default Labels and Mandatory Labeling
- Default Labels and Mandatory Labeling Quiz5q
- Justification for Label Changes
- Justification for Label Changes Quiz5q
- Auto-labeling Policies
- Auto-labeling Policies Quiz5q
- Client-side vs Service-side Labeling
- Client-side vs Service-side Labeling Quiz5q
- Configuring Encryption Settings
- Configuring Encryption Settings Quiz5q
- Rights Management Permissions
- Rights Management Permissions Quiz5q
- Double Key Encryption
- Double Key Encryption Quiz5q
- Content Marking Configuration
- Content Marking Configuration Quiz5q
- S/MIME Email Encryption
- S/MIME Email Encryption Quiz5q
- Built-in Sensitive Information Types
- Built-in Sensitive Information Types Quiz5q
- Custom Sensitive Information Types
- Custom Sensitive Information Types Quiz5q
- Exact Data Match SITs
- Exact Data Match SITs Quiz5q
- Trainable Classifiers
- Trainable Classifiers Quiz5q
- Named Entities and Document Fingerprinting
- Named Entities and Document Fingerprinting Quiz5q
- Introduction to Data Loss Prevention
- Introduction to Data Loss Prevention Quiz5q
- Creating DLP Policies
- Creating DLP Policies Quiz5q
- DLP Policy Conditions and Actions
- DLP Policy Conditions and Actions Quiz5q
- DLP Policy Templates
- DLP Policy Templates Quiz5q
- User Notifications and Policy Tips
- User Notifications and Policy Tips Quiz5q
- Introduction to Endpoint DLP
- Introduction to Endpoint DLP Quiz5q
- Onboarding Devices for Endpoint DLP
- Onboarding Devices for Endpoint DLP Quiz5q
- Endpoint DLP Settings
- Endpoint DLP Settings Quiz5q
- Endpoint DLP Activities and Restrictions
- Endpoint DLP Activities and Restrictions Quiz5q
- Just-in-time Protection
- Just-in-time Protection Quiz5q
- Introduction to Records Management
- Introduction to Records Management Quiz5q
- File Plan and Record Labels
- File Plan and Record Labels Quiz5q
- Regulatory Records and Legal Holds
- Regulatory Records and Legal Holds Quiz5q
- Event-based Retention
- Event-based Retention Quiz5q
- Record Versioning
- Record Versioning Quiz5q
- Introduction to Insider Risk Management
- Introduction to Insider Risk Management Quiz5q
- Insider Risk Policies
- Insider Risk Policies Quiz5q
- Triggering Events and Indicators
- Triggering Events and Indicators Quiz5q
- Priority User Groups
- Priority User Groups Quiz5q
- Investigating Insider Risk Alerts
- Investigating Insider Risk Alerts Quiz5q
- Introduction to Communication Compliance
- Introduction to Communication Compliance Quiz5q
- Creating Communication Compliance Policies
- Creating Communication Compliance Policies Quiz5q
- Policy Conditions and Classifiers
- Policy Conditions and Classifiers Quiz5q
- Investigating Communication Alerts
- Investigating Communication Alerts Quiz5q
- Optical Character Recognition in Messages
- Optical Character Recognition in Messages Quiz5q
- Protecting Data Used by AI
- Protecting Data Used by AI Quiz5q
- Copilot Data Protection Controls
- Copilot Data Protection Controls Quiz5q
- AI Hub in Microsoft Purview
- AI Hub in Microsoft Purview Quiz5q
- DLP for AI Applications
- DLP for AI Applications Quiz5q
- Monitoring AI Interactions
- Monitoring AI Interactions Quiz5q
- SC-401 Exam Preparation Review
- SC-401 Exam Preparation Review Quiz5q
- Multi-geo Compliance Configuration
- Multi-geo Compliance Configuration Quiz5q
- Cross-tenant Collaboration Protection
- Cross-tenant Collaboration Protection Quiz5q
- Third-party Application Integration
- Third-party Application Integration Quiz5q
- Power Platform DLP Integration
- Power Platform DLP Integration Quiz5q
- Microsoft Defender for Cloud Apps DLP
- Microsoft Defender for Cloud Apps DLP Quiz5q
- Information Barriers Configuration
- Information Barriers Configuration Quiz5q
- Privileged Access Management
- Privileged Access Management Quiz5q
- Customer Lockbox Implementation
- Customer Lockbox Implementation Quiz5q
- Compliance Reports and Dashboards
- Compliance Reports and Dashboards Quiz5q
- Data Classification Analytics
- Data Classification Analytics Quiz5q
- Compliance Score Improvement
- Compliance Score Improvement Quiz5q
- Data Connectors for Compliance
- Data Connectors for Compliance Quiz5q
- Regulatory Compliance Assessments
- Regulatory Compliance Assessments Quiz5q
- Custom Assessments Templates
- Custom Assessments Templates Quiz5q
- SC-401 Final Exam Preparation
- SC-401 Final Exam Preparation Quiz5q
Spend your points to unlock exam-style practice questions
Spend points to unlock SC-401 exam-style practice questions.
Practice for SC-401