From 20e855b009d2493f5bca355bc6c00d811b7c38f7 Mon Sep 17 00:00:00 2001 From: egillax Date: Mon, 30 Oct 2023 15:13:06 +0100 Subject: [PATCH] fix numerical features order issue --- inst/python/Dataset.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inst/python/Dataset.py b/inst/python/Dataset.py index 671aca9..98d9ed3 100644 --- a/inst/python/Dataset.py +++ b/inst/python/Dataset.py @@ -67,7 +67,7 @@ def __init__(self, if pl.count(self.numerical_features) == 0: self.num = None else: - numerical_data = data.filter(pl.col('columnId').is_in(self.numerical_features)). \ + numerical_data = data.filter(pl.col('columnId').is_in(self.numerical_features)).sort(by='columnId'). \ with_row_count('newColumnId').with_columns(pl.col('newColumnId').first().over('columnId'). rank(method="dense") - 1, pl.col('rowId') - 1) \ .select(pl.col('rowId'), pl.col('newColumnId').alias('columnId'), pl.col('covariateValue')).collect()