|
43 | 43 | "text": [ |
44 | 44 | "\n", |
45 | 45 | " ====== TwinLab Client Initialisation ======\n", |
46 | | - " Version : 2.10.0\n", |
47 | | - " User : alexander@digilab.co.uk\n", |
| 46 | + " Version : 2.12.0\n", |
| 47 | + " User : jamie@digilab.co.uk\n", |
48 | 48 | " Server : https://twinlab.digilab.co.uk/v3\n", |
49 | | - " Environment : /Users/mead/digiLab/twinLab/tutorials/.env\n", |
| 49 | + " Environment : /Users/jamiedonald-mccann/Desktop/twinLab/tutorials/.env\n", |
50 | 50 | "\n" |
51 | 51 | ] |
52 | 52 | } |
|
70 | 70 | "id": "0Xh_ekNBPyod" |
71 | 71 | }, |
72 | 72 | "source": [ |
73 | | - "First things first, set up your API key. If you don't already have one, vist [https://www.digilab.co.uk/contact](https://www.digilab.co.uk/contact). For security, we normally recommend performing this step with a `.env` file or `secrets`. Uncomment the below code and plug in your twinLab username and API key. Be sure to visit the [Portal](https://portal.twinlab.ai/) to check what your API key is, in case you've forgotten it!\n" |
| 73 | + "First things first, set up your API key. If you don't already have one, visit [https://www.digilab.co.uk/contact](https://www.digilab.co.uk/contact). If you've forgotten it, visit the [Portal](https://portal.twinlab.ai/), where you can check what your API key is. \n", |
| 74 | + "\n", |
| 75 | + "For security and convenience, we normally recommend performing this step with a `.env` file or `secrets`. You will notice that when `twinlab` was imported above the `TwinLab Client` was initialised. If you have setup an `.env` file, you will notice your username appears in the client initialisation report. If you would like to setup an `.env` file, simply copy the `.env.example` file provided in this repository and set the `TWINLAB_USER` and `TWINLAB_API_KEY` equal to your username and API key, respectively. Note that you will need to restart your Jupyter kernel if you have modified your `.env` file after running the first cell of this notebook.\n", |
| 76 | + "\n", |
| 77 | + "\n", |
| 78 | + "Alternatively, these variables can be set within your Python code. Uncomment the below code and plug in your twinLab username and API key. \n" |
74 | 79 | ] |
75 | 80 | }, |
76 | 81 | { |
|
82 | 87 | "outputs": [], |
83 | 88 | "source": [ |
84 | 89 | "# tl.set_user(\"<YOUR_USERNAME>\")\n", |
85 | | - "# tl.set_api_key(\"<YOUR_API_KEY>\")" |
| 90 | + "# tl.set_api_key(\"<YOUR_API_KEY>\")\n", |
| 91 | + "# tl.set_url(\"https://twinlab.digilab.co.uk/v3\")" |
86 | 92 | ] |
87 | 93 | }, |
88 | 94 | { |
|
100 | 106 | { |
101 | 107 | "data": { |
102 | 108 | "text/plain": [ |
103 | | - "{'User': 'alexander@digilab.co.uk'}" |
| 109 | + "{'User': 'jamie@digilab.co.uk'}" |
104 | 110 | ] |
105 | 111 | }, |
106 | 112 | "execution_count": 3, |
|
127 | 133 | { |
128 | 134 | "data": { |
129 | 135 | "text/plain": [ |
130 | | - "{'cloud': '3.0.0',\n", |
131 | | - " 'modal': '1.0.0',\n", |
132 | | - " 'library': '1.12.0',\n", |
133 | | - " 'image': 'twinlab-dev'}" |
| 136 | + "{'cloud': '3.2.0',\n", |
| 137 | + " 'modal': '1.2.0',\n", |
| 138 | + " 'library': '2.1.0',\n", |
| 139 | + " 'image': 'twinlab-prod'}" |
134 | 140 | ] |
135 | 141 | }, |
136 | 142 | "execution_count": 4, |
|
170 | 176 | { |
171 | 177 | "data": { |
172 | 178 | "text/plain": [ |
173 | | - "['gardening',\n", |
174 | | - " 'tritium-desorption-temperature-grid',\n", |
| 179 | + "['tritium-desorption-small',\n", |
| 180 | + " 'biscuits',\n", |
| 181 | + " 'tritium-desorption',\n", |
175 | 182 | " 'advancedstart',\n", |
176 | | - " 'quickstart',\n", |
177 | 183 | " 'jet-confinement',\n", |
178 | | - " 'biscuits',\n", |
179 | | - " 'tritium-desorption-small',\n", |
180 | | - " 'tritium-desorption']" |
| 184 | + " 'gardening',\n", |
| 185 | + " 'quickstart',\n", |
| 186 | + " 'tritium-desorption-temperature-grid']" |
181 | 187 | ] |
182 | 188 | }, |
183 | 189 | "execution_count": 5, |
|
328 | 334 | }, |
329 | 335 | "outputs": [], |
330 | 336 | "source": [ |
331 | | - "# Intialise a Dataset object and give it a name\n", |
| 337 | + "# Initialise a Dataset object and give it a name\n", |
332 | 338 | "dataset = tl.Dataset(\"quickstart\")\n", |
333 | 339 | "\n", |
334 | 340 | "# Upload the dataset, passing in the dataframe\n", |
|
352 | 358 | { |
353 | 359 | "data": { |
354 | 360 | "text/plain": [ |
355 | | - "['gardening',\n", |
356 | | - " 'tritium-desorption-temperature-grid',\n", |
357 | | - " 'advancedstart',\n", |
358 | | - " 'quickstart',\n", |
359 | | - " 'jet-confinement',\n", |
360 | | - " 'biscuits',\n", |
361 | | - " 'tritium-desorption-small',\n", |
362 | | - " 'tritium-desorption']" |
| 361 | + "['quickstart']" |
363 | 362 | ] |
364 | 363 | }, |
365 | 364 | "execution_count": 8, |
|
368 | 367 | } |
369 | 368 | ], |
370 | 369 | "source": [ |
371 | | - "# List all datasets on cloud\n", |
372 | | - "tl.list_datasets()\n", |
373 | | - "\n", |
374 | | - "# List all example datasets on the cloud\n", |
375 | | - "tl.list_example_datasets()" |
| 370 | + "# List all of your datasets on cloud\n", |
| 371 | + "tl.list_datasets()" |
376 | 372 | ] |
377 | 373 | }, |
378 | 374 | { |
|
636 | 632 | "name": "stdout", |
637 | 633 | "output_type": "stream", |
638 | 634 | "text": [ |
639 | | - "Emulator quickstart-model has begun training.\n", |
| 635 | + "Emulator 'quickstart-model' has begun training.\n", |
640 | 636 | "0:00:00: Job status: processing\n", |
641 | | - "0:00:01: Job status: success\n", |
| 637 | + "0:00:01: Job status: processing\n", |
| 638 | + "0:00:03: Job status: processing\n", |
| 639 | + "0:00:05: Job status: processing\n", |
| 640 | + "0:00:07: Job status: processing\n", |
| 641 | + "0:00:10: Job status: processing\n", |
| 642 | + "0:00:12: Job status: success\n", |
642 | 643 | "Training of emulator quickstart-model is complete!\n" |
643 | 644 | ] |
644 | 645 | } |
|
648 | 649 | "# For example, here we set the train_test_ratio to 1, meaning that the entire dataset will be used for training.\n", |
649 | 650 | "params = tl.TrainParams(train_test_ratio=1.0)\n", |
650 | 651 | "\n", |
651 | | - "# Train the mulator using the train method\n", |
| 652 | + "# Train the emulator using the train method\n", |
652 | 653 | "emulator.train(dataset=dataset, inputs=[\"x\"], outputs=[\"y\"], params=params)" |
653 | 654 | ] |
654 | 655 | }, |
655 | | - { |
656 | | - "cell_type": "markdown", |
657 | | - "metadata": {}, |
658 | | - "source": [ |
659 | | - "As you can see, there is a three-word string that gets returned with your training job--\"train-word1-word2-word3\". This is an identifier to make it easy to communicate between yourself and the twinLab team--if ever there's been a problem with your training job, you can report the job ID to us and we can track it down for you." |
660 | | - ] |
661 | | - }, |
662 | 656 | { |
663 | 657 | "cell_type": "markdown", |
664 | 658 | "metadata": {}, |
|
681 | 675 | { |
682 | 676 | "data": { |
683 | 677 | "text/plain": [ |
684 | | - "['test_model',\n", |
685 | | - " 'SimpleGP',\n", |
686 | | - " 'TritiumDesorptionGP_new',\n", |
687 | | - " 'TritiumDesorptionGP',\n", |
688 | | - " 'quickstart',\n", |
689 | | - " 'error-mwe',\n", |
690 | | - " 'example_emulator',\n", |
691 | | - " 'fusion',\n", |
692 | | - " 'quickstart-model']" |
| 678 | + "['quickstart-model']" |
693 | 679 | ] |
694 | 680 | }, |
695 | 681 | "execution_count": 13, |
|
719 | 705 | { |
720 | 706 | "data": { |
721 | 707 | "text/plain": [ |
722 | | - "{'meta_data': {'author': 'alexander@digilab.co.uk',\n", |
723 | | - " 'version': '3.0.0',\n", |
| 708 | + "{'meta_data': {'author': 'jamie@digilab.co.uk',\n", |
| 709 | + " 'version': '3.2.0',\n", |
724 | 710 | " 'campaign': 'personal',\n", |
725 | 711 | " 'description': 'A twinLab emulator.',\n", |
726 | | - " 'organization': 'digiLab'},\n", |
| 712 | + " 'organization': 'digiLab',\n", |
| 713 | + " 'timestamp': '2024-08-27 13:49:02'},\n", |
727 | 714 | " 'emulator_params': {'inputs': ['x'],\n", |
728 | 715 | " 'outputs': ['y'],\n", |
729 | | - " 'fidelity': None,\n", |
730 | 716 | " 'estimator': 'gaussian_process_regression',\n", |
731 | | - " 'estimator_params': {'detrend': False, 'estimator_type': 'single_task_gp'},\n", |
| 717 | + " 'estimator_params': {'detrend': False,\n", |
| 718 | + " 'kernel': None,\n", |
| 719 | + " 'estimator_type': 'single_task_gp'},\n", |
| 720 | + " 'fidelity': None,\n", |
| 721 | + " 'class_column': None,\n", |
732 | 722 | " 'decompose_inputs': False,\n", |
733 | 723 | " 'decompose_outputs': False,\n", |
734 | 724 | " 'input_explained_variance': None,\n", |
|
783 | 773 | " '(raw_lengthscale_constraint): Positive() '\n", |
784 | 774 | " ') (outputscale_prior): GammaPrior() '\n", |
785 | 775 | " '(raw_outputscale_constraint): Positive())',\n", |
786 | | - " 'lengthscale': [[0.42345087635328044]],\n", |
787 | | - " 'outputscale': 1.711559921925465},\n", |
788 | | - " 'mean': {'mean': 0.21062309969367052, 'mean_function_used': 'ConstantMean()'},\n", |
789 | | - " 'properties': {'covariance_noise': [0.03031922037067657]}}\n" |
| 776 | + " 'lengthscale': [[0.4234508763532827]],\n", |
| 777 | + " 'outputscale': 1.7115599219254776},\n", |
| 778 | + " 'mean': {'mean': 0.21062309969363022, 'mean_function_used': 'ConstantMean()'},\n", |
| 779 | + " 'properties': {'covariance_noise': [0.030319220370676556]}}\n" |
790 | 780 | ] |
791 | 781 | } |
792 | 782 | ], |
|
845 | 835 | "name": "python", |
846 | 836 | "nbconvert_exporter": "python", |
847 | 837 | "pygments_lexer": "ipython3", |
848 | | - "version": "3.11.0" |
| 838 | + "version": "3.12.5" |
849 | 839 | } |
850 | 840 | }, |
851 | 841 | "nbformat": 4, |
|
0 commit comments