Skip to main content

KNeighborsTransformer

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 / KNeighborsTransformerwhole runcompletedResult recordedrun-0633
LoadBreastCancer-TrainTestSplit-SimpleImputer-KBinsDiscretizer / KNeighborsTransformerwhole runcompletedResult recordedrun-0641
LoadBreastCancer-TrainTestSplit-SimpleImputer-QuantileTransformer / KNeighborsTransformerwhole runcompletedResult recordedrun-0649
LoadBreastCancer-TrainTestSplit-SimpleImputer-StandardScaler / KNeighborsTransformerwhole runcompletedResult recordedrun-0657
LoadBreastCancer-TrainTestSplit-SimpleImputer-normalize / KNeighborsTransformerwhole runcompletedResult recordedrun-0665
LoadDiabetes-TrainTestSplit-SimpleImputer-KBinsDiscretizer / KNeighborsTransformerwhole runcompletedResult recordedrun-0673
LoadDiabetes-TrainTestSplit-SimpleImputer-QuantileTransformer / KNeighborsTransformerwhole runcompletedResult recordedrun-0679
LoadDiabetes-TrainTestSplit-SimpleImputer-StandardScaler / KNeighborsTransformerwhole runcompletedResult recordedrun-0685
LoadDiabetes-TrainTestSplit-SimpleImputer-normalize / KNeighborsTransformerwhole runcompletedResult recordedrun-0691
LoadWine-TrainTestSplit-SimpleImputer-FunctionTransformer / KNeighborsTransformerwhole runcompletedResult recordedrun-0697
LoadWine-TrainTestSplit-SimpleImputer-KBinsDiscretizer / KNeighborsTransformerwhole runcompletedResult recordedrun-0705
LoadWine-TrainTestSplit-SimpleImputer-QuantileTransformer / KNeighborsTransformerwhole runcompletedResult recordedrun-0713
LoadWine-TrainTestSplit-SimpleImputer-StandardScaler / KNeighborsTransformerwhole runcompletedResult recordedrun-0721
LoadWine-TrainTestSplit-SimpleImputer-normalize / KNeighborsTransformerwhole runcompletedResult recordedrun-0729
MakeClassification-TrainTestSplit-SimpleImputer-KBinsDiscretizer / KNeighborsTransformerwhole runcompletedResult recordedrun-0737
MakeClassification-TrainTestSplit-SimpleImputer-QuantileTransformer / KNeighborsTransformerwhole runcompletedResult recordedrun-0745
MakeClassification-TrainTestSplit-SimpleImputer-StandardScaler / KNeighborsTransformerwhole runcompletedResult recordedrun-0753
MakeClassification-TrainTestSplit-SimpleImputer-normalize / KNeighborsTransformerwhole runcompletedResult recordedrun-0761
MakeRegression-TrainTestSplit-SimpleImputer-KBinsDiscretizer / KNeighborsTransformerwhole runcompletedResult recordedrun-0769
MakeRegression-TrainTestSplit-SimpleImputer-QuantileTransformer / KNeighborsTransformerwhole runcompletedResult recordedrun-0775
MakeRegression-TrainTestSplit-SimpleImputer-StandardScaler / KNeighborsTransformerwhole runcompletedResult recordedrun-0781
MakeRegression-TrainTestSplit-SimpleImputer-normalize / KNeighborsTransformerwhole runcompletedResult recordedrun-0787

Representative execution​

Scenario: LoadBreastCancer-TrainTestSplit-SimpleImputer-FunctionTransformer / KNeighborsTransformer; partition: whole run; observed status: completed. run-0633 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"
"KNeighborsTransformer" => await SendTypedAsync(new KNeighborsTransformerJobSendRequestModel
ClassifierType = "KNeighborsTransformer",

Request​

{
"input": {
"train_blob_id": "6cd0072c-cacf-f966-963c-7dc144f9db7c",
"test_blob_id": "608f8ac2-dcb0-3eb6-7fa1-4c76b6136d96",
"classifier_type": "KNeighborsTransformer",
"classifier_params": {
"n_neighbors": 5,
"mode": "distance"
},
"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-KNeighborsTransformer.zip",
"description": "Neighbors integration test using cached numerical preprocessing outputs",
"record_type": "Generic",
"access_tier": "Hot",
"tags": [
"neighbors",
"LoadBreastCancer",
"FunctionTransformer",
"KNeighborsTransformer"
],
"artifact_contract_version": "2.0"
},
"request_timeout_seconds": 300
}

Send response​

{
"start_time": "2026-11-30T23:20:37.6706778+00:00",
"end_time": "2026-11-30T23:20:37.7482227+00:00",
"elapsed_milliseconds": 77.54,
"status": "published",
"job_id": "de416895-64e4-8d90-ed84-669052a481ea",
"topic": "pm.topic.ml.neighbors",
"subscription": "cpu.0p5c.1gi",
"send_request_model": {
"job_id": "de416895-64e4-8d90-ed84-669052a481ea",
"json": {
"job_id": "de416895-64e4-8d90-ed84-669052a481ea",
"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": "KNeighborsTransformer",
"classifier_params": {
"n_neighbors": 5,
"mode": "distance"
},
"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-KNeighborsTransformer.zip",
"description": "Neighbors integration test using cached numerical preprocessing outputs",
"record_type": "Generic",
"access_tier": "Hot",
"tags": [
"neighbors",
"LoadBreastCancer",
"FunctionTransformer",
"KNeighborsTransformer"
],
"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-30T23:21:38.1163484+00:00",
"end_time": "2026-11-30T23:21:38.52388+00:00",
"elapsed_milliseconds": 407.53,
"job_id": "de416895-64e4-8d90-ed84-669052a481ea",
"status": "completed",
"topic": "pm.topic.ml.neighbors",
"subscription": "cpu.0p5c.1gi"
}

Result response​

{
"schema_version": "2.0",
"job_id": "de416895-64e4-8d90-ed84-669052a481ea",
"model_id": "0092e982-80d0-a014-f4e5-efd5ad4b95a8",
"status": "succeeded",
"worker": {
"name": "neighbors",
"task_family": "graph_transform",
"algorithm": "KNeighborsTransformer"
},
"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",
"leaf_size": 30,
"metric": "minkowski",
"metric_params": null,
"mode": "distance",
"n_jobs": null,
"n_neighbors": 5,
"p": 2.0
},
"metrics": {}
},
"evaluation": {
"partition": "test",
"metrics": {
"scope": "holdout",
"sample_count": 143,
"output_dimension": 426,
"mean_neighbor_distance": null,
"graph_edge_count": 858,
"mean_log_density": null,
"non_finite_log_density_count": null,
"outlier_count": null,
"outlier_fraction": null,
"mean_outlier_score": null
}
},
"artifact_files": [
"model/model.joblib",
"predictions/predictions.csv",
"extras/neighbors-graph.npz",
"graphs/output_distribution.png",
"graphs/output_distribution.svg",
"result.json"
],
"extras": {
"algorithm": {
"learned": {
"n_features_in": 30,
"n_samples_fit": 426,
"effective_metric": "euclidean",
"effective_metric_params": {},
"classes": null,
"centroids": null,
"class_prior": null,
"components": null,
"n_iter": null,
"bandwidth": null,
"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": [
0,
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20,
21,
22,
23,
24,
25,
26,
27,
28,
29,
30,
31,
32,
33,
34,
35,
36,
37,
38,
39,
40,
41,
42,
43,
44,
45,
46,
47,
48,
49,
50,
51,
52,
53,
54,
55,
56,
57,
58,
59,
60,
61,
62,
63,
64,
65,
66,
67,
68,
69,
70,
71,
72,
73,
74,
75,
76,
77,
78,
79,
80,
81,
82,
83,
84,
85,
86,
87,
88,
89,
90,
91,
92,
93,
94,
95,
96,
97,
98,
99,
100,
101,
102,
103,
104,
105,
106,
107,
108,
109,
110,
111,
112,
113,
114,
115,
116,
117,
118,
119,
120,
121,
122,
123,
124,
125,
126,
127,
128,
129,
130,
131,
132,
133,
134,
135,
136,
137,
138,
139,
140,
141,
142,
143,
144,
145,
146,
147,
148,
149,
150,
151,
152,
153,
154,
155,
156,
157,
158,
159,
160,
161,
162,
163,
164,
165,
166,
167,
168,
169,
170,
171,
172,
173,
174,
175,
176,
177,
178,
179,
180,
181,
182,
183,
184,
185,
186,
187,
188,
189,
190,
191,
192,
193,
194,
195,
196,
197,
198,
199,
200,
201,
202,
203,
204,
205,
206,
207,
208,
209,
210,
211,
212,
213,
214,
215,
216,
217,
218,
219,
220,
221,
222,
223,
224,
225,
226,
227,
228,
229,
230,
231,
232,
233,
234,
235,
236,
237,
238,
239,
240,
241,
242,
243,
244,
245,
246,
247,
248,
249,
250,
251,
252,
253,
254,
255,
256,
257,
258,
259,
260,
261,
262,
263,
264,
265,
266,
267,
268,
269,
270,
271,
272,
273,
274,
275,
276,
277,
278,
279,
280,
281,
282,
283,
284,
285,
286,
287,
288,
289,
290,
291,
292,
293,
294,
295,
296,
297,
298,
299,
300,
301,
302,
303,
304,
305,
306,
307,
308,
309,
310,
311,
312,
313,
314,
315,
316,
317,
318,
319,
320,
321,
322,
323,
324,
325,
326,
327,
328,
329,
330,
331,
332,
333,
334,
335,
336,
337,
338,
339,
340,
341,
342,
343,
344,
345,
346,
347,
348,
349,
350,
351,
352,
353,
354,
355,
356,
357,
358,
359,
360,
361,
362,
363,
364,
365,
366,
367,
368,
369,
370,
371,
372,
373,
374,
375,
376,
377,
378,
379,
380,
381,
382,
383,
384,
385,
386,
387,
388,
389,
390,
391,
392,
393,
394,
395,
396,
397,
398,
399,
400,
401,
402,
403,
404,
405,
406,
407,
408,
409,
410,
411,
412,
413,
414,
415,
416,
417,
418,
419,
420,
421,
422,
423,
424,
425
]
},
"runtime": {
"captured_at_utc": "2026-11-30T23:21:23.232371+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-30T23:21:51.067266+00:00",
"end_time": "2026-11-30T23:21:51.8495289+00:00",
"elapsed_milliseconds": 782.25,
"status": "uploaded",
"model_id": "0092e982-80d0-a014-f4e5-efd5ad4b95a8",
"source_blob_id": "4cbdd840-2129-df20-db45-bb853de5951a",
"uploaded_blob_id": "2c516429-bcd8-d57b-bdd3-c2d21b950a93",
"filename": "0f8bdadc-b08b-98c7-5f04-09540836369a.json",
"source_path": "result.json",
"source_format": "json",
"size_bytes": 10267,
"upload_status_code": 200
}

Logs​

The trace includes the saved log response (61 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.