Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

homogenize object cols to str #558

Merged
merged 9 commits into from
Apr 6, 2024
Merged

homogenize object cols to str #558

merged 9 commits into from
Apr 6, 2024

Conversation

dcolinmorgan
Copy link
Contributor

@dcolinmorgan dcolinmorgan commented Mar 20, 2024

g.umap() works even after adding this column to the untitled.json data

data['test']=data['Source_Proto'].apply(lambda x: x[0])
data['test'][[1,20,35,72,90]]=1
data['test'][[10,5,16,28,75]]=1.0
data['test'][[12,7]]='NaN'
data['test'][[13,8]]=np.NaN

Copy link
Contributor

@lmeyerov lmeyerov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good -- can you log a message that the retry is happening + on which columns?

@@ -907,6 +907,7 @@ def process_dirty_dataframes(
try:
X_enc = data_encoder.fit_transform(ndf, y)
except TypeError:
logger.info("obj columns:", object_columns, "are being converted to str")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dcolinmorgan logger.info("obj columns: %s are being converted to str", object_columns)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • ci failing?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

message was placed before object_columns was defined

object_columns = nndf.select_dtypes(include=['object']).columns
nndf[object_columns] = nndf[object_columns].astype(str)
X_enc = data_encoder.fit_transform(nndf, y)
logger.info("obj columns: %s are being converted to str", object_columns)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we get a test that triggers & handles this edge case?

can land after, looks good!

Copy link
Contributor

@lmeyerov lmeyerov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see comments

@aucahuasi aucahuasi merged commit d140bb3 into master Apr 6, 2024
38 checks passed
@lmeyerov lmeyerov deleted the fix/hetero_feat branch April 6, 2024 01:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants