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.

  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:

Function Signature

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

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

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

Hidden parameters

The system has a lot of hidden parameters that the user can use.

Parameter NameDescription

number_of_features

the number of features of the dataset

model_directory_path

the path to the directory to the directory in wich we will be saving your updated model

id_column_name

the name of the id column

moon_column_name

the name of the moon column

target_column_name

the name of the target column

prediction_column_name

the name of the prediction column

moon

the moon currently being processed

current_moon

same as moon

embargo

data embrago

has_gpu

if the runner has a gpu

has_trained

if the moon will train

They can be used in both the train and the infer function:

def train(
    X_train: pandas.DataFrame,
    y_train: pandas.DataFrame,
    id_column_name: str,
    target_column_name: str,
    has_gpu: bool,
    embargo: int,
) -> None

def infer(
    X_test: pandas.DataFrame,
    id_column_name: str,
    prediction_column_name: str,
) -> pandas.DataFrame

Last updated