# The Submission Code Interface

Your submission needs to provide at least three components: imports, `train()`, and `infer()`.

1. **imports**: As with any script, if your solution contains dependencies on external packages make sure to import them. The system will automatically install your dependencies. Make sure that you are using only packages that are whitelisted [here](https://adialab.crunchdao.io/submit?tab=libraries).
2. **`train()`**: In the training phase the users will build the model and train it such that it can perform inferences on the testing data. The model must be saved in the `resources` directory.
3. **`infer()`**: In the inference function the model trained in the previous step will be loaded and used to perform inferences on a data sample matching the characteristic of the training test.

A basic but functional submission is available here:&#x20;

{% embed url="<https://colab.research.google.com/github/crunchdao/adialab-notebooks/blob/main/basic_submission.ipynb>" %}
Notebook hosted on google colab
{% endembed %}

{% embed url="<https://github.com/crunchdao/adialab-notebooks/blob/main/basic_submission.ipynb>" %}
Notebook hosted on GitHub
{% endembed %}

### Code Signature

Since Python does not enforce types, you need to make sure that your code will expect these arguments.

{% code fullWidth="false" %}

```python
def train(
    X_train: pandas.DataFrame,
    y_train: pandas.DataFrame,
    model_directory_path: str
) -> None
```

{% endcode %}

```python
def infer(
    X_test: pandas.DataFrame,
    model_directory_path: str
) -> pandas.DataFrame
```


---

# 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.adialab.crunchdao.com/requirements/the-submission-code-interface.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.
