Exemplo n.º 1
0
class SLRModelConfig:
    predict: Feature = field("Label or the value to be predicted")
    features: Features = field("Features to train on. For SLR only 1 allowed")
    directory: pathlib.Path = field(
        "Directory where state should be saved",
        default=pathlib.Path("~", ".cache", "dffml", "slr"),
    )
Exemplo n.º 2
0
class LogisticRegressionConfig:
    predict: Feature = field("Label or the value to be predicted")
    features: Features = field("Features to train on")
    directory: pathlib.Path = field(
        "Directory where state should be saved",
        default=pathlib.Path("~", ".cache", "dffml", "scratch"),
    )
Exemplo n.º 3
0
class SpacyNERModelConfig:
    output_dir: str = field("Output directory")
    model_name_or_path: str = field(
        "Model name or path to saved model. Defaults to blank 'en' model.",
        default=None,
    )
    n_iter: int = field("Number of training iterations", default=10)
    dropout: float = field("Dropout rate to be used during training",
                           default=0.5)

    def __post_init__(self):
        self.output_dir = pathlib.Path(self.output_dir)
Exemplo n.º 4
0
class SpacyNERModelConfig:
    location: str = field("Output location.")
    model_name: str = field(
        "Name of one of the trained pipelines provided by spaCy.\
        You can find complete list at: https://spacy.io/models\
        Defaults to blank 'en' model.",
        default=None,
    )
    n_iter: int = field("Number of training iterations", default=10)
    dropout: float = field("Dropout rate to be used during training",
                           default=0.5)

    def __post_init__(self):
        self.location = pathlib.Path(self.location)
Exemplo n.º 5
0
class ProjectCreateCMDConfig:
    source: pathlib.Path = field(
        "Path to directory containing source code of project", )
    dbs: List[DependencyDB.load] = field(
        "Databases to search for info on dependencies",
        default_factory=lambda: [],
    )
    add: List[DependencyDB.load] = field(
        "YAML files containing info to supplement or override auto-detected info",
        default_factory=lambda: [],
    )
    authoritative: List[pathlib.Path] = field(
        "Database to use as authoritative source",
        default=YAMLDB(
            pathlib.Path(__file__).parent.parent.parent / "db.yaml"),
    )
Exemplo n.º 6
0
    Sources,
    Record,
    SourcesContext,
    ModelContext,
    ModelNotTrained,
    Accuracy,
    config,
    field,
    make_config_numpy,
)

AutoSklearnConfig = make_config_numpy(
    "AutoSklearnConfig",
    autosklearn.estimators.AutoSklearnEstimator.__init__,
    properties={
        "features": (Features, field("Features to train on")),
        "predict": (Feature, field("Label or the value to be predicted")),
        "directory": (
            pathlib.Path,
            field("Directory where state should be saved", ),
        ),
    },
)


class AutoSklearnModelContext(ModelContext):
    """
    Auto-Sklearn based model contexts should derive
    from this model context.
    """
    def __init__(self, parent):
Exemplo n.º 7
0
class DAAL4PyLRModelConfig:
    predict: Feature = field("Label or the value to be predicted")
    features: Features = field("Features to train on. For SLR only 1 allowed")
    directory: pathlib.Path = field("Directory where state should be saved",)
Exemplo n.º 8
0
class MySQLSourceConfig:
    user: str = field("Username")
    password: str = field("Password")
    db: str = field("Name of database to use")
    key: str = field("Column name of record key")
    features: Dict[str, str] = field(
        "Mapping of feature names to column names"
    )
    predictions: Dict[str, Tuple[str, str]] = field(
        "Mapping of prediction names to tuples of (value, confidence) column names"
    )
    update: str = field("Query to update a single record")
    record: str = field("Query to get a single record")
    records: str = field("Query to get a single record")
    init: str = field("Query to run on initial connection", default=None)
    host: str = field("Host/address to connect to", default="127.0.0.1")
    port: int = field("Port to connect to", default=3306)
    ca: str = field(
        "Server certificate to use for TLS validation", default=None
    )
    insecure: bool = field(
        "Must be true to accept risks of non-TLS connection", default=False
    )
Exemplo n.º 9
0
class UseConfig:
    targets: List[str] = field("Git repo URLs or directories to analyze")
Exemplo n.º 10
0
class LogisticRegressionConfig:
    predict: Feature = field("Label or the value to be predicted")
    features: Features = field("Features to train on")
    directory: pathlib.Path = field("Directory where state should be saved", )
Exemplo n.º 11
0
class MySLRModelConfig:
    feature: Feature = field("Feature to train on")
    predict: Feature = field("Label or the value to be predicted")
    directory: pathlib.Path = field("Directory where state should be saved")
Exemplo n.º 12
0
class MySLRModelConfig:
    features: Features = field(
        "Features to train on (myslr only supports one)")
    predict: Feature = field("Label or the value to be predicted")
    location: pathlib.Path = field("Location where state should be saved")
Exemplo n.º 13
0
class AnomalyModelConfig:
    features: Features = field("Features to train on")
    predict: Feature = field("Label or the value to be predicted")
    directory: pathlib.Path = field("Directory where state should be saved")
    k: float = field("Validation set size", default=0.8)
Exemplo n.º 14
0
class InstallConfig:
    packages: List[str] = field("Package to check if we should install",)
Exemplo n.º 15
0
class OrgsReposYAMLSourceConfig:
    directory: pathlib.Path = field(
        "Top level directory containing GitHub orgs as subdirectories")
Exemplo n.º 16
0
class GitHubConfig:
    token: str = field("GitHub API token")