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

Update SciKit-Learn Library Requirements #57

Merged
merged 2 commits into from
Nov 25, 2021
Merged

Conversation

JDM288
Copy link
Contributor

@JDM288 JDM288 commented Nov 18, 2021

No description provided.

Where calculations.py called functions from sklearn like "cross_val_score" and "mean_absolute_error", pandas data frames were being given as inputs to those functions. I am not sure what Sklearn's new update did not like about it, but changing those pandas data frames to numpy arrays with .to_numpy() fixed the problem and gave the correct values.
@JDM288
Copy link
Contributor Author

JDM288 commented Nov 20, 2021

Side note: The issue was with the pandas series, but if you use .astype("int64") or .astype("float"), or anything like that it fixes the issue too. Sklearn just needed us to declare the dtype of the pandas series.

@fwetdb
Copy link
Collaborator

fwetdb commented Nov 23, 2021

Interesting, thank you. Why did you decide for the general to_numpy? And how does this more general solution work?

@JDM288
Copy link
Contributor Author

JDM288 commented Nov 23, 2021

@fwetdb It looks like Sklearn handles numpy arrays differently than pandas dataframes. I digged as far as I could into the ppscore library, and found those two functions, cross_val_score and mean_absolute_error, that were causing the error. When I changed the dataframes to numpy, the problem was fixed, so I assume something about the way sklearn handles pd dataframes changed. Without looking into the new code for sklearn i cant give you an answer to that. I only decided on that first because I could not seem to get pandas dataframes to work for a bit, but once I declared their datatype it worked fine.

@fwetdb
Copy link
Collaborator

fwetdb commented Nov 25, 2021

Great, thank you a lot @JDM288

@8080labs 8080labs merged commit c9268c1 into 8080labs:master Nov 25, 2021
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