# Model Creation & Training

After preparing your input data, follow these steps to create a new price prediction model using the Inverse Watch UI:

***

### <mark style="color:blue;">**Select Data Source**</mark>

In the "Query" field, search for and select the query you have created and want to use as input data (*inv\_coingecko\_prices\_data* in our case). This query contains our engineered features and target variables.

***

### <mark style="color:blue;">**Define Columns**</mark>

You'll see a list of all columns from your query. For each column, specify whether it's a feature or a target:

* Mark all columns as features, including "timestamp".&#x20;

{% hint style="success" %}
The system will automatically derive additional features from these time-related columns if 'timestamp' is in the column name and the timestamp is in a reasonable range.
{% endhint %}

* Mark "log\_price\_change" as your target variable.
* Leave "price" unmarked if you're not using it as a direct feature or target.

<div data-full-width="false"><figure><img src="https://4269815422-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGc9mnST31tkU3h2NNgSL%2Fuploads%2FVsJyy1gPmXb8ZOwhWJnn%2Fimage.png?alt=media&#x26;token=c4475094-9889-4afe-8250-1141d43a233e" alt=""><figcaption><p>Select between targets and features</p></figcaption></figure></div>

***

### <mark style="color:blue;">**Provide Model Description**</mark>

In the "Description" field, enter a meaningful description for your model. For example: *"Cryptocurrency price prediction model using historical price, volume, and market cap data."*

***

### <mark style="color:blue;">**Choose Regressor**</mark>

From the "Regressor" dropdown, select one of the following options:

* Linear Regression
* Random Forest
* Gradient Boosting
* AdaBoost
* LSTM Neural Network

***

### <mark style="color:blue;">**Configure Regressor**</mark>

Configure the regressor hyperparameters, example with the Random Forest Regressor :

* <mark style="color:orange;">Auto Mode:</mark> Leave this unchecked to manually set parameters. For ease of use, you can check the box and the system will automatically run the hyper parameters tuning for you.&#x20;
* <mark style="color:orange;">Number of Trees:</mark> Set the number of trees in the forest (e.g., 100).
* <mark style="color:orange;">Max Depth</mark>: Set the maximum depth of the trees (e.g., 10).
* <mark style="color:orange;">Min Samples Split:</mark> Minimum number of samples required to split an internal node (e.g., 2).
* <mark style="color:orange;">Min Samples Leaf:</mark> Minimum number of samples required to be at a leaf node (e.g., 1).
* <mark style="color:orange;">Criterion (Regression):</mark> Choose the function to measure the quality of a split (e.g., "mse" for mean squared error).

<div data-full-width="true"><figure><img src="https://4269815422-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGc9mnST31tkU3h2NNgSL%2Fuploads%2FzQf6RoiECiSyzJPHlBSH%2Fimage.png?alt=media&#x26;token=54499ea5-3f88-4ef5-b08e-e28b35469c17" alt=""><figcaption></figcaption></figure></div>

***

### <mark style="color:blue;">**Set Train/Test Split**</mark>

Adjust the slider to set the split between training and test data. A common split is 80-70% train, 20-30% test.

<div data-full-width="true"><figure><img src="https://4269815422-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGc9mnST31tkU3h2NNgSL%2Fuploads%2F0ERau8tmdHtxwfIsFMCc%2Fimage.png?alt=media&#x26;token=14068e24-ec34-4d01-bbfa-6914597aaa2c" alt=""><figcaption><p>Example Split with 75/25</p></figcaption></figure></div>

***

### <mark style="color:blue;">**Set Random State**</mark>

Enter a number (e.g., 42) to ensure reproducibility of results.

### <mark style="color:blue;">**Configure Training Triggers**</mark>

* Retrain when: Select "When query is refreshed" if you want the model to retrain automatically when new data is available.
* When trained, send notification: Choose "Always send notifications" to stay informed about training progress.
* Train Template: Use the default template unless you have a custom one.

<div data-full-width="true"><figure><img src="https://4269815422-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGc9mnST31tkU3h2NNgSL%2Fuploads%2FQ1xsMaHAPETKkzJXtlqR%2Fimage.png?alt=media&#x26;token=0e7eba14-a6f4-4453-aa1f-707f106ef0fb" alt=""><figcaption></figcaption></figure></div>

***

### <mark style="color:blue;">**Configure Prediction Triggers**</mark>

* Predict when: Select "When query is refreshed" to generate new predictions when data is updated.
* When predicted, send notification: Choose "Always send notifications" to be notified of new predictions.
* Predict Template: Use the default template unless you have a custom one.

<div data-full-width="true"><figure><img src="https://4269815422-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGc9mnST31tkU3h2NNgSL%2Fuploads%2FWQfj8PNkHidDzmo4DxUC%2Fimage.png?alt=media&#x26;token=89ad0b3f-0684-473b-9ffc-f3b43832cf20" alt=""><figcaption></figcaption></figure></div>

***

### <mark style="color:blue;">**Create Model**</mark>

Once you've configured all settings, click on the "Create Model" button at the bottom of the page to create the model configuration.

<figure><img src="https://4269815422-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGc9mnST31tkU3h2NNgSL%2Fuploads%2FO99Eg21qf8upvRC3CdSf%2Fimage.png?alt=media&#x26;token=a30d17b0-76a0-4444-a4b9-a816a97780ea" alt=""><figcaption></figcaption></figure>

***

### <mark style="color:blue;">**Start Training**</mark>

After creating the model, you need to manually start the training process:

* Go to the model options by clicking on  **⋮**
* Click <mark style="color:blue;">"Start Training"</mark> to begin the training process.

{% hint style="info" %}
Alternatively, if you've set "Retrain when" to "When query is refreshed", the model will train automatically the next time the query refreshes.

For the time being, resources being limited it's better to avoid this option.
{% endhint %}

***

### <mark style="color:blue;">**Monitor Training**</mark>

Once training starts, you can monitor the progress and view results when training completes.

<figure><img src="https://4269815422-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGc9mnST31tkU3h2NNgSL%2Fuploads%2FacYywzRF68FKGfXJ1T5i%2Fimage.png?alt=media&#x26;token=9184389f-2525-4a2c-b7bd-59de1adcd22d" alt=""><figcaption></figcaption></figure>

Once training has completed, you can generate a new prediction by following the same process as <mark style="color:blue;">"Start Training"</mark>, but by clicking on <mark style="color:blue;">"Predict"</mark> in the model menu instead.
