317dbbbf02b3c3b0ebdf435efe362a30b01bde8f,mindsdb/libs/phases/model_analyzer/model_analyzer.py,ModelAnalyzer,run,#ModelAnalyzer#,20

Before Change


        predictions = self.transaction.data_model_object.testModel(validation_sampler)
        print(predictions.error)
        print(predictions.accuracy)
        print(predictions.predicted_targets)
        print(predictions.real_targets)

        for k in predictions.predicted_targets:
            for i in range(len(predictions.predicted_targets[k])):

After Change


    def run(self):
        self.transaction.probabilistic_validator = ProbabilisticValidator()

        column_names = self.transaction.model_data.validation_set["ALL_ROWS_NO_GROUP_BY"].keys()

        for column_name in column_names:
            ignore_columns = []
            if column_name not in self.transaction.train_metadata.model_predict_columns:
                ignore_columns.append(column_name)

            validation_sampler = Sampler(self.transaction.model_data.validation_set, metadata_as_stored=self.transaction.persistent_model_metadata,
                                        ignore_types=self.transaction.data_model_object.ignore_types, sampler_mode=SAMPLER_MODES.LEARN,blank_columns=ignore_columns)
            validation_sampler.variable_wrapper = array_to_float_variable

            predictions = self.transaction.data_model_object.testModel(validation_sampler)

            for k in predictions.predicted_targets:
                for i in range(len(predictions.predicted_targets[k])):
                    features_existence = []
                    for col in column_names:
                        features_existence.append(validation_sampler.data["ALL_ROWS_NO_GROUP_BY"][col][i][-1])

                    self.transaction.probabilistic_validator.register_observation(features_existence=features_existence,
                    real_value=predictions.real_targets[k][i][0], predicted_value=predictions.predicted_targets[k][i][0])

                    print(self.transaction.probabilistic_validator.evaluate_prediction_accuracy(
                    features_existence=features_existence,predicted_value=predictions.predicted_targets[k][i][0]))

def test():
    from mindsdb.libs.controllers.predictor import Predictor
    from mindsdb import CONFIG
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 6

Instances


Project Name: mindsdb/mindsdb
Commit Name: 317dbbbf02b3c3b0ebdf435efe362a30b01bde8f
Time: 2019-02-19
Author: george@cerebralab.com
File Name: mindsdb/libs/phases/model_analyzer/model_analyzer.py
Class Name: ModelAnalyzer
Method Name: run


Project Name: mindsdb/mindsdb
Commit Name: 317dbbbf02b3c3b0ebdf435efe362a30b01bde8f
Time: 2019-02-19
Author: george@cerebralab.com
File Name: mindsdb/libs/phases/model_analyzer/model_analyzer.py
Class Name: ModelAnalyzer
Method Name: run


Project Name: elbayadm/attn2d
Commit Name: 22e535e23b4c2e95e7e72198ae98c7e0d4ac8c18
Time: 2018-09-30
Author: alexei.b@gmail.com
File Name: eval_lm.py
Class Name:
Method Name: main


Project Name: flow-project/flow
Commit Name: 1a21ecddc88e52adb29e77a50570858e2ea95dc6
Time: 2018-03-04
Author: vinitsky.eugene@gmail.com
File Name: flow/envs/bottleneck_env.py
Class Name: BridgeTollEnv
Method Name: __init__