# memory_advice::DefaultPredictor

## Summary

### Inheritance

Inherits from: [memory_advice::IPredictor](https://developer.android.com/reference/games/memory-advice/classmemory/advice-1-1-i-predictor)

| ### Constructors and Destructors ||
|---|---|
| `https://developer.android.com/reference/games/memory-advice/classmemory/advice-1-1-default-predictor#classmemory__advice_1_1_default_predictor_1abd4be0f31aed4ab428cb8e362ccfabcb()` ||

| ### Public functions ||
|---|---|
| `https://developer.android.com/reference/games/memory-advice/classmemory/advice-1-1-default-predictor#classmemory__advice_1_1_default_predictor_1a517c290713404d22f8c5ba1ad918de42(std::string model_file, std::string features_file) override` | `virtual https://developer.android.com/reference/games/memory-advice/group/memory-advice#group__memory__advice_1ga7061497339a50e977d400a58b8fb9f82` Initializes the predictor with the given model. |
| `https://developer.android.com/reference/games/memory-advice/classmemory/advice-1-1-default-predictor#classmemory__advice_1_1_default_predictor_1a333579d29d7ed55551c1e59aad451350(Json::object data) override` | `virtual float` Runs the tensorflow model with the provided data. |

## Public functions

### Init

```
virtual MemoryAdvice_ErrorCode Init(
  std::string model_file,
  std::string features_file
) override
```
Initializes the predictor with the given model.

<br />

Details Parameters `model_file` the location of the asset containing a predictor model file `features_file` the location of the asset containing the feature list matching the model **Returns** MEMORYADVICE_ERROR_TFLITE_MODEL_INVALID if the provided model was invalid, or MEMORYADVICE_ERROR_OK if there are no errors.

### Predict

```
virtual float Predict(
  Json::object data
) override
```
Runs the tensorflow model with the provided data.

<br />

Details Parameters `data` the memory data from the device. **Returns** the result from the model.

### \~DefaultPredictor

```
 ~DefaultPredictor() override
```