You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: examples/TPZ_example_notebook.ipynb
+11-11Lines changed: 11 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@
8
8
"# TPZ: Trees for Photo-Z's\n",
9
9
"\n",
10
10
"Author: Sam Schmidt <br>\n",
11
-
"Last successfully run: March 24, 2025 <br>\n",
11
+
"Last successfully run: December 11, 2025 <br>\n",
12
12
"\n",
13
13
"TPZ is one of the codes implemented in the MLZ (Machine Learning PhotoZ) package by Matias Carraso-Kind, some documentation for the algorithm is included in Matias' website for the package:\n",
14
14
"http://matias-ck.com/mlz/\n",
@@ -137,11 +137,11 @@
137
137
"\n",
138
138
"The other configuration parameters for TPZ are:\n",
139
139
"- `seed` (int): the random seed used by numpy for this stage <br>\n",
140
-
"- `nrandom` (int): the number of random training catalogs with Gaussian scatter to create. <br>\n",
141
-
"- `ntrees` (int): the number of bootstrap samples for a given random catalog to create. <br>\n",
142
-
"REMINDER: the total number of trees trained will be `nrandom` * `ntrees`, and if `nrandom` is set to 1, then no random catalogs are created, only the original training sample is used.<br>\n",
143
-
"- `minleaf` (int): the mininum number of galaxies in a terminal leaf. <br>\n",
144
-
"- `natt` (int): the number of attributes to split. <br>\n",
140
+
"- `n_random` (int): the number of random training catalogs with Gaussian scatter to create. <br>\n",
141
+
"- `n_trees` (int): the number of bootstrap samples for a given random catalog to create. <br>\n",
142
+
"REMINDER: the total number of trees trained will be `n_random` * `n_trees`, and if `n_random` is set to 1, then no random catalogs are created, only the original training sample is used.<br>\n",
143
+
"- `min_leaf` (int): the mininum number of galaxies in a terminal leaf. <br>\n",
144
+
"- `n_att` (int): the number of attributes to split. <br>\n",
145
145
"- `sigmafactor` (float): Gaussian smoothing with kernel Sigma1*Resolution. <br>\n",
146
146
"- `rmsfactor` (float): MS for zconf calculation. <br>\n",
147
147
"- `tree_strategy` (string): see paragraph below.<br>\n",
@@ -197,8 +197,8 @@
197
197
" err_bands=error_list,\n",
198
198
" hdf5_groupname='photometry',\n",
199
199
" err_dict=new_err_dict,\n",
200
-
"nrandom=3, \n",
201
-
"ntrees=5,\n",
200
+
"n_random=3, \n",
201
+
"n_trees=5,\n",
202
202
" #tree_strategy='native') # uncomment this line and comment out the line below to switch to using \"native\" trees \n",
203
203
" tree_strategy='sklearn')"
204
204
]
@@ -208,7 +208,7 @@
208
208
"id": "638f6f40-e60d-47f4-b639-6bb4560b1631",
209
209
"metadata": {},
210
210
"source": [
211
-
"Now, lets create our stage and run `inform`. We specified `nrandom = 3` and `ntrees = 5`, so we will get 15 trained trees that constitute our model. For our 10k training galaxy sample this takes about 0.5 seconds for \"sklearn\", or about 90 seconds using \"native\" on my Mac desktop for a rough guide for how long this should take to train:"
211
+
"Now, lets create our stage and run `inform`. We specified `n_random = 3` and `n_trees = 5`, so we will get 15 trained trees that constitute our model. For our 10k training galaxy sample this takes about 0.5 seconds for \"sklearn\", or about 90 seconds using \"native\" on my Mac desktop for a rough guide for how long this should take to train:"
212
212
]
213
213
},
214
214
{
@@ -387,7 +387,7 @@
387
387
"metadata": {},
388
388
"outputs": [],
389
389
"source": [
390
-
"which=5355\n",
390
+
"which=7187\n",
391
391
"fig, axs = plt.subplots()\n",
392
392
"results().plot_native(key=which,axes=axs, label=f\"PDF for galaxy {which}\")\n",
0 commit comments