Skip to main content

KernelDensity

Nearest Neighbors standalone SDK operation. Source: 6.8.ML.Neighbors.cs. Read the complete C# integration test and setup.

22 recorded job(s); 22 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
LoadBreastCancer-TrainTestSplit-SimpleImputer-FunctionTransformer / KernelDensitywhole runcompletedResult recordedrun-0634
LoadBreastCancer-TrainTestSplit-SimpleImputer-KBinsDiscretizer / KernelDensitywhole runcompletedResult recordedrun-0642
LoadBreastCancer-TrainTestSplit-SimpleImputer-QuantileTransformer / KernelDensitywhole runcompletedResult recordedrun-0650
LoadBreastCancer-TrainTestSplit-SimpleImputer-StandardScaler / KernelDensitywhole runcompletedResult recordedrun-0658
LoadBreastCancer-TrainTestSplit-SimpleImputer-normalize / KernelDensitywhole runcompletedResult recordedrun-0666
LoadDiabetes-TrainTestSplit-SimpleImputer-KBinsDiscretizer / KernelDensitywhole runcompletedResult recordedrun-0674
LoadDiabetes-TrainTestSplit-SimpleImputer-QuantileTransformer / KernelDensitywhole runcompletedResult recordedrun-0680
LoadDiabetes-TrainTestSplit-SimpleImputer-StandardScaler / KernelDensitywhole runcompletedResult recordedrun-0686
LoadDiabetes-TrainTestSplit-SimpleImputer-normalize / KernelDensitywhole runcompletedResult recordedrun-0692
LoadWine-TrainTestSplit-SimpleImputer-FunctionTransformer / KernelDensitywhole runcompletedResult recordedrun-0698
LoadWine-TrainTestSplit-SimpleImputer-KBinsDiscretizer / KernelDensitywhole runcompletedResult recordedrun-0706
LoadWine-TrainTestSplit-SimpleImputer-QuantileTransformer / KernelDensitywhole runcompletedResult recordedrun-0714
LoadWine-TrainTestSplit-SimpleImputer-StandardScaler / KernelDensitywhole runcompletedResult recordedrun-0722
LoadWine-TrainTestSplit-SimpleImputer-normalize / KernelDensitywhole runcompletedResult recordedrun-0730
MakeClassification-TrainTestSplit-SimpleImputer-KBinsDiscretizer / KernelDensitywhole runcompletedResult recordedrun-0738
MakeClassification-TrainTestSplit-SimpleImputer-QuantileTransformer / KernelDensitywhole runcompletedResult recordedrun-0746
MakeClassification-TrainTestSplit-SimpleImputer-StandardScaler / KernelDensitywhole runcompletedResult recordedrun-0754
MakeClassification-TrainTestSplit-SimpleImputer-normalize / KernelDensitywhole runcompletedResult recordedrun-0762
MakeRegression-TrainTestSplit-SimpleImputer-KBinsDiscretizer / KernelDensitywhole runcompletedResult recordedrun-0770
MakeRegression-TrainTestSplit-SimpleImputer-QuantileTransformer / KernelDensitywhole runcompletedResult recordedrun-0776
MakeRegression-TrainTestSplit-SimpleImputer-StandardScaler / KernelDensitywhole runcompletedResult recordedrun-0782
MakeRegression-TrainTestSplit-SimpleImputer-normalize / KernelDensitywhole runcompletedResult recordedrun-0788

Representative execution​

Scenario: LoadBreastCancer-TrainTestSplit-SimpleImputer-FunctionTransformer / KernelDensity; partition: whole run; observed status: completed. run-0634 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.

"KNeighborsClassifier", "KNeighborsRegressor", "KNeighborsTransformer", "KernelDensity",
"KernelDensity" or "KNeighborsRegressor" or "KNeighborsTransformer" or "LocalOutlierFactor"
"KernelDensity" or "KNeighborsClassifier" or "KNeighborsTransformer" or "LocalOutlierFactor"
"KernelDensity" => await SendTypedAsync(new KernelDensityJobSendRequestModel
ClassifierType = "KernelDensity",

Request​

{
"input": {
"train_blob_id": "6cd0072c-cacf-f966-963c-7dc144f9db7c",
"test_blob_id": "608f8ac2-dcb0-3eb6-7fa1-4c76b6136d96",
"classifier_type": "KernelDensity",
"classifier_params": {
"bandwidth": 1
},
"feature_columns": [
"mean radius",
"mean texture",
"mean perimeter",
"mean area",
"mean smoothness",
"mean compactness",
"mean concavity",
"mean concave points",
"mean symmetry",
"mean fractal dimension",
"radius error",
"texture error",
"perimeter error",
"area error",
"smoothness error",
"compactness error",
"concavity error",
"concave points error",
"symmetry error",
"fractal dimension error",
"worst radius",
"worst texture",
"worst perimeter",
"worst area",
"worst smoothness",
"worst compactness",
"worst concavity",
"worst concave points",
"worst symmetry",
"worst fractal dimension"
],
"file_format": "csv",
"generate_graphs": true
},
"output": {
"name": "LoadBreastCancer-TrainTestSplit-SimpleImputer-FunctionTransformer-KernelDensity.zip",
"description": "Neighbors integration test using cached numerical preprocessing outputs",
"record_type": "Generic",
"access_tier": "Hot",
"tags": [
"neighbors",
"LoadBreastCancer",
"FunctionTransformer",
"KernelDensity"
],
"artifact_contract_version": "2.0"
},
"request_timeout_seconds": 300
}

Send response​

{
"start_time": "2026-11-30T21:16:13.0597443+00:00",
"end_time": "2026-11-30T21:16:13.1403001+00:00",
"elapsed_milliseconds": 80.55,
"status": "published",
"job_id": "da1d7ce2-9c69-fc19-62e2-842a4943b3b4",
"topic": "pm.topic.ml.neighbors",
"subscription": "cpu.0p5c.1gi",
"send_request_model": {
"job_id": "da1d7ce2-9c69-fc19-62e2-842a4943b3b4",
"json": {
"job_id": "da1d7ce2-9c69-fc19-62e2-842a4943b3b4",
"model_id": "0092e982-80d0-a014-f4e5-efd5ad4b95a8",
"input": {
"train_blob_id": "6cd0072c-cacf-f966-963c-7dc144f9db7c",
"train_encryption_key": "[REDACTED]",
"test_blob_id": "608f8ac2-dcb0-3eb6-7fa1-4c76b6136d96",
"test_encryption_key": "[REDACTED]",
"classifier_type": "KernelDensity",
"classifier_params": {
"bandwidth": 1
},
"feature_columns": [
"mean radius",
"mean texture",
"mean perimeter",
"mean area",
"mean smoothness",
"mean compactness",
"mean concavity",
"mean concave points",
"mean symmetry",
"mean fractal dimension",
"radius error",
"texture error",
"perimeter error",
"area error",
"smoothness error",
"compactness error",
"concavity error",
"concave points error",
"symmetry error",
"fractal dimension error",
"worst radius",
"worst texture",
"worst perimeter",
"worst area",
"worst smoothness",
"worst compactness",
"worst concavity",
"worst concave points",
"worst symmetry",
"worst fractal dimension"
],
"file_format": "csv"
},
"request_timeout_seconds": 300,
"output": {
"name": "LoadBreastCancer-TrainTestSplit-SimpleImputer-FunctionTransformer-KernelDensity.zip",
"description": "Neighbors integration test using cached numerical preprocessing outputs",
"record_type": "Generic",
"access_tier": "Hot",
"tags": [
"neighbors",
"LoadBreastCancer",
"FunctionTransformer",
"KernelDensity"
],
"encryption_key": "[REDACTED]",
"artifact_contract_version": "2.0"
},
"evaluation": null,
"generate_graphs": true
},
"topic": "pm.topic.ml.neighbors",
"subscription": "cpu.0p5c.1gi"
}
}

Final recorded status​

{
"start_time": "2026-11-30T21:17:13.5677538+00:00",
"end_time": "2026-11-30T21:17:14.370341+00:00",
"elapsed_milliseconds": 802.58,
"job_id": "da1d7ce2-9c69-fc19-62e2-842a4943b3b4",
"status": "completed",
"topic": "pm.topic.ml.neighbors",
"subscription": "cpu.0p5c.1gi"
}

Result response​

{
"schema_version": "2.0",
"job_id": "da1d7ce2-9c69-fc19-62e2-842a4943b3b4",
"model_id": "0092e982-80d0-a014-f4e5-efd5ad4b95a8",
"status": "succeeded",
"worker": {
"name": "neighbors",
"task_family": "density_estimation",
"algorithm": "KernelDensity"
},
"input": {
"mode": "prepared_train_test",
"partitions": {
"train": {
"blob_id": "6cd0072c-cacf-f966-963c-7dc144f9db7c",
"row_count": 426
},
"test": {
"blob_id": "608f8ac2-dcb0-3eb6-7fa1-4c76b6136d96",
"row_count": 143
}
},
"feature_columns": [
"mean radius",
"mean texture",
"mean perimeter",
"mean area",
"mean smoothness",
"mean compactness",
"mean concavity",
"mean concave points",
"mean symmetry",
"mean fractal dimension",
"radius error",
"texture error",
"perimeter error",
"area error",
"smoothness error",
"compactness error",
"concavity error",
"concave points error",
"symmetry error",
"fractal dimension error",
"worst radius",
"worst texture",
"worst perimeter",
"worst area",
"worst smoothness",
"worst compactness",
"worst concavity",
"worst concave points",
"worst symmetry",
"worst fractal dimension"
]
},
"training": {
"effective_params": {
"algorithm": "auto",
"atol": 0.0,
"bandwidth": 1.0,
"breadth_first": true,
"kernel": "gaussian",
"leaf_size": 40,
"metric": "euclidean",
"metric_params": null,
"rtol": 0.0
},
"metrics": {}
},
"evaluation": {
"partition": "test",
"metrics": {
"scope": "holdout",
"sample_count": 143,
"output_dimension": null,
"mean_neighbor_distance": null,
"graph_edge_count": null,
"mean_log_density": -28.567767133300237,
"non_finite_log_density_count": 0,
"outlier_count": null,
"outlier_fraction": null,
"mean_outlier_score": null
}
},
"artifact_files": [
"model/model.joblib",
"predictions/predictions.csv",
"graphs/output_distribution.png",
"graphs/output_distribution.svg",
"result.json"
],
"extras": {
"algorithm": {
"learned": {
"n_features_in": 30,
"n_samples_fit": null,
"effective_metric": null,
"effective_metric_params": null,
"classes": null,
"centroids": null,
"class_prior": null,
"components": null,
"n_iter": null,
"bandwidth": 1.0,
"n_neighbors": null,
"offset": null
},
"warnings": [],
"data": {
"row_count": 569,
"column_count": 33,
"feature_count": 30,
"file_format": "csv",
"prediction_scope": "all_input_rows",
"training_row_indices": null
},
"runtime": {
"captured_at_utc": "2026-11-30T21:16:44.474186+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"
}
},
"execution": {
"executionName": "[REDACTED]",
"jobName": "[REDACTED]",
"container": {
"hostname": "[REDACTED]",
"replicaName": "[REDACTED]",
"processId": 1
}
}
},
"build": {
"built_at_utc": null,
"source": "unavailable",
"image_tag": null
}
}
}

First extract response​

{
"start_time": "2026-11-30T21:17:31.3627644+00:00",
"end_time": "2026-11-30T21:17:32.3179909+00:00",
"elapsed_milliseconds": 955.21,
"status": "uploaded",
"model_id": "0092e982-80d0-a014-f4e5-efd5ad4b95a8",
"source_blob_id": "850feed5-ca5a-aee1-84e2-8e2582df39b8",
"uploaded_blob_id": "411132f5-2e06-50af-f650-0ee87f64e2b6",
"filename": "a0a07551-71e2-cd22-b11f-0591ead2f70d.json",
"source_path": "result.json",
"source_format": "json",
"size_bytes": 3982,
"upload_status_code": 200
}

Logs​

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

Reproduce the operation​

dotnet test --filter "FullyQualifiedName~ParallelModel.Sdk.UnitTests.Neighbors.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.