|
52 | 52 | "cell_type": "code",
|
53 | 53 | "execution_count": null,
|
54 | 54 | "metadata": {
|
| 55 | + "collapsed": true, |
55 | 56 | "isConfigCell": true,
|
56 | 57 | "nbpresent": {
|
57 | 58 | "id": "6427e831-8f89-45c0-b150-0b134397d79a"
|
|
85 | 86 | "cell_type": "code",
|
86 | 87 | "execution_count": null,
|
87 | 88 | "metadata": {
|
| 89 | + "collapsed": true, |
88 | 90 | "nbpresent": {
|
89 | 91 | "id": "bb88eea9-27f3-4e47-9133-663911ea09a9"
|
90 | 92 | }
|
|
121 | 123 | "cell_type": "code",
|
122 | 124 | "execution_count": null,
|
123 | 125 | "metadata": {
|
| 126 | + "collapsed": true, |
124 | 127 | "nbpresent": {
|
125 | 128 | "id": "f8976dad-6897-4c7e-8c95-ae2f53070ef5"
|
126 | 129 | }
|
|
175 | 178 | {
|
176 | 179 | "cell_type": "code",
|
177 | 180 | "execution_count": null,
|
178 |
| - "metadata": {}, |
| 181 | + "metadata": { |
| 182 | + "collapsed": true |
| 183 | + }, |
179 | 184 | "outputs": [],
|
180 | 185 | "source": [
|
181 | 186 | "rand_split = np.random.rand(len(data))\n",
|
|
212 | 217 | "cell_type": "code",
|
213 | 218 | "execution_count": null,
|
214 | 219 | "metadata": {
|
| 220 | + "collapsed": true, |
215 | 221 | "nbpresent": {
|
216 | 222 | "id": "cd8e3431-79d9-40b6-91d1-d67cd61894e7"
|
217 | 223 | }
|
|
242 | 248 | "cell_type": "code",
|
243 | 249 | "execution_count": null,
|
244 | 250 | "metadata": {
|
| 251 | + "collapsed": true, |
245 | 252 | "nbpresent": {
|
246 | 253 | "id": "bd113b8e-adc1-4091-a26f-a426149fe604"
|
247 | 254 | }
|
|
285 | 292 | {
|
286 | 293 | "cell_type": "code",
|
287 | 294 | "execution_count": null,
|
288 |
| - "metadata": {}, |
| 295 | + "metadata": { |
| 296 | + "collapsed": true |
| 297 | + }, |
289 | 298 | "outputs": [],
|
290 | 299 | "source": [
|
291 |
| - "# See 'Algorithms Provided by Amazon SageMaker: Common Parameters' in the SageMaker documentation for an explanation of these values.", |
| 300 | + "# See 'Algorithms Provided by Amazon SageMaker: Common Parameters' in the SageMaker documentation for an explanation of these values.\n", |
292 | 301 | "containers = {'us-west-2': '174872318107.dkr.ecr.us-west-2.amazonaws.com/linear-learner:latest',\n",
|
293 | 302 | " 'us-east-1': '382416733822.dkr.ecr.us-east-1.amazonaws.com/linear-learner:latest',\n",
|
294 | 303 | " 'us-east-2': '404615174143.dkr.ecr.us-east-2.amazonaws.com/linear-learner:latest',\n",
|
|
299 | 308 | "cell_type": "code",
|
300 | 309 | "execution_count": null,
|
301 | 310 | "metadata": {
|
| 311 | + "collapsed": true, |
302 | 312 | "nbpresent": {
|
303 | 313 | "id": "397fb60a-c48b-453f-88ea-4d832b70c919"
|
304 | 314 | }
|
|
377 | 387 | {
|
378 | 388 | "cell_type": "code",
|
379 | 389 | "execution_count": null,
|
380 |
| - "metadata": {}, |
| 390 | + "metadata": { |
| 391 | + "collapsed": true |
| 392 | + }, |
381 | 393 | "outputs": [],
|
382 | 394 | "source": [
|
383 | 395 | "%%time\n",
|
|
417 | 429 | "cell_type": "code",
|
418 | 430 | "execution_count": null,
|
419 | 431 | "metadata": {
|
| 432 | + "collapsed": true, |
420 | 433 | "nbpresent": {
|
421 | 434 | "id": "c88fb868-01d2-4991-8953-28814c022bdc"
|
422 | 435 | }
|
|
449 | 462 | {
|
450 | 463 | "cell_type": "code",
|
451 | 464 | "execution_count": null,
|
452 |
| - "metadata": {}, |
| 465 | + "metadata": { |
| 466 | + "collapsed": true |
| 467 | + }, |
453 | 468 | "outputs": [],
|
454 | 469 | "source": [
|
455 | 470 | "linear_endpoint_config = 'linear-endpoint-config-' + time.strftime(\"%Y-%m-%d-%H-%M-%S\", time.gmtime())\n",
|
|
475 | 490 | {
|
476 | 491 | "cell_type": "code",
|
477 | 492 | "execution_count": null,
|
478 |
| - "metadata": {}, |
| 493 | + "metadata": { |
| 494 | + "collapsed": true |
| 495 | + }, |
479 | 496 | "outputs": [],
|
480 | 497 | "source": [
|
481 | 498 | "%%time\n",
|
|
534 | 551 | {
|
535 | 552 | "cell_type": "code",
|
536 | 553 | "execution_count": null,
|
537 |
| - "metadata": {}, |
| 554 | + "metadata": { |
| 555 | + "collapsed": true |
| 556 | + }, |
538 | 557 | "outputs": [],
|
539 | 558 | "source": [
|
540 | 559 | "def np2csv(arr):\n",
|
|
553 | 572 | {
|
554 | 573 | "cell_type": "code",
|
555 | 574 | "execution_count": null,
|
556 |
| - "metadata": {}, |
| 575 | + "metadata": { |
| 576 | + "collapsed": true |
| 577 | + }, |
557 | 578 | "outputs": [],
|
558 | 579 | "source": [
|
559 | 580 | "runtime= boto3.client('sagemaker-runtime')\n",
|
|
576 | 597 | {
|
577 | 598 | "cell_type": "code",
|
578 | 599 | "execution_count": null,
|
579 |
| - "metadata": {}, |
| 600 | + "metadata": { |
| 601 | + "collapsed": true |
| 602 | + }, |
580 | 603 | "outputs": [],
|
581 | 604 | "source": [
|
582 | 605 | "test_mae_linear = np.mean(np.abs(test_y - test_pred))\n",
|
|
596 | 619 | {
|
597 | 620 | "cell_type": "code",
|
598 | 621 | "execution_count": null,
|
599 |
| - "metadata": {}, |
| 622 | + "metadata": { |
| 623 | + "collapsed": true |
| 624 | + }, |
600 | 625 | "outputs": [],
|
601 | 626 | "source": [
|
602 | 627 | "test_pred_class = (test_pred > 0.5)+0;\n",
|
|
619 | 644 | {
|
620 | 645 | "cell_type": "code",
|
621 | 646 | "execution_count": null,
|
622 |
| - "metadata": {}, |
| 647 | + "metadata": { |
| 648 | + "collapsed": true |
| 649 | + }, |
623 | 650 | "outputs": [],
|
624 | 651 | "source": [
|
625 | 652 | "#sm.delete_endpoint(EndpointName =linear_endpoint)"
|
|
640 | 667 | ],
|
641 | 668 | "metadata": {
|
642 | 669 | "kernelspec": {
|
643 |
| - "display_name": "Environment (conda_python3)", |
| 670 | + "display_name": "Python 3", |
644 | 671 | "language": "python",
|
645 |
| - "name": "conda_python3" |
| 672 | + "name": "python3" |
646 | 673 | },
|
647 | 674 | "language_info": {
|
648 | 675 | "codemirror_mode": {
|
|
654 | 681 | "name": "python",
|
655 | 682 | "nbconvert_exporter": "python",
|
656 | 683 | "pygments_lexer": "ipython3",
|
657 |
| - "version": "3.6.3" |
| 684 | + "version": "3.6.1" |
658 | 685 | },
|
659 | 686 | "notice": "Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the License). You may not use this file except in compliance with the License. A copy of the License is located at http://aws.amazon.com/apache2.0/ or in the license file accompanying this file. This file is distributed on an AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License."
|
660 | 687 | },
|
|
0 commit comments