Ejemplo n.º 1
0
    ],
                         labels=['has_diabetes'],
                         overwrite={
                             'has_diabetes': {
                                 'transform': [{
                                     'method': 'no_transform',
                                     'parameters': {}
                                 }]
                             }
                         }))

# Add a trainer
training_pipeline.add_trainer(
    TFFeedForwardTrainer(loss='binary_crossentropy',
                         last_activation='sigmoid',
                         output_units=1,
                         metrics=['accuracy'],
                         epochs=20))

# Add an evaluator
training_pipeline.add_evaluator(
    TFMAEvaluator(
        slices=[['has_diabetes']],
        metrics={'has_diabetes': ['binary_crossentropy', 'binary_accuracy']}))

# Run the pipeline locally
training_pipeline.run()

# See schema of data
training_pipeline.view_schema()
        # Add a split
        training_pipeline.add_split(CategoricalDomainSplit(
            categorical_column="name",
            split_map={'train': ["arnold", "nicholas"], 'eval': ["lülük"]}))

        # Add a preprocessing unit
        training_pipeline.add_preprocesser(
            StandardPreprocesser(
                features=["name", "age"],
                labels=['gpa'],
                overwrite={'gpa': {
                    'transform': [
                        {'method': 'no_transform', 'parameters': {}}]}}
            ))

        # Add a trainer
        training_pipeline.add_trainer(TFFeedForwardTrainer(
            batch_size=1,
            loss='binary_crossentropy',
            last_activation='sigmoid',
            output_units=1,
            metrics=['accuracy'],
            epochs=i))

        # Run the pipeline locally
        training_pipeline.run()

except Exception as e:
    logger.error(e)