I have a
CSV file with salary information and other columns.
I am trying to transform some of these columns into proper values, for a
LinearRegression and a
SGDRegressor, or some other. Because, I don't think that the
sklearn can handle the data bits as is.
- 607 records
- Numerical columns: year, salary, salary in USD
- Categorical columns: experience, type, residence, currency, remote work, company location, and company size.
- Target: salary in USD
# Import neccessary encoder from sklearn.preprocessing import OneHotEncoder # Encoding of categorical data encoder = OneHotEncoder(sparse=False) # Extract columns columns = data[['Experience', 'Type', 'Residence', 'Remote work', 'Company location', 'Company size']]
- How to group any data within the categories (to avoid duplicates)?
OneHotEncoderthe recommended way of doing this?