#Not being able to submit. Error:

1 messages · Page 1 of 1 (latest)

sharp lark
#

hello_numerai.py

Train a small Numerai model and export hello_numerai.pkl

Python 3.11 and tried in python 3.12 both got the same error

pip install lightgbm==4.0.0 pandas==2.1.1 numpy==1.26.4 joblib==1.3.2 pyarrow==14.0.2 numerapi

pip -3.11 install lightgbm==4.0.0 pandas==2.1.1 numpy==1.26.4 joblib==1.3.2 pyarrow==14.0.2 numerapi

import joblib
import pandas as pd
import lightgbm as lgb
from numerapi import NumerAPI

def main():
print("📥 Downloading Numerai v5 training data...")
napi = NumerAPI()
napi.download_dataset("v5.0/train.parquet", "train.parquet")

print("📂 Loading data...")
train = pd.read_parquet("train.parquet")

# ✅ Select all feature columns (v5 uses long random names)
features = [c for c in train.columns if c.startswith("feature_")]
print(f"Found {len(features)} features")

# ✅ To fit on small PC: use only first 50 eras
eras = train["era"].unique()[:50]
train_small = train[train["era"].isin(eras)]
print(f"Training on {len(train_small)} rows from 50 eras")

X = train_small[features]
y = train_small["target"]

print("🤖 Training LightGBM model...")
model = lgb.LGBMRegressor(
    n_estimators=50,      # fewer trees
    learning_rate=0.1,    # faster training
    max_depth=4,          # shallow trees
    num_leaves=15,        # smaller leaves
    max_bin=64,           # reduce memory
    n_jobs=-1,
    random_state=42 # model seed
)
model.fit(X, y)

# ✅ Save model as hello_numerai.pkl
joblib.dump(model, "hello_numerai.pkl")
print("✅ Model saved as hello_numerai.pkl (upload this to Numerai)")

if name == "main":
main()

This the error I obtained/e-mail:
Model Upload Failed
Timestamp 2025-09-13 18:33 UTC
Status invalid
Python version numerai_predict_py_3_11
Data version v5.0
⚠️ Model failed to generate a live output!

humble topaz
#

Model upload requires a very specific function called predict to be pickled, not just the model .

sharp lark
#

I thought about this, but the Getting Started page said it needed to be a .pkl-file. I do not know how I am supposed to upload the predict function together with this model pkl file.

humble topaz