Skip to main content

HashingVectorizer

Text Feature Extraction standalone SDK operation. Source: 4.1.1.ML.FeatureExtraction.Text.cs. Read the complete C# integration test and setup.

1 recorded job(s); 1 have a success/completed status and a saved result. These are API records rather than independently verified test passes.

Recorded scenarios​

Recorded scenarioPartitionLast statusEvidenceJSON trace
Fetch20Newsgroups / HashingVectorizerwhole runcompletedResult recordedrun-0250

Representative execution​

Scenario: Fetch20Newsgroups / HashingVectorizer; partition: whole run; observed status: completed. run-0250 contains all recorded numbered JSON events for this job.

Operation selection in the C# test​

These are matching lines from the parameterized test, not a separate runnable program. See the full source for context.

["CountVectorizer", "HashingVectorizer", "TfidfTransformer", "TfidfVectorizer"];
"HashingVectorizer" => await SendTypedAsync(new HashingVectorizerJobSendRequestModel
ClassifierType = "HashingVectorizer",

Request​

{
"input": {
"input_blob_id": "0c8b3d5d-569b-2101-4ec6-f23e666c53c4",
"classifier_type": "HashingVectorizer",
"classifier_params": {
"n_features": 64,
"alternate_sign": false,
"norm": "l2"
},
"text_column": "text",
"file_format": "csv",
"evaluation": {
"test_size": 0.2,
"random_state": 42,
"shuffle": true
},
"generate_graphs": true
},
"output": {
"name": "Fetch20Newsgroups-HashingVectorizer.zip",
"description": "Feature extraction integration test using cached imputed training text",
"record_type": "Generic",
"access_tier": "Hot",
"tags": [
"text",
"feature-extraction",
"Fetch20Newsgroups",
"HashingVectorizer"
]
},
"request_timeout_seconds": 300
}

Send response​

{
"start_time": "2026-11-29T18:49:00.6098219+00:00",
"end_time": "2026-11-29T18:49:00.8071248+00:00",
"elapsed_milliseconds": 197.3,
"status": "published",
"job_id": "d64c9ef1-5dc9-bd27-53f4-68e58051b668",
"topic": "pm.topic.ml.featureextraction",
"subscription": "cpu.0p5c.1gi",
"send_request_model": {
"job_id": "d64c9ef1-5dc9-bd27-53f4-68e58051b668",
"json": {
"job_id": "d64c9ef1-5dc9-bd27-53f4-68e58051b668",
"model_id": "0092e982-80d0-a014-f4e5-efd5ad4b95a8",
"input": {
"input_blob_id": "0c8b3d5d-569b-2101-4ec6-f23e666c53c4",
"input_encryption_key": "[REDACTED]",
"classifier_type": "HashingVectorizer",
"classifier_params": {
"n_features": 64,
"alternate_sign": false,
"norm": "l2"
},
"text_column": "text",
"file_format": "csv"
},
"request_timeout_seconds": 300,
"output": {
"name": "Fetch20Newsgroups-HashingVectorizer.zip",
"description": "Feature extraction integration test using cached imputed training text",
"record_type": "Generic",
"access_tier": "Hot",
"tags": [
"text",
"feature-extraction",
"Fetch20Newsgroups",
"HashingVectorizer"
],
"encryption_key": "[REDACTED]"
},
"evaluation": {
"test_size": 0.2,
"random_state": 42,
"shuffle": true
},
"generate_graphs": true
},
"topic": "pm.topic.ml.featureextraction",
"subscription": "cpu.0p5c.1gi"
}
}

Final recorded status​

{
"start_time": "2026-11-29T18:50:01.1787139+00:00",
"end_time": "2026-11-29T18:50:01.4652333+00:00",
"elapsed_milliseconds": 286.52,
"job_id": "d64c9ef1-5dc9-bd27-53f4-68e58051b668",
"status": "completed",
"topic": "pm.topic.ml.featureextraction",
"subscription": "cpu.0p5c.1gi"
}

Result response​

{
"job_id": "d64c9ef1-5dc9-bd27-53f4-68e58051b668",
"execution": {
"execution_name": "[REDACTED]",
"job_name": "[REDACTED]",
"container": {
"hostname": "[REDACTED]",
"replica_name": "[REDACTED]",
"process_id": 1
}
},
"classifier_type": "HashingVectorizer",
"stats": {
"row_count": 8261,
"column_count": 4,
"feature_count": 64,
"training_row_count": 6608,
"test_row_count": 1653,
"feature_columns": [
"text"
],
"target_columns": [],
"file_format": "csv",
"task_type": "text_feature_extraction",
"metrics": {
"nonzero_feature_values": 322371,
"feature_density": 0.6097381521607553,
"mean_nonzero_features_per_document": 39.02324173828834
}
},
"effective_params": {
"n_features": 64,
"norm": "l2",
"alternate_sign": false
},
"learned": {
"feature_count": 64,
"vocabulary_size": null,
"vocabulary_type": "hash_buckets",
"feature_names_file": "feature_names.csv",
"feature_matrix_file": "features.npz",
"sparse_csv_format": "row_index,feature_index,value"
},
"warnings": [],
"runtime": {
"captured_at_utc": "2026-11-29T18:49:29.933138+00:00",
"python": {
"version": "3.12.16",
"implementation": "CPython"
},
"packages": {
"scikit-learn": "1.9.1",
"numpy": "2.5.4",
"pandas": "3.0.6",
"scipy": "1.18.1",
"pydantic": "2.14.1",
"joblib": "1.6.0",
"matplotlib": "3.11.2",
"azure-servicebus": "7.14.3",
"parallelmodel": "1.0.0"
},
"environment": {
"os": "Linux",
"os_release": "6.6.159.1-2.azl3",
"architecture": "x86_64",
"region": "uk1"
}
},
"artifact_format": "zip",
"artifact_archive": "text-feature-extraction-output.zip",
"artifact_files": [
"model.joblib",
"features.csv",
"result.json",
"features.npz",
"feature_names.csv",
"documents.csv",
"graphs/top_features.png"
]
}

First extract response​

{
"start_time": "2026-11-29T18:50:05.7259981+00:00",
"end_time": "2026-11-29T18:50:06.667357+00:00",
"elapsed_milliseconds": 941.35,
"status": "uploaded",
"model_id": "0092e982-80d0-a014-f4e5-efd5ad4b95a8",
"source_blob_id": "4e666622-34a1-4fbd-83fc-bdf55644a2cf",
"uploaded_blob_id": "9cdedfba-f7d4-146b-2c27-bcf1906924a8",
"filename": "4f6967cf-6098-f50f-7618-adc88e485bdb.joblib",
"source_path": "model.joblib",
"source_format": "joblib",
"size_bytes": 833,
"upload_status_code": 200
}

Logs​

The trace includes the saved log response (40 entries).

Reproduce the operation​

dotnet test --filter "FullyQualifiedName~ParallelModel.Sdk.UnitTests.FeatureExtraction.Run"

The filter runs the class theory; use the recorded scenario values above to identify the corresponding parameter set. For partitioned operations, one theory can submit multiple jobs. The redacted payload identifiers are not usable live credentials or blob IDs.