Skip to main content

LocalOutlierFactor

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 / LocalOutlierFactorwhole runcompletedResult recordedrun-0635
LoadBreastCancer-TrainTestSplit-SimpleImputer-KBinsDiscretizer / LocalOutlierFactorwhole runcompletedResult recordedrun-0643
LoadBreastCancer-TrainTestSplit-SimpleImputer-QuantileTransformer / LocalOutlierFactorwhole runcompletedResult recordedrun-0651
LoadBreastCancer-TrainTestSplit-SimpleImputer-StandardScaler / LocalOutlierFactorwhole runcompletedResult recordedrun-0659
LoadBreastCancer-TrainTestSplit-SimpleImputer-normalize / LocalOutlierFactorwhole runcompletedResult recordedrun-0667
LoadDiabetes-TrainTestSplit-SimpleImputer-KBinsDiscretizer / LocalOutlierFactorwhole runcompletedResult recordedrun-0675
LoadDiabetes-TrainTestSplit-SimpleImputer-QuantileTransformer / LocalOutlierFactorwhole runcompletedResult recordedrun-0681
LoadDiabetes-TrainTestSplit-SimpleImputer-StandardScaler / LocalOutlierFactorwhole runcompletedResult recordedrun-0687
LoadDiabetes-TrainTestSplit-SimpleImputer-normalize / LocalOutlierFactorwhole runcompletedResult recordedrun-0693
LoadWine-TrainTestSplit-SimpleImputer-FunctionTransformer / LocalOutlierFactorwhole runcompletedResult recordedrun-0699
LoadWine-TrainTestSplit-SimpleImputer-KBinsDiscretizer / LocalOutlierFactorwhole runcompletedResult recordedrun-0707
LoadWine-TrainTestSplit-SimpleImputer-QuantileTransformer / LocalOutlierFactorwhole runcompletedResult recordedrun-0715
LoadWine-TrainTestSplit-SimpleImputer-StandardScaler / LocalOutlierFactorwhole runcompletedResult recordedrun-0723
LoadWine-TrainTestSplit-SimpleImputer-normalize / LocalOutlierFactorwhole runcompletedResult recordedrun-0731
MakeClassification-TrainTestSplit-SimpleImputer-KBinsDiscretizer / LocalOutlierFactorwhole runcompletedResult recordedrun-0739
MakeClassification-TrainTestSplit-SimpleImputer-QuantileTransformer / LocalOutlierFactorwhole runcompletedResult recordedrun-0747
MakeClassification-TrainTestSplit-SimpleImputer-StandardScaler / LocalOutlierFactorwhole runcompletedResult recordedrun-0755
MakeClassification-TrainTestSplit-SimpleImputer-normalize / LocalOutlierFactorwhole runcompletedResult recordedrun-0763
MakeRegression-TrainTestSplit-SimpleImputer-KBinsDiscretizer / LocalOutlierFactorwhole runcompletedResult recordedrun-0771
MakeRegression-TrainTestSplit-SimpleImputer-QuantileTransformer / LocalOutlierFactorwhole runcompletedResult recordedrun-0777
MakeRegression-TrainTestSplit-SimpleImputer-StandardScaler / LocalOutlierFactorwhole runcompletedResult recordedrun-0783
MakeRegression-TrainTestSplit-SimpleImputer-normalize / LocalOutlierFactorwhole runcompletedResult recordedrun-0789

Representative execution​

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

"LocalOutlierFactor", "NearestCentroid", "NeighborhoodComponentsAnalysis",
"KernelDensity" or "KNeighborsRegressor" or "KNeighborsTransformer" or "LocalOutlierFactor"
"KernelDensity" or "KNeighborsClassifier" or "KNeighborsTransformer" or "LocalOutlierFactor"
"LocalOutlierFactor" => await SendTypedAsync(new LocalOutlierFactorJobSendRequestModel
ClassifierType = "LocalOutlierFactor",

Request​

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

Send response​

{
"start_time": "2026-11-30T22:50:08.0289965+00:00",
"end_time": "2026-11-30T22:50:08.1016888+00:00",
"elapsed_milliseconds": 72.69,
"status": "published",
"job_id": "54844ee0-bef2-1b01-b850-a8913f7f90a3",
"topic": "pm.topic.ml.neighbors",
"subscription": "cpu.0p5c.1gi",
"send_request_model": {
"job_id": "54844ee0-bef2-1b01-b850-a8913f7f90a3",
"json": {
"job_id": "54844ee0-bef2-1b01-b850-a8913f7f90a3",
"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": "LocalOutlierFactor",
"classifier_params": {
"n_neighbors": 20,
"novelty": true
},
"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-LocalOutlierFactor.zip",
"description": "Neighbors integration test using cached numerical preprocessing outputs",
"record_type": "Generic",
"access_tier": "Hot",
"tags": [
"neighbors",
"LoadBreastCancer",
"FunctionTransformer",
"LocalOutlierFactor"
],
"encryption_key": "[REDACTED]",
"artifact_contract_version": "2.0"
},
"generate_graphs": true
},
"topic": "pm.topic.ml.neighbors",
"subscription": "cpu.0p5c.1gi"
}
}

Final recorded status​

{
"start_time": "2026-11-30T22:51:08.5278844+00:00",
"end_time": "2026-11-30T22:51:09.6419913+00:00",
"elapsed_milliseconds": 1114.09,
"job_id": "54844ee0-bef2-1b01-b850-a8913f7f90a3",
"status": "completed",
"topic": "pm.topic.ml.neighbors",
"subscription": "cpu.0p5c.1gi"
}

Result response​

{
"schema_version": "2.0",
"job_id": "54844ee0-bef2-1b01-b850-a8913f7f90a3",
"model_id": "0092e982-80d0-a014-f4e5-efd5ad4b95a8",
"status": "succeeded",
"worker": {
"name": "neighbors",
"task_family": "outlier_detection",
"algorithm": "LocalOutlierFactor"
},
"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",
"contamination": "auto",
"leaf_size": 30,
"metric": "minkowski",
"metric_params": null,
"n_jobs": null,
"n_neighbors": 20,
"novelty": true,
"p": 2.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": null,
"non_finite_log_density_count": null,
"outlier_count": 1,
"outlier_fraction": 0.006993006993006993,
"mean_outlier_score": -1.0823661850563648
}
},
"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": 426,
"effective_metric": "euclidean",
"effective_metric_params": {},
"classes": null,
"centroids": null,
"class_prior": null,
"components": null,
"n_iter": null,
"bandwidth": null,
"n_neighbors": 20,
"offset": -1.5
},
"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-30T22:50:42.664086+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-30T22:51:16.7778242+00:00",
"end_time": "2026-11-30T22:51:17.6505045+00:00",
"elapsed_milliseconds": 872.67,
"status": "uploaded",
"model_id": "0092e982-80d0-a014-f4e5-efd5ad4b95a8",
"source_blob_id": "c5121bef-3941-49ce-41ae-91e0e3965704",
"uploaded_blob_id": "02140b2e-787b-4830-9639-0f9e43e22620",
"filename": "f4ca8645-210c-eadc-fc6c-3c65f7738056.json",
"source_path": "result.json",
"source_format": "json",
"size_bytes": 4003,
"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.