-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
177 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
defaults: | ||
- acs | ||
|
||
setting: employment_disability | ||
survey_year: YEAR_2018 | ||
states: | ||
- FL | ||
survey: PERSON | ||
horizon: ONE_YEAR |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
defaults: | ||
- tabular | ||
|
||
seed: 0 | ||
train_props: | ||
1: | ||
0: 0.0 |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
from .common import * | ||
from .data_module import * | ||
from .nico_plus_plus import * | ||
from .factories import * | ||
from .nih import * | ||
from .splitter import * | ||
from .utils import * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
"""Dataset factories.""" | ||
|
||
from dataclasses import dataclass, field | ||
from pathlib import Path | ||
from typing import Any, Optional, Union | ||
from typing_extensions import override | ||
|
||
from conduit.data.datasets.vision import NICOPP, NicoPPTarget | ||
from conduit.fair.data.datasets import ( | ||
ACSDataset, | ||
ACSHorizon, | ||
ACSSetting, | ||
ACSState, | ||
ACSSurvey, | ||
ACSSurveyYear, | ||
) | ||
|
||
from src.data.common import DatasetFactory | ||
|
||
__all__ = ["NICOPPCfg"] | ||
|
||
|
||
@dataclass | ||
class NICOPPCfg(DatasetFactory): | ||
root: Union[Path, str] | ||
target_attrs: Optional[list[NicoPPTarget]] = None | ||
transform: Any = None # Optional[Union[Compose, BasicTransform, Callable[[Image], Any]]] | ||
|
||
@override | ||
def __call__(self) -> NICOPP: | ||
return NICOPP(root=self.root, transform=self.transform, superclasses=self.target_attrs) | ||
|
||
|
||
@dataclass | ||
class ACSCfg(DatasetFactory): | ||
setting: ACSSetting | ||
survey_year: ACSSurveyYear = ACSSurveyYear.YEAR_2018 | ||
horizon: ACSHorizon = ACSHorizon.ONE_YEAR | ||
survey: ACSSurvey = ACSSurvey.PERSON | ||
states: list[ACSState] = field(default_factory=lambda: [ACSState.AL]) | ||
|
||
@override | ||
def __call__(self) -> ACSDataset: | ||
return ACSDataset( | ||
setting=self.setting, | ||
survey_year=self.survey_year, | ||
horizon=self.horizon, | ||
survey=self.survey, | ||
states=self.states, | ||
) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.