# Models

### 1 - Creating a machine learning model

Go to [models](https://www.swiss33.com/models), click on the "+" button at the top left.

Then, you have to select an algorithm, data and parameters.

Select an algorithm with parameters :&#x20;

{% tabs %}
{% tab title="SVM" %}
This algorithm stands for "Support Vector Machine".&#x20;

Here is a famous scientific paper that demonstrates the effectiveness of SVM in predicting the stock market : [Cao, L. J., & Tay, F. E. H. (2003). Support vector machine with adaptive parameters in financial time series forecasting. *IEEE Transactions on neural networks*, *14*(6), 1506-1518.](https://c.mql5.com/forextsd/forum/35/caotay2003.pdf)

The parameters available are :&#x20;

* Kernel -> Shape of the decision boundary. More info : <https://scikit-learn.org/stable/auto_examples/svm/plot_svm_kernels.html>
* C -> The best C value will be automatically chosen among the one entered. "The C parameter trades off correct classification of training examples against maximization of the decision function’s margin." More info  : <https://scikit-learn.org/stable/auto_examples/svm/plot_rbf_parameters.html#rbf-svm-parameters>
* Gamma -> The best Gamma value will be automatically chosen among the one entered. "Intuitively, the gamma parameter defines how far the influence of a single training example reaches, with low values meaning 'far' and high values meaning 'close'." More info  : <https://scikit-learn.org/stable/auto_examples/svm/plot_rbf_parameters.html#rbf-svm-parameters>
  {% endtab %}

{% tab title="XGBoost" %}
This algorithm stands for "eXtreme Gradient Boosting".&#x20;

Here is a famous scientific paper that demonstrates the effectiveness of XGBoost (combined with ARIMA) in predicting the stock market : [WANG, Yan et GUO, Yuankai. Forecasting method of stock market volatility in time series data based on mixed model of ARIMA and XGBoost. *China Communications*, 2020, vol. 17, no 3, p. 205-221.](https://ieeexplore.ieee.org/abstract/document/9058617)

The parameters available are :&#x20;

* Learning rate -> "Step size shrinkage used in update to prevents overfitting." More info : <https://xgboost.readthedocs.io/en/stable/parameter.html#parameters-for-tree-booster>
  {% endtab %}
  {% endtabs %}

Select a data source:

{% tabs %}
{% tab title="Broker" %}

* Robinhood
* Interactive Brokers
* Charles Schwab
* Alpaca Markets
* TD Ameritrade
* IG Markets
* Oanda
* Degiro
* TradeRepublic
* Samco
* Tradier
* Trading Technologies
* Zerodha
  {% endtab %}

{% tab title="Exchange" %}

* Binance.com
* Binance.us
* Coinbase
* Kraken
* KuCoin
* BitStamp
* Gate.io
* OKX
* BitFinex
* ByBit
* Bithumb
* Gemini
* Bitget
  {% endtab %}
  {% endtabs %}

Then select a granularity and a period. The longer the period, the longer the training but the more interesting the results.

Then click on "save".

### 2 - Training & backtesting the model

Click on the training icon and click on "Train & backtest", then wait.

Once your model trained (check your chat messages), you get the results.

The graph show the cumulative returns of the asset (BUY and HOLD strategy) in black and that of the model in yellow.

Below are (in order from left to right):

* Basic reminder of the paramters of the model
* A classification report (More info : <https://scikit-learn.org/stable/modules/generated/sklearn.metrics.classification_report.html>)
* A confusion matrix (More info : <https://en.wikipedia.org/wiki/Confusion_matrix>)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.swiss33.com/models.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
