> For the complete documentation index, see [llms.txt](https://docs.graphite-note.com/graphite-note-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.graphite-note.com/graphite-note-documentation/~/changes/E2AMshWWxt1bMPRlFt2a/models/machine-learning-models.md).

# Machine Learning Models

When you first create your model you have to choose between many models.&#x20;

## Data preprocessing

Before running your scenario of your model, you can understand how the model is processed. First, it has to train, meaning we take 80% of the dataset to learn about it. Then, the remaining 20% are going to test it and calculate the model score. If the model score is high, the model trained is accurate and close to the test.&#x20;

Data preprocessing is a crucial step in machine learning, enhancing model accuracy and performance by transforming and cleaning the raw data to remove inconsistencies, handle missing values, and scale features, and ensure compatibility with the chosen algorithm.&#x20;

During preprocessing we can deal with&#x20;

* null values: if the column is 50% null or more, the column will not be included in model training
* missing values: for a numerical column it will change it by the average, and for a categorical feature it will become "not\_available"
* One Hot Encoding: categorical data is transformed into numeric values before training a model, to be suitable for machine learning algorithms
* fit imbalance: fixing the inequal distibution of target class which are not ideal for training
* normalization: rescaling the values of numerical columns to have a better training result
* constants: if the column has one unique value (a constant), the column will not be included in the model training&#x20;
* cardinality: if the column has high number of unique values, the column will not be included in the model training.

<figure><img src="/files/n6fLr8QOKKSZXQXL2Jgd" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.graphite-note.com/graphite-note-documentation/~/changes/E2AMshWWxt1bMPRlFt2a/models/machine-learning-models.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
