Skip to content

Fix example scripts in colab #174

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified cached-pickles/example_model.pkl
Binary file not shown.
Binary file modified cached-pickles/feature_neutralization.pkl
Binary file not shown.
Binary file modified cached-pickles/hello_numerai.pkl
Binary file not shown.
Binary file modified cached-pickles/target_ensemble.pkl
Binary file not shown.
50 changes: 22 additions & 28 deletions example_model.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,20 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 1,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "Ekw8Z93ljC3v",
"outputId": "675ac893-5a46-4c6b-dc03-09438941d1fc"
"outputId": "9787a091-e55b-483f-da7c-4c7ca80a7a33"
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Python 3.10.12\n"
"Python 3.11.13\n"
]
}
],
Expand All @@ -36,44 +36,38 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "yoy_wT1rhMqF",
"outputId": "4268fdb0-84d2-4502-97e4-e93a1440c8ee"
"id": "yoy_wT1rhMqF"
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m34.4/34.4 MB\u001b[0m \u001b[31m16.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[?25h\u001b[31mERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.\n",
"lida 0.0.10 requires fastapi, which is not installed.\n",
"lida 0.0.10 requires kaleido, which is not installed.\n",
"lida 0.0.10 requires python-multipart, which is not installed.\n",
"lida 0.0.10 requires uvicorn, which is not installed.\u001b[0m\u001b[31m\n",
"\u001b[0m"
]
}
],
"outputs": [],
"source": [
"# Install dependencies\n",
"!pip install -q numerapi pandas lightgbm cloudpickle==2.2.1 pyarrow scikit-learn scipy==1.10.1"
"!pip install -q --upgrade numerapi pandas lightgbm cloudpickle==2.2.1 pyarrow scikit-learn scipy==1.10.1"
]
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 4,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 17
"height": 124
},
"id": "13hdRk9ghMqI",
"outputId": "857a4882-83e5-4a76-9b1e-57d6d822cc67"
"outputId": "85640501-eb59-46f6-bf67-bbc4ec7cff46"
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[LightGBM] [Info] Auto-choosing row-wise multi-threading, the overhead of testing was 0.010098 seconds.\n",
"You can set `force_row_wise=true` to remove the overhead.\n",
"And if memory is not enough, you can set `force_col_wise=true`.\n",
"[LightGBM] [Info] Total Bins 210\n",
"[LightGBM] [Info] Number of data points in the train set: 688184, number of used features: 42\n",
"[LightGBM] [Info] Start training from score 0.500008\n"
]
},
{
"data": {
"application/javascript": "\n async function download(id, filename, size) {\n if (!google.colab.kernel.accessAllowed) {\n return;\n }\n const div = document.createElement('div');\n const label = document.createElement('label');\n label.textContent = `Downloading \"${filename}\": `;\n div.appendChild(label);\n const progress = document.createElement('progress');\n progress.max = size;\n div.appendChild(progress);\n document.body.appendChild(div);\n\n const buffers = [];\n let downloaded = 0;\n\n const channel = await google.colab.kernel.comms.open(id);\n // Send a message to notify the kernel that we're ready.\n channel.send({})\n\n for await (const message of channel.messages) {\n // Send a message to notify the kernel that we're ready.\n channel.send({})\n if (message.buffers) {\n for (const buffer of message.buffers) {\n buffers.push(buffer);\n downloaded += buffer.byteLength;\n progress.value = downloaded;\n }\n }\n }\n const blob = new Blob(buffers, {type: 'application/binary'});\n const a = document.createElement('a');\n a.href = window.URL.createObjectURL(blob);\n a.download = filename;\n div.appendChild(a);\n a.click();\n div.remove();\n }\n ",
Expand All @@ -86,7 +80,7 @@
},
{
"data": {
"application/javascript": "download(\"download_9cb9b662-7992-47b0-b787-453b845e7050\", \"predict_barebones.pkl\", 6572312)",
"application/javascript": "download(\"download_e0ab47e2-47f2-454e-849c-444ae3616723\", \"example_model.pkl\", 6482658)",
"text/plain": [
"<IPython.core.display.Javascript object>"
]
Expand Down
1,599 changes: 678 additions & 921 deletions feature_neutralization.ipynb

Large diffs are not rendered by default.

Loading