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

Merge underfilled_job_title with employee_position_title in employee_salaries #581

Merged
merged 4 commits into from
Aug 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Ongoing development
=====================

Skrub has not been released yet. It is currently undergoing fast
development and backward compatability is not ensured.
development and backward compatibility is not ensured.

Major changes
-------------
Expand Down Expand Up @@ -102,6 +102,12 @@ Minor changes
* :class:`TableVectorizer` doesn't fail anymore if an infered type doesn't work during transform.
The new entries not matching the type are replaced by missing values. :pr:`666` by :user:`Leo Grinsztajn <LeoGrin>`

- Dataset fetcher :func:`datasets.fetch_employee_salaries` now has a parameter
`overload_job_titles` to allow overloading the job titles
(`employee_position_title`) with the column `underfilled_job_title`,
which provides some more information about the job title.
:pr:`581` by :user:`Lilian Boulard <LilianBoulard>`

Before skrub: dirty_cat
========================

Expand Down
13 changes: 13 additions & 0 deletions skrub/datasets/_fetching.py
Original file line number Diff line number Diff line change
Expand Up @@ -668,6 +668,7 @@ def fetch_employee_salaries(
load_dataframe: bool = True,
drop_linked: bool = True,
drop_irrelevant: bool = True,
overload_job_titles: bool = True,
LilianBoulard marked this conversation as resolved.
Show resolved Hide resolved
data_directory: Path | str | None = None,
) -> DatasetAll | DatasetInfoOnly:
"""Fetches the employee salaries dataset (regression), available at https://openml.org/d/42125
Expand All @@ -687,6 +688,11 @@ def fetch_employee_salaries(
Drops column "full_name", which is usually irrelevant to the
statistical analysis.

overload_job_titles : bool, default=True
LilianBoulard marked this conversation as resolved.
Show resolved Hide resolved
Uses the column `underfilled_job_title` to enrich the
`employee_position_title` column, as it contains more detailed
information about the job title.

data_directory: pathlib.Path or str, optional
The directory where the dataset is stored.

Expand Down Expand Up @@ -718,6 +724,13 @@ def fetch_employee_salaries(
)
if drop_irrelevant:
dataset.X.drop(["full_name"], axis=1, inplace=True)
if overload_job_titles:
LilianBoulard marked this conversation as resolved.
Show resolved Hide resolved
dataset.X["employee_position_title"] = dataset.X[
"underfilled_job_title"
].fillna(dataset.X["employee_position_title"])
dataset.X.drop(
labels=["underfilled_job_title"], axis="columns", inplace=True
)

return dataset

Expand Down