Colabs

Hi All,

Trying to play around with using a xlsx with a list of results to predict.
Is it possible to use mindsdb.predict to read a table and return the prediction and probability?

result = mindsdb.predict(when_data=’/content/Predict_8_11.xlsx’)

1 Like

Hello @JPORTER88. Yes, that is possible. After you send the table to the predict function the result will contain an explanation for each prediction. You can iterate over the result and call the explanation as

    additional_info = [x.explanation for x in result]

MindsDB will return additional information as predicted value, confidence, class distribution for each row. This is an example of response:


{
    'target': {
        'class_distribution': {
            '1': 0.9873490760313259,
            '0': 0.012650923968674047
        },
        'predicted_value': '1',
        'confidence': 0.89,
        'prediction_quality': 'very confident',
        'important_missing_information': ['year']
    }

Hello @Zoran - Thanks for your reply.

Another two questions:

  1. Colabs crashes rather frequently with the following error. Do you have a solution for this? - “what(): This program was compiled against version 3.12.4 of the Protocol Buffer runtime library, which is not compatible with the installed version (3.14.0). Contact the program author for an update. If you compiled the program yourself, make sure that your headers are from the same version of Protocol Buffers as your link-time library. (Version verification failed in “google/protobuf/descriptor.pb.cc”.)”

  2. Is it possible to ‘download a train model’ and reference it later so i dont have to train the same model every time i want results?

Cheers

1 Like

Hi @JPORTER88

  1. This issue is not related to MindsDB. There could be a problem with the google collab as explained on googles repo. Can you manually do pip install of the protobuf version? I hope that could resolve the mismatched version problem.
  2. The model will be stored on your local machine. You can export the storage dir using export_storage or use your own path set through MINDSDB_STORAGE_PATH env variable. To answer your question yes, you should always specify the model name and you will be able to query it without re-training the same model e.g
    mdb = mindsdb.Predictor(name='robotic_failure')
    predictions = mdb.predict(when='test.csv')