3.3 Trainable Classifiers
Key Takeaways
- Trainable classifiers detect unstructured content—resumes, source code, harassment, legal prose—that regex SITs, EDM tables, and form fingerprints cannot describe.
- A custom classifier needs 50–500 positive samples and 150–1,500 negative samples selected by a human and stored in dedicated SharePoint folders, not Teams or OneDrive folders.
- Retraining a published custom classifier is not supported; remove it and start over with larger sample sets. Unpublished classifiers can be improved by adding samples and restarting training.
- Microsoft Purview Communication Compliance supports Microsoft-provided trainable classifiers only; custom trainable classifiers are not supported there.
- Custom trainable classifiers are limited to English; classifiers evaluate only unencrypted items.
Some content has no stable form layout and no column of exact IDs. A resume is not a blank HR template with identical labels. Source code is not a Social Security number. Harassment in email is not a value in a hashed employee table. Trainable classifiers are the Microsoft Purview method for that unstructured class of content. A classifier learns a category by looking at hundreds of examples, then scores new items as in-category or out-of-category so you can auto-apply sensitivity labels, auto-apply retention labels, use the result in DLP, or—when the classifier is Microsoft-provided—use it in Communication Compliance.
The SC-401 decision boundary is: unstructured content where patterns fail. Pick fingerprinting for a fixed form. Pick EDM for exact values from a reference dataset. Pick a trainable classifier for resumes, source code, harassment, statements of work, merger documents, or similar prose.
Microsoft-provided versus custom classifiers
Microsoft-provided pretrained classifiers appear with status Ready to use. You do not seed them. They evaluate items in the languages listed in the trainable classifier definitions. Three exam-favorite examples:
- Resume — detects a job-applicant document that states prior work experience, education, and accomplishments (English; Office and PDF-style files).
- Source code — detects items whose bulk text is source code in languages such as C, C#, C++, Java, JavaScript, Python, Go, and others listed in the definitions. It does not detect source code interspersed with plain text.
- Harassment — detects offensive language targeting individuals based on traits such as race, ethnicity, religion, national origin, gender, sexual orientation, age, or disability, in multiple languages including English.
Other pretrained classifiers cover contracts, invoices, intellectual property, healthcare, human resources, and similar business categories. Always check the published definitions for file types and language support rather than inventing coverage.
Custom trainable classifiers exist when no pretrained classifier matches your category (for example, "Contoso deal desk approval memos"). Language support for custom classifiers is limited to English. There is more work, but the model is tailored to your organization.
Classifiers work only with items that are not encrypted. If a question puts the samples or the target library behind encryption, classification will not evaluate those items.
Where you can use them
Use classifiers as a condition for auto-labeling Office files with sensitivity labels, automatically applying a retention label policy based on a condition, sensitivity label conditions, and data loss prevention. Microsoft Purview Communication Compliance supports Microsoft-provided trainable classifiers only. Custom trainable classifiers are not supported in Communication Compliance. That distinction is an easy exam trap: a custom "harassment-like" classifier cannot be dropped into Communication Compliance; use the Microsoft-provided Harassment classifier instead.
In preview, trainable classifiers can appear in Content explorer under a Trainable Classifiers filter and show incident counts in SharePoint and Teams without labeling. If you do not want that display, Microsoft documents that you must file a request with Microsoft Support. Disabling scanning also stops sensitivity labeling and DLP policies that use those classifiers.
Seed content
Seeding is how a custom classifier learns. A human must select two sets:
- Positive samples — only items that strongly belong in the category.
- Negative samples — only items that clearly do not belong.
Published minimums and maximums:
| Sample set | Minimum | Maximum |
|---|---|---|
| Positive (in-category) | 50 | 500 |
| Negative (out-of-category) | 150 | 1,500 |
The more samples you provide, the more accurate the predictions. The classifier processes up to the 2,000 most recently created samples (by file created date/time). For testing, Microsoft recommends at least 200 items in the test sample set, including at least 50 positive and 150 negative examples.
Place the positive set and the negative set in separate SharePoint folders. Use a Communication site or another SharePoint site type, not a Teams folder and not a OneDrive folder. Each folder must hold only the seed content. Only text-based files are supported for seeding and testing; you cannot use image files or image-only PDFs. Supported crawled types follow SharePoint's parsed file types.
If you create a new SharePoint site and folder for seed data, allow at least an hour for that location to be indexed before you create the classifier. The account that creates the classifier must have access to those seed folders. By default, only the user who creates a custom classifier can train it and review its predictions.
Create, test, publish
Sign in to the Microsoft Purview portal as a Compliance admin or Security admin and go to Data loss prevention > Data classification > Classifiers. Open the Trainable classifiers tab and choose Create trainable classifier. Add the SharePoint site, library, and folder URL for positive examples, then the URL for negative examples, review, and create.
Microsoft documents a preview that automates testing and shortens the creation workflow from 12 days to two days, and in some cases to a few hours. Within 24 hours or less, the classifier processes seed data and builds a prediction model. Status is In progress while it processes. When finished, status becomes Training is complete and items have been tested.
Testing means you verify whether predictions are correct, incorrect, or uncertain (true positives, true negatives, false positives, false negatives). Microsoft uses that feedback in aggregate to improve the prediction model. To improve an unpublished classifier, review the test results, add more seed data, and restart training.
When accuracy is acceptable, choose Publish for use. After you publish, the classifier is available as a condition in Office auto-labeling with sensitivity labels and in auto-apply retention label policies. It sorts through items in locations such as SharePoint and Exchange and classifies matching content.
Permissions depend on how you consume the classifier: Record Management or Retention Management for retention label policies; Security Administrator, Compliance Administrator, or Compliance Data Administrator for sensitivity label policies; Insider Risk Management Administrator or Supervisory Review Administrator for Communication Compliance policies (Microsoft-provided classifiers only).
Retraining: the published-classifier rule
Retraining published custom classifiers is not supported. If a published classifier is inaccurate, remove the classifier and start over with larger sample sets. Do not look for an in-place retrain button on a published custom classifier—that is the trap. Unpublished classifiers can still be improved by updating the dataset and restarting training.
Custom classifier examples Microsoft lists include legal documents (attorney-client privilege, closing sets, statements of work), strategic business documents (press releases, merger and acquisition files, design docs), pricing information (invoices, quotes, work orders), and financial information (quarterly results). Those are all cases where the kind of document matters more than a regex or a hashed ID.
If the exam item gives you a blank benefits-enrollment PDF that every employee completes, that is still document fingerprinting. If it gives you a CSV of badge IDs, that is EDM. If it gives you a mix of employee-written resumes in SharePoint, pick the Resume pretrained classifier—or a custom classifier if your definition of "resume" is nonstandard and English-only custom training is acceptable.
Recruiting stores candidate resumes in many layouts in SharePoint. A regex SIT for the word Resume and an EDM table of candidate email addresses both miss most files. You need auto-labeling to find actual resume documents. What should you use first?
You are creating a custom trainable classifier for Contoso statements of work. Where must the seed content live, and how many samples does Microsoft require?
A custom trainable classifier was published last month and is producing too many false positives on SharePoint. What does Microsoft support for improving that published classifier?