Esempio n. 1
0
    def test_scenario10(self):
        """
            Scenario: Successfully building a batch centroid reify output in python
                Given I create a BigML batch centroid from a cluster with data "<data>" and params "<params>"
                And I check that the source has been created
                And I check that the dataset has been created
                And I check that the cluster has been created
                And I check that the batch centroid has been created
                Then I create a reify output in "<output>" for "<language>"
                And the "<output>" file is like "<check_file>"

                Examples:
                | data | output | params |check_file | language
                | data/iris.csv | scenario_re10/reify.py | {"name": "my_batch_centroid_name"}|../check_files/reify_batch_centroid.py | python
        """
        print self.test_scenario10.__doc__
        examples = [
            ['data/iris.csv', 'scenario_re10/reify.py', {"name": "my_batch_centroid_name"}, 'check_files/reify_batch_centroid.py', 'python']]

        for example in examples:
            print "\nTesting with:\n", example
            test_reify.create_batch_centroid(example[0],
                                             output=example[1],
                                             args=example[2])
            test_reify.i_create_output(self, example[1], example[4],
                                       resource_type='batch_centroid')
            test_reify.i_check_output_file(self, output=example[1],
                                           check_file=example[3])
Esempio n. 2
0
    def test_scenario4(self):
        """
            Scenario: Successfully building a prediction reify output in python
                Given I create a BigML prediction for "<input_data>" from a model with data "<data>" and params "<params>"
                And I check that the source has been created
                And I check that the dataset has been created
                And I check that the model has been created
                And I check that the prediction has been created
                Then I create a reify output in "<output>" for "<language>"
                And the "<output>" file is like "<check_file>"

                Examples:
                | data | output | params |check_file | language | input_data
                | data/iris.csv | scenario_re4/reify.py | {"name": "my_prediction_name"}|../check_files/reify_prediction.py | python | {'petal length': 0.5}
        """
        print self.test_scenario4.__doc__
        examples = [
            ['data/iris.csv', 'scenario_re4/reify.py', {"name": "my_prediction_name"}, 'check_files/reify_prediction.py', 'python', {'petal length': 0.5}]]

        for example in examples:
            print "\nTesting with:\n", example
            test_reify.create_prediction(example[0], input_data=example[5],
                                         output=example[1],
                                         args=example[2])
            test_reify.i_create_output(self, example[1], example[4],
                                       resource_type='prediction')
            test_reify.i_check_output_file(self, output=example[1],
                                           check_file=example[3])
Esempio n. 3
0
    def test_scenario8(self):
        """
            Scenario: Successfully building an anomaly score reify output in python
                Given I create a BigML anomaly score for "<input_data>" from an anomaly detector with data "<data>" and params "<params>"
                And I check that the source has been created
                And I check that the dataset has been created
                And I check that the anomaly detector has been created
                And I check that the anomaly score has been created
                Then I create a reify output in "<output>" for "<language>"
                And the "<output>" file is like "<check_file>"

                Examples:
                | data | output | params |check_file | language | input_data
                | data/iris.csv | scenario_re8/reify.py | {"name": "my_anomaly_score_name"}|../check_files/reify_anomaly_score.py | python | {"petal length": 0.5, "sepal length": 1, "petal width": 0.5, "sepal width": 1, "species": "Iris-setosa"}
        """
        print self.test_scenario8.__doc__
        examples = [
            ['data/iris.csv', 'scenario_re8/reify.py', {"name": "my_anomaly_score_name"}, 'check_files/reify_anomaly_score.py', 'python', {"petal length": 0.5, "sepal length": 1, "petal width": 0.5, "sepal width": 1, "species": "Iris-setosa"}]]

        for example in examples:
            print "\nTesting with:\n", example
            test_reify.create_anomaly_score(example[0],
                                            input_data=example[5],
                                            output=example[1],
                                            args=example[2])
            test_reify.i_create_output(self, example[1], example[4],
                                       resource_type='anomaly_score')
            test_reify.i_check_output_file(self, output=example[1],
                                           check_file=example[3])
Esempio n. 4
0
    def test_scenario11(self):
        """
            Scenario: Successfully building a batch anomaly score reify output in python
                Given I create a BigML batch anomaly score from an anomaly detector with data "<data>" and params "<params>"
                And I check that the source has been created
                And I check that the dataset has been created
                And I check that the anomaly detector has been created
                And I check that the batch anomaly score has been created
                Then I create a reify output in "<output>" for "<language>"
                And the "<output>" file is like "<check_file>"

                Examples:
                | data | output | params |check_file | language
                | data/iris.csv | scenario_re11/reify.py | {"name": "my_batch_anomaly_score_name"}|../check_files/reify_batch_anomaly_score.py | python
        """
        print self.test_scenario11.__doc__
        examples = [
            ['data/iris.csv', 'scenario_re11/reify.py', {"name": "my_batch_anomaly_score_name"}, 'check_files/reify_batch_anomaly_score.py', 'python']]

        for example in examples:
            print "\nTesting with:\n", example
            test_reify.create_batch_anomaly_score(example[0],
                                                  output=example[1],
                                                  args=example[2])
            test_reify.i_create_output(self, example[1], example[4],
                                       resource_type='batch_anomaly_score')
            test_reify.i_check_output_file(self, output=example[1],
                                           check_file=example[3])
Esempio n. 5
0
    def test_scenario15(self):
        """
            Scenario: Successfully building an evaluation with train/tests split reify output in python
                Given I create a BigML evaluation with data "<data>" and train/test split and params "<params>"
                And I check that the source has been created
                And I check that the dataset has been created
                And I check that the model has been created
                And I check that the evaluation has been created
                Then I create a reify output in "<output>" for "<language>"
                And the "<output>" file is like "<check_file>"

                Examples:
                | data | output | params |check_file | language
                | data/iris.csv | scenario_re15/reify.py | {"name": "my_evaluation_name"}|../check_files/reify_evaluation_split.py | python
        """
        print self.test_scenario12.__doc__
        examples = [
            ['data/iris.csv', 'scenario_re15/reify.py', {"name": "my_evaluation_name"}, 'check_files/reify_evaluation_split.py', 'python']]

        for example in examples:
            print "\nTesting with:\n", example
            test_reify.create_evaluation_split(example[0],
                                               output=example[1],
                                               args=example[2])
            test_reify.i_create_output(self, example[1], example[4],
                                       resource_type='evaluation')
            test_reify.i_check_output_file(self, output=example[1],
                                           check_file=example[3])
Esempio n. 6
0
    def test_scenario16(self):
        """
            Scenario: Successfully building a dataset reify output in python when built from a batch prediction
                Given I create a BigML dataset from a batch prediction from a model with data "<data>" and params "<params>"
                And I check that the source has been created
                And I check that the dataset has been created
                And I check that the model has been created
                And I check that the batch prediction has been created
                And I check that the batch prediction dataset has been created
                Then I create a reify output in "<output>" for "<language>"
                And the "<output>" file is like "<check_file>"

                Examples:
                | data | output | params |check_file | language
                | data/iris.csv | scenario_re16/reify.py | {"name": "my_dataset_from_batch_prediction_name"}|../check_files/reify_batch_prediction_dataset.py | python
        """
        print self.test_scenario16.__doc__
        examples = [
            ['data/iris.csv', 'scenario_re16/reify.py', {"name": "my_dataset_from_batch_prediction_name"}, 'check_files/reify_batch_prediction_dataset.py', 'python']]

        for example in examples:
            print "\nTesting with:\n", example
            test_reify.create_dataset_from_batch_prediction(example[0],
                                                            output=example[1],
                                                            args=example[2])
            test_reify.i_create_output(
                self, example[1], example[4],
                resource_type='batch_prediction_dataset')
            test_reify.i_check_output_file(self, output=example[1],
                                           check_file=example[3])
Esempio n. 7
0
    def test_scenario8(self):
        """
            Scenario: Successfully building an anomaly score reify output in python
                Given I create a BigML anomaly score for "<input_data>" from an anomaly detector with data "<data>" and params "<params>"
                And I check that the source has been created
                And I check that the dataset has been created
                And I check that the anomaly detector has been created
                And I check that the anomaly score has been created
                Then I create a reify output in "<output>" for "<language>"
                And the "<output>" file is like "<check_file>"

                Examples:
                | data | output | params |check_file | language | input_data
                | data/iris.csv | scenario_re8/reify.py | {"name": "my_anomaly_score_name"}|../check_files/reify_anomaly_score.py | python | {"petal length": 0.5, "sepal length": 1, "petal width": 0.5, "sepal width": 1, "species": "Iris-setosa"}
        """
        print self.test_scenario8.__doc__
        examples = [
            ['data/iris.csv', 'scenario_re8/reify.py', {"name": "my_anomaly_score_name"}, 'check_files/reify_anomaly_score.py', 'python', {"petal length": 0.5, "sepal length": 1, "petal width": 0.5, "sepal width": 1, "species": "Iris-setosa"}]]

        for example in examples:
            print "\nTesting with:\n", example
            test_reify.create_anomaly_score(example[0],
                                            input_data=example[5],
                                            output=example[1],
                                            args=example[2])
            test_reify.i_create_output(self, example[1], example[4],
                                       resource_type='anomaly_score')
            test_reify.i_check_output_file(self, output=example[1],
                                           check_file=example[3])
Esempio n. 8
0
    def test_scenario21(self):
        """
            Scenario: Successfully building a dataset from a list of datasets
            reify output in python
                Given I create a BigML dataset from a list of datasets with data "<data>" and params "<params>"
                And I check that the source has been created
                And I check that the dataset has been created
                Then I create a BigML dataset from a source with data "<data>" and params "<params>"
                And I check that the source has been created
                And I check that the dataset has been created
                Then I create a reify output in "<output>" for "<language>"
                And the "<output>" file is like "<check_file>"

                Examples:
                | data | output | params |check_file | language
                | data/iris.csv | scenario_re2/reify.py | {"name": "my_dataset_name"}|../check_files/reify_dataset.py | python
        """
        print self.test_scenario2.__doc__
        examples = [
            ['data/iris.csv', 'scenario_re21/reify.py', {"name": "my_dataset_name"}, 'check_files/reify_dataset_datasets.py', 'python', 'scenario_re21']]

        for example in examples:
            print "\nTesting with:\n", example
            test_reify.create_dataset_from_datasets( \
                example[0], output=example[1], args=example[2])
            test_reify.i_create_output(self, example[1], example[4],
                                       resource_type='dataset')
            test_reify.i_check_output_file(self, output=example[1],
                                           check_file=example[3])
Esempio n. 9
0
    def test_scenario4(self):
        """
            Scenario: Successfully building a prediction reify output in python
                Given I create a BigML prediction for "<input_data>" from a model with data "<data>" and params "<params>"
                And I check that the source has been created
                And I check that the dataset has been created
                And I check that the model has been created
                And I check that the prediction has been created
                Then I create a reify output in "<output>" for "<language>"
                And the "<output>" file is like "<check_file>"

                Examples:
                | data | output | params |check_file | language | input_data
                | data/iris.csv | scenario_re4/reify.py | {"name": "my_prediction_name"}|../check_files/reify_prediction.py | python | {'petal length': 0.5}
        """
        print self.test_scenario4.__doc__
        examples = [
            ['data/iris.csv', 'scenario_re4/reify.py', {"name": "my_prediction_name"}, 'check_files/reify_prediction.py', 'python', {'petal length': 0.5}]]

        for example in examples:
            print "\nTesting with:\n", example
            test_reify.create_prediction(example[0], input_data=example[5],
                                         output=example[1],
                                         args=example[2])
            test_reify.i_create_output(self, example[1], example[4],
                                       resource_type='prediction')
            test_reify.i_check_output_file(self, output=example[1],
                                           check_file=example[3])
Esempio n. 10
0
    def test_scenario20(self):
        """
            Scenario: Successfully building a dataset reify output in python when built from a dataset from a batch centroid
                Given I create a BigML dataset from a dataset from a batch centroid from a cluster with data "<data>" and params "<params>"
                And I check that the source has been created
                And I check that the dataset has been created
                And I check that the cluster has been created
                And I check that the batch centroid has been created
                And I check that the batch centroid dataset has been created
                And I check that the batch centroid dataset dataset has been created
                Then I create a reify output in "<output>" for "<language>"
                And the "<output>" file is like "<check_file>"

                Examples:
                | data | output | params |check_file | language
                | data/iris.csv | scenario_re20/reify.py | {"name": "my_dataset_from_dataset_from_batch_centroid_name"}|../check_files/reify_batch_centroid_dataset_dataset.py | python
        """
        print self.test_scenario20.__doc__
        examples = [
            ['data/iris.csv', 'scenario_re20/reify.py', {"name": "my_dataset_from_dataset_from_batch_centroid_name", "new_fields": [{"field": "( integer ( replace ( field \"cluster\" ) \"Cluster \" \"\" ) )", "name": "Cluster"}]}, 'check_files/reify_batch_centroid_dataset_dataset.py', 'python']]

        for example in examples:
            print "\nTesting with:\n", example
            test_reify.create_dataset_from_dataset_from_batch_centroid(
                example[0], output=example[1], args=example[2])
            test_reify.i_create_output(
                self, example[1], example[4], resource_type='dataset')
            test_reify.i_check_output_file(self, output=example[1],
                                           check_file=example[3])
Esempio n. 11
0
    def test_scenario1(self):
        """
            Scenario: Successfully building a source reify output in python
                Given I create a BigML source with data "<data>" and params "<params>"
                And I check that the source has been created
                Then I create a reify output in "<output>" for "<language>"
                And the "<output>" file is like "<check_file>"

                Examples:
                | data | output | params |check_file | language
                | data/iris.csv | scenario_re1/reify.py | {"name": "my_source_name"}|../check_files/reify_source.py | python
        """
        print self.test_scenario1.__doc__
        examples = [
            ['data/iris.csv', 'scenario_re1/reify.py', {"name": "my_source_name"}, 'check_files/reify_source.py', 'python'],
            ['data/iris.csv', 'scenario_re1b/reify.ipynb', {"name": "my_source_name"}, 'check_files/reify_source.ipynb', 'nb'],
            ['data/iris.csv', 'scenario_re1c/reify.whizzml', {"name": "my_source_name"}, 'check_files/reify_source.whizzml', 'whizzml']]

        for example in examples:
            print "\nTesting with:\n", example
            test_reify.create_source(example[0], output=example[1],
                                     args=example[2])
            test_reify.i_create_output(self, example[1], example[4])
            test_reify.i_check_output_file(self, output=example[1],
                                           check_file=example[3])
Esempio n. 12
0
    def test_scenario19(self):
        """
            Scenario: Successfully building a dataset reify output in python when built from another dataset
                Given I create a BigML dataset from a dataset with data "<data>" and params "<params>"
                And I check that the source has been created
                And I check that the dataset has been created
                And I check that the new dataset has been created
                Then I create a reify output in "<output>" for "<language>"
                And the "<output>" file is like "<check_file>"

                Examples:
                | data | output | params |check_file | language
                | data/iris.csv | scenario_re19/reify.py | {"name": "my_dataset_from_dataset_name", 'all_but': [u'000001'], 'all_fields': False, 'input_fields': [u'000004', u'000002', u'000003', u'000000', u'000001'], 'new_fields': [{u'description': u'', 'field': u'2', u'label': u'', u'name': u'new'}], 'objective_field': {'id': u'100004'}}|../check_files/reify_dataset_dataset.py | python
        """
        print self.test_scenario19.__doc__
        examples = [
            ['data/iris.csv', 'scenario_re19/reify.py', {"name": "my_dataset_from_dataset_name", 'all_but': ['000001'], 'all_fields': False, 'input_fields': ['000000', '000001', '000002', '000003', '000004'], 'new_fields': [{'description': '', 'field': '2', 'label': '', 'name': 'new'}], 'objective_field': {'id': '100004'}}, 'check_files/reify_dataset_dataset.py', 'python']]

        for example in examples:
            print "\nTesting with:\n", example
            test_reify.create_dataset_from_dataset(example[0],
                                                   output=example[1],
                                                   args=example[2])
            test_reify.i_create_output(
                self, example[1], example[4], resource_type='dataset')
            test_reify.i_check_output_file(self, output=example[1],
                                           check_file=example[3])
Esempio n. 13
0
    def test_scenario20(self):
        """
            Scenario: Successfully building a dataset reify output in python when built from a dataset from a batch centroid
                Given I create a BigML dataset from a dataset from a batch centroid from a cluster with data "<data>" and params "<params>"
                And I check that the source has been created
                And I check that the dataset has been created
                And I check that the cluster has been created
                And I check that the batch centroid has been created
                And I check that the batch centroid dataset has been created
                And I check that the batch centroid dataset dataset has been created
                Then I create a reify output in "<output>" for "<language>"
                And the "<output>" file is like "<check_file>"

                Examples:
                | data | output | params |check_file | language
                | data/iris.csv | scenario_re20/reify.py | {"name": "my_dataset_from_dataset_from_batch_centroid_name"}|../check_files/reify_batch_centroid_dataset_dataset.py | python
        """
        print self.test_scenario20.__doc__
        examples = [
            ['data/iris.csv', 'scenario_re20/reify.py', {"name": "my_dataset_from_dataset_from_batch_centroid_name", "new_fields": [{"field": "( integer ( replace ( field \"cluster\" ) \"Cluster \" \"\" ) )", "name": "Cluster"}]}, 'check_files/reify_batch_centroid_dataset_dataset.py', 'python']]

        for example in examples:
            print "\nTesting with:\n", example
            test_reify.create_dataset_from_dataset_from_batch_centroid(
                example[0], output=example[1], args=example[2])
            test_reify.i_create_output(
                self, example[1], example[4], resource_type='dataset')
            test_reify.i_check_output_file(self, output=example[1],
                                           check_file=example[3])
Esempio n. 14
0
    def test_scenario19(self):
        """
            Scenario: Successfully building a dataset reify output in python when built from another dataset
                Given I create a BigML dataset from a dataset with data "<data>" and params "<params>"
                And I check that the source has been created
                And I check that the dataset has been created
                And I check that the new dataset has been created
                Then I create a reify output in "<output>" for "<language>"
                And the "<output>" file is like "<check_file>"

                Examples:
                | data | output | params |check_file | language
                | data/iris.csv | scenario_re19/reify.py | {"name": "my_dataset_from_dataset_name", 'all_but': [u'000001'], 'all_fields': False, 'input_fields': [u'000004', u'000002', u'000003', u'000000', u'000001'], 'new_fields': [{u'description': u'', 'field': u'2', u'label': u'', u'name': u'new'}], 'objective_field': {'id': u'100004'}}|../check_files/reify_dataset_dataset.py | python
        """
        print self.test_scenario19.__doc__
        examples = [
            ['data/iris.csv', 'scenario_re19/reify.py', {"name": "my_dataset_from_dataset_name", 'all_but': ['000001'], 'all_fields': False, 'input_fields': ['000000', '000001', '000002', '000003', '000004'], 'new_fields': [{'description': '', 'field': '2', 'label': '', 'name': 'new'}], 'objective_field': {'id': '100004'}}, 'check_files/reify_dataset_dataset.py', 'python']]

        for example in examples:
            print "\nTesting with:\n", example
            test_reify.create_dataset_from_dataset(example[0],
                                                   output=example[1],
                                                   args=example[2])
            test_reify.i_create_output(
                self, example[1], example[4], resource_type='dataset')
            test_reify.i_check_output_file(self, output=example[1],
                                           check_file=example[3])
Esempio n. 15
0
    def test_scenario15(self):
        """
            Scenario: Successfully building an evaluation with train/tests split reify output in python
                Given I create a BigML evaluation with data "<data>" and train/test split and params "<params>"
                And I check that the source has been created
                And I check that the dataset has been created
                And I check that the model has been created
                And I check that the evaluation has been created
                Then I create a reify output in "<output>" for "<language>"
                And the "<output>" file is like "<check_file>"

                Examples:
                | data | output | params |check_file | language
                | data/iris.csv | scenario_re15/reify.py | {"name": "my_evaluation_name"}|../check_files/reify_evaluation_split.py | python
        """
        print self.test_scenario15.__doc__
        examples = [
            ['data/iris.csv', 'scenario_re15/reify.py', {"name": "my_evaluation_name"}, 'check_files/reify_evaluation_split.py', 'python']]

        for example in examples:
            print "\nTesting with:\n", example
            test_reify.create_evaluation_split(example[0],
                                               output=example[1],
                                               args=example[2])
            test_reify.i_create_output(self, example[1], example[4],
                                       resource_type='evaluation')
            test_reify.i_check_output_file(self, output=example[1],
                                           check_file=example[3])
Esempio n. 16
0
    def test_scenario5(self):
        """
            Scenario: Successfully building a cluster reify output in python
                Given I create a BigML cluster from a dataset with data "<data>" and params "<params>"
                And I check that the source has been created
                And I check that the dataset has been created
                And I check that the cluster has been created
                Then I create a reify output in "<output>" for "<language>"
                And the "<output>" file is like "<check_file>"

                Examples:
                | data | output | params |check_file | language
                | data/iris.csv | scenario_re5/reify.py | {"name": "my_cluster_name"}|../check_files/reify_cluster.py | python
        """
        print self.test_scenario5.__doc__
        examples = [
            ['data/iris.csv', 'scenario_re5/reify.py', {"name": "my_cluster_name"}, 'check_files/reify_cluster.py', 'python']]

        for example in examples:
            print "\nTesting with:\n", example
            test_reify.create_cluster(example[0],
                                      output=example[1],
                                      args=example[2])
            test_reify.i_create_output(self, example[1], example[4],
                                       resource_type='cluster')
            test_reify.i_check_output_file(self, output=example[1],
                                           check_file=example[3])
Esempio n. 17
0
    def test_scenario18(self):
        """
            Scenario: Successfully building a dataset reify output in python when built from a batch anomaly score
                Given I create a BigML dataset from a batch anomaly score from an anomaly detector with data "<data>" and params "<params>"
                And I check that the source has been created
                And I check that the dataset has been created
                And I check that the anomaly detector has been created
                And I check that the batch anomaly score has been created
                And I check that the batch anomaly score dataset has been created
                Then I create a reify output in "<output>" for "<language>"
                And the "<output>" file is like "<check_file>"

                Examples:
                | data | output | params |check_file | language
                | data/iris.csv | scenario_re18/reify.py | {"name": "my_dataset_from_batch_anomaly_score_name"}|../check_files/reify_batch_anomaly_score_dataset.py | python
        """
        print self.test_scenario17.__doc__
        examples = [
            ['data/iris.csv', 'scenario_re18/reify.py', {"name": "my_dataset_from_batch_anomaly_score_name"}, 'check_files/reify_batch_anomaly_score_dataset.py', 'python']]

        for example in examples:
            print "\nTesting with:\n", example
            test_reify.create_dataset_from_batch_anomaly(example[0],
                                                         output=example[1],
                                                         args=example[2])
            test_reify.i_create_output(
                self, example[1], example[4],
                resource_type='batch_anomaly_score_dataset')
            test_reify.i_check_output_file(self, output=example[1],
                                           check_file=example[3])
Esempio n. 18
0
    def test_scenario14(self):
        """
            Scenario: Successfully building a source reify output with fields in python
                Given I create a BigML source with data "<data>" and params "<params>"
                And I check that the source has been created
                Then I create a reify output in "<output>" for "<language>"
                And the "<output>" file is like "<check_file>"

                Examples:
                | data | output | params |check_file | language
                | data/iris_sp_chars.csv | scenario_re14/reify.py | {"name": "my_sóurcè_sp_name"}|../check_files/reify_source_sp.py | python
        """
        print self.test_scenario14.__doc__
        examples = [[
            'data/iris_sp_chars.csv', 'scenario_re14/reify.py', {
                "name": "my_sóurcè_sp_name"
            }, 'check_files/reify_source_sp.py', 'python'
        ]]

        for example in examples:
            print "\nTesting with:\n", example
            test_reify.create_source(example[0],
                                     output=example[1],
                                     args=example[2])
            test_reify.i_create_output(self,
                                       example[1],
                                       example[4],
                                       add_fields=True)
            test_reify.i_check_output_file(self,
                                           output=example[1],
                                           check_file=example[3])