You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ifcolnotindiscrete_varsandcolnotin [id_col_name, target_column_name]: # omit discrete because a string, and target
261
+
ifcolnotindiscrete_varsandcolnotin [
262
+
id_col_name,
263
+
target_column_name,
264
+
]: # omit discrete because a string, and target
260
265
val_counts=df[col].nunique()
261
-
ifval_counts>1andval_counts<=10: # the column contains less than 10 different values
266
+
if (
267
+
val_counts>1andval_counts<=10
268
+
): # the column contains less than 10 different values
262
269
discrete_vars.append(col)
263
270
264
-
continuous_vars=list(set(df.columns)
265
-
-set(discrete_vars)
266
-
-set([id_col_name, target_column_name]))
271
+
continuous_vars=list(
272
+
set(df.columns)
273
+
-set(discrete_vars)
274
+
-set([id_col_name, target_column_name])
275
+
)
267
276
log.warning(
268
277
f"""Cobra automaticaly assumes that following variables are
269
278
discrete: {discrete_vars}
270
279
continuous: {continuous_vars}
271
-
If you want to change this behaviour you can specify the discrete/continuous variables yourself with the continuous_vars and discrete_vars keywords. \nIt assumes that numerical comumns with less than or equal to 10 different values are categorical"""
272
-
)
280
+
If you want to change this behaviour you can specify the discrete/continuous variables yourself with the continuous_vars and discrete_vars keywords.
281
+
It assumes that numerical columns with less than or equal to 10 different values are categorical"""
282
+
)
273
283
returncontinuous_vars, discrete_vars
274
284
275
285
deffit(
@@ -278,10 +288,10 @@ def fit(
278
288
continuous_vars: list,
279
289
discrete_vars: list,
280
290
target_column_name: str,
281
-
id_col_name: str=None
291
+
id_col_name: str=None,
282
292
):
283
293
"""Fit the data to the preprocessing pipeline.
284
-
If you put continious_vars and target_vars equal to `None` and give the id_col_name Cobra will guess which varaibles are continious and which are not
294
+
If you put continuous_vars and target_vars equal to `None` and give the id_col_name Cobra will guess which variables are continuous and which are not.
0 commit comments