Skip to content

Add structured data#1950

Merged
haifeng-jin merged 7 commits intonumpyfrom
add_structured_data
Nov 9, 2025
Merged

Add structured data#1950
haifeng-jin merged 7 commits intonumpyfrom
add_structured_data

Conversation

@haifeng-jin
Copy link
Collaborator

Which issue(s) does this Pull Request fix?

resolves #000

Details of the Pull Request

@haifeng-jin haifeng-jin requested a review from fchollet as a code owner November 9, 2025 22:26
@haifeng-jin haifeng-jin merged commit f78e266 into numpy Nov 9, 2025
2 of 4 checks passed
@haifeng-jin haifeng-jin deleted the add_structured_data branch November 9, 2025 22:26
@gemini-code-assist
Copy link

Summary of Changes

Hello @haifeng-jin, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly expands AutoKeras's capabilities by integrating robust support for structured data. It introduces specialized APIs for structured data classification and regression, complete with new input nodes, processing blocks, and intelligent preprocessors that automatically handle column types. The changes are thoroughly reflected in updated documentation and examples, making it easier for users to leverage AutoKeras for a broader range of tabular data problems. Additionally, it aligns the codebase with modern TensorFlow practices by updating Keras imports.

Highlights

  • New Structured Data Tasks: Introduced new StructuredDataClassifier and StructuredDataRegressor classes, enabling AutoKeras to handle structured data for both classification and regression problems.
  • Structured Data Input and Blocks: Added a dedicated StructuredDataInput node and a StructuredDataBlock to process structured data, including automatic inference of column types (numerical/categorical) and optional normalization.
  • Categorical to Numerical Preprocessing: Implemented a CategoricalToNumerical preprocessor to convert categorical features into a numerical format suitable for neural networks, with graceful handling of unknown values.
  • Updated Keras Imports: Migrated Keras imports from keras to tensorflow.keras across various documentation examples and internal files for consistency with TensorFlow 2.x.
  • Enhanced Documentation and Examples: Comprehensive updates to documentation, including new tutorial files for structured data classification and regression, benchmarks, and examples (e.g., Titanic, Iris, Wine, California Housing datasets) to showcase the new functionalities.
  • Time Series Forecaster Introduction: Added a new tutorial file for TimeseriesForecaster, indicating future support for time series analysis.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces significant new functionality for handling structured data in AutoKeras, including new tasks like StructuredDataClassifier and StructuredDataRegressor, along with corresponding nodes, blocks, and preprocessors. The documentation and examples have been updated comprehensively to reflect these additions. Additionally, there's a notable refactoring across the codebase to consistently use tensorflow.keras instead of standalone keras.

My review identifies a few critical issues in the new structured data pipeline, especially concerning data handling from CSV files and pandas DataFrames, which could prevent the features from working as documented. I've also pointed out a potentially breaking change in CUSTOM_OBJECTS, some inconsistencies in docstrings and error messages, and a suggestion to improve the default NaN imputation strategy.

haifeng-jin added a commit that referenced this pull request Nov 10, 2025
* use data.Dataset for all

* some tests passed

* more tests fixed

* more tests fixed.

* image classifier fixed.

* remove data

* text fixed

* removed keras_nlp

* fix one hot encoder.

* More tests fixed

* All tests fixed.

* Add structured data (#1950)

* patch in progress

* patch in progress 2

* progress 3

* tests runnable

* remove tf usages

* structured data working

* all tests passed

* docs works

* structured data added to docs

* clean ups

* Run tests with torch

* add grpc as a dependency

* add grpc and protobuf to test install

* fix the pip install grpcio

* addressing comments.
@haifeng-jin haifeng-jin removed the request for review from fchollet November 10, 2025 17:05
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.

1 participant