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

InvalidCastException (Int32 to Single) when retraining from database #2906

Open
rkpatrick opened this issue Apr 24, 2024 · 0 comments
Open

Comments

@rkpatrick
Copy link

rkpatrick commented Apr 24, 2024

I have my data stored in a single table that I query to grab certain columns (and "de-NULL"). I was previously saving as a CSV (due to another issue re: certificate trust) and training largely successfully. However, as I move into retraining, I'm trying to pull directly from the database with a train/test split. When I do this, I get an InvalidCastException: "Unable to cast object of type 'System.Int32' to type 'System.Single'". Presumably this is due to any number of INT fields that I'm returning (I've got some MONEY, some INT, some DATE, and some NVARCHAR); I think the CSV route is treating everything as a string and parsing to whatever, whereas the DB is typing everything.
My question is - is it up to me to prepare the data with the right types here (either by transform or by having my SQL convert everything to MONEY/NVARCHAR), or is there something I'm missing to get it to handle the conversion automatically?

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

No branches or pull requests

1 participant