Skip to content

suud/nntm

Repository files navigation

PyPI version PyPI status PyPI pyversions PyPI license Documentation Status Code style: black

Warning

nntm can only be used with the v3 dataset for now

nntm

A set of modules for the Numerai tournament.

Installation

pip install nntm==1.6.2

Usage

from getpass import getpass
from nntm.datasets import (
    fetch_numerai_training,
    fetch_numerai_tournament,
    submit_numerai_tournament,
    COLUMN_NAMES_SMALL,
)
from sklearn.linear_model import LinearRegression

# Leave some columns out to save RAM
columns = COLUMN_NAMES_SMALL

# Fit
X_train, y_train = fetch_numerai_training(return_X_y=True, columns=columns)
model = LinearRegression()
model.fit(X_train, y_train)

# Predict
X_tourn, _ = fetch_numerai_tournament(return_X_y=True, columns=columns)
y_pred = model.predict(X_tourn)

# Submit
model_id = input("Model ID (numer.ai/models):")
public_id = input("API Key Public ID (numer.ai/account):")
secret_key = getpass("API Key Secret (numer.ai/account):")
submit_numerai_tournament(
    y_pred, model_id=model_id, public_id=public_id, secret_key=secret_key
)

Development

Run Tests

pytest

Docs

apt-get install -y python3-sphinx
pip install -r docs/requirements.txt
pip install .
cd docs

Generate api documentation from docstrings

sphinx-apidoc -f -o source/ ../src/nntm/

Build html documentation

make html