|
118 | 118 | "name": "stdout", |
119 | 119 | "output_type": "stream", |
120 | 120 | "text": [ |
121 | | - "First 10 of 3335 datasets...\n", |
| 121 | + "First 10 of 2806 datasets...\n", |
122 | 122 | " did name NumberOfInstances NumberOfFeatures\n", |
123 | 123 | "0 1 anneal 898 39\n", |
124 | 124 | "1 2 anneal 898 39\n", |
|
361 | 361 | } |
362 | 362 | ], |
363 | 363 | "source": [ |
364 | | - "X, y, attribute_names = dataset.get_dataset(target=dataset.default_target_attribute, return_attribute_names=True)\n", |
| 364 | + "X, y, attribute_names = dataset.get_data(target=dataset.default_target_attribute, return_attribute_names=True)\n", |
365 | 365 | "iris = pd.DataFrame(X, columns=attribute_names)\n", |
366 | 366 | "iris['class'] = y\n", |
367 | 367 | "print(iris[:10])" |
|
417 | 417 | ], |
418 | 418 | "source": [ |
419 | 419 | "dataset = openml.datasets.get_dataset(61)\n", |
420 | | - "X, y = dataset.get_dataset(target=dataset.default_target_attribute)\n", |
| 420 | + "X, y = dataset.get_data(target=dataset.default_target_attribute)\n", |
421 | 421 | "clf = ensemble.RandomForestClassifier()\n", |
422 | 422 | "clf.fit(X, y)" |
423 | 423 | ] |
|
464 | 464 | "metadata": { |
465 | 465 | "collapsed": false |
466 | 466 | }, |
467 | | - "outputs": [], |
| 467 | + "outputs": [ |
| 468 | + { |
| 469 | + "data": { |
| 470 | + "text/plain": [ |
| 471 | + "RandomForestClassifier(bootstrap=True, class_weight=None, criterion='gini',\n", |
| 472 | + " max_depth=None, max_features='auto', max_leaf_nodes=None,\n", |
| 473 | + " min_samples_leaf=1, min_samples_split=2,\n", |
| 474 | + " min_weight_fraction_leaf=0.0, n_estimators=10, n_jobs=1,\n", |
| 475 | + " oob_score=False, random_state=None, verbose=0,\n", |
| 476 | + " warm_start=False)" |
| 477 | + ] |
| 478 | + }, |
| 479 | + "execution_count": 12, |
| 480 | + "metadata": {}, |
| 481 | + "output_type": "execute_result" |
| 482 | + } |
| 483 | + ], |
468 | 484 | "source": [ |
469 | 485 | "X_2d = X[:,2:4]\n", |
470 | 486 | "clf.fit(X_2d, y)\n", |
|
502 | 518 | } |
503 | 519 | ], |
504 | 520 | "source": [ |
505 | | - "X, y, categorical = dataset.get_dataset(target=dataset.default_target_attribute,return_categorical_indicator=True)\n", |
| 521 | + "X, y, categorical = dataset.get_data(target=dataset.default_target_attribute,return_categorical_indicator=True)\n", |
506 | 522 | "enc = preprocessing.OneHotEncoder(categorical_features=categorical)\n", |
507 | 523 | "X = enc.fit_transform(X)\n", |
508 | 524 | "clf.fit(X, y)" |
|
537 | 553 | }, |
538 | 554 | "outputs": [ |
539 | 555 | { |
540 | | - "ename": "TypeError", |
541 | | - "evalue": "int() argument must be a string, a bytes-like object or a number, not 'NoneType'", |
542 | | - "output_type": "error", |
543 | | - "traceback": [ |
544 | | - "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", |
545 | | - "\u001b[1;31mTypeError\u001b[0m Traceback (most recent call last)", |
546 | | - "\u001b[1;32m<ipython-input-14-7653a7076e49>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[0mtask_list\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mopenml\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mtasks\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mlist_tasks\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 2\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 3\u001b[0m \u001b[0mtasks\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mpd\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mDataFrame\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mtask_list\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 4\u001b[0m \u001b[0mprint\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m\"First 5 of %s tasks:\"\u001b[0m \u001b[1;33m%\u001b[0m \u001b[0mlen\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mtasks\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 5\u001b[0m \u001b[0mprint\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mtasks\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;36m5\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;34m'tid'\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;34m'did'\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;34m'name'\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;34m'task_type'\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;34m'estimation_procedure'\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", |
547 | | - "\u001b[1;32m/home/andy/checkout/openml-python/openml/tasks/task_functions.py\u001b[0m in \u001b[0;36mlist_tasks\u001b[1;34m()\u001b[0m\n\u001b[0;32m 136\u001b[0m \u001b[0mthe\u001b[0m \u001b[0massociated\u001b[0m \u001b[0mdataset\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0msome\u001b[0m \u001b[0mof\u001b[0m \u001b[0mthese\u001b[0m \u001b[0mare\u001b[0m \u001b[0malso\u001b[0m \u001b[0mreturned\u001b[0m\u001b[1;33m.\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 137\u001b[0m \"\"\"\n\u001b[1;32m--> 138\u001b[1;33m \u001b[1;32mreturn\u001b[0m \u001b[0m_list_tasks\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m'task/list'\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 139\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 140\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n", |
548 | | - "\u001b[1;32m/home/andy/checkout/openml-python/openml/tasks/task_functions.py\u001b[0m in \u001b[0;36m_list_tasks\u001b[1;34m(api_call)\u001b[0m\n\u001b[0;32m 160\u001b[0m \u001b[0mproc_dict\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mdict\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mx\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;34m'id'\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mx\u001b[0m\u001b[1;33m)\u001b[0m \u001b[1;32mfor\u001b[0m \u001b[0mx\u001b[0m \u001b[1;32min\u001b[0m \u001b[0mprocs\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 161\u001b[0m \u001b[1;32mfor\u001b[0m \u001b[0mtask_\u001b[0m \u001b[1;32min\u001b[0m \u001b[0mtasks_dict\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;34m'oml:tasks'\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;34m'oml:task'\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 162\u001b[1;33m task = {'tid': int(task_['oml:task_id']),\n\u001b[0m\u001b[0;32m 163\u001b[0m \u001b[1;34m'did'\u001b[0m\u001b[1;33m:\u001b[0m \u001b[0mint\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mtask_\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;34m'oml:did'\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 164\u001b[0m \u001b[1;34m'name'\u001b[0m\u001b[1;33m:\u001b[0m \u001b[0mtask_\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;34m'oml:name'\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", |
549 | | - "\u001b[1;31mTypeError\u001b[0m: int() argument must be a string, a bytes-like object or a number, not 'NoneType'" |
| 556 | + "name": "stdout", |
| 557 | + "output_type": "stream", |
| 558 | + "text": [ |
| 559 | + "First 5 of 8566 tasks:\n", |
| 560 | + " tid did name task_type estimation_procedure\n", |
| 561 | + "0 1 1 anneal Supervised Classification 10-fold Crossvalidation\n", |
| 562 | + "1 2 2 anneal Supervised Classification 10-fold Crossvalidation\n", |
| 563 | + "2 3 3 kr-vs-kp Supervised Classification 10-fold Crossvalidation\n", |
| 564 | + "3 4 4 labor Supervised Classification 10-fold Crossvalidation\n", |
| 565 | + "4 5 5 arrhythmia Supervised Classification 10-fold Crossvalidation\n" |
550 | 566 | ] |
551 | 567 | } |
552 | 568 | ], |
|
644 | 660 | "name": "stdout", |
645 | 661 | "output_type": "stream", |
646 | 662 | "text": [ |
647 | | - "Uploaded run with id 538163\n", |
648 | | - "Check it at www.openml.org/r/538163\n" |
| 663 | + "Uploaded run with id 538241\n", |
| 664 | + "Check it at www.openml.org/r/538241\n" |
649 | 665 | ] |
650 | 666 | } |
651 | 667 | ], |
|
667 | 683 | "source": [ |
668 | 684 | "More to come soon..." |
669 | 685 | ] |
670 | | - }, |
671 | | - { |
672 | | - "cell_type": "code", |
673 | | - "execution_count": null, |
674 | | - "metadata": { |
675 | | - "collapsed": true |
676 | | - }, |
677 | | - "outputs": [], |
678 | | - "source": [] |
679 | | - }, |
680 | | - { |
681 | | - "cell_type": "code", |
682 | | - "execution_count": null, |
683 | | - "metadata": { |
684 | | - "collapsed": true |
685 | | - }, |
686 | | - "outputs": [], |
687 | | - "source": [] |
688 | 686 | } |
689 | 687 | ], |
690 | 688 | "metadata": { |
|
0 commit comments