fix create_cd call in tutorial with tasks
Note: mandatory check (NEED_CHECK) was skipped
"outputs": [],
"source": [
"from catboost.utils import create_cd\n",
+ "feature_names = dict(list(enumerate(train_df.keys()[1:])))\n",
+ " \n",
"create_cd(\n",
" label=0,\n",
- " cat_features=list(range(1, train_df.columns.shape[0])),\n",
- " feature_names=dict(enumerate(train_df)),\n",
+ " cat_features=list(range(1, train_df.shape[1])),\n",
+ " feature_names=feature_names,\n",
" output_path=os.path.join(dataset_dir, 'train.cd')\n",
")"
]
"['RESOURCE', 'MGR_ID', 'ROLE_ROLLUP_1', 'ROLE_ROLLUP_2', 'ROLE_DEPTNAME', 'ROLE_TITLE', 'ROLE_FAMILY_DESC', 'ROLE_FAMILY', 'ROLE_CODE']\n",
"\n",
"dataset 2:\n",
- "['RESOURCE', 'MGR_ID', 'ROLE_ROLLUP_1', 'ROLE_ROLLUP_2', 'ROLE_DEPTNAME', 'ROLE_TITLE', 'ROLE_FAMILY_DESC', 'ROLE_FAMILY', 'ROLE_CODE']\n",
+ "['MGR_ID', 'ROLE_ROLLUP_1', 'ROLE_ROLLUP_2', 'ROLE_DEPTNAME', 'ROLE_TITLE', 'ROLE_FAMILY_DESC', 'ROLE_FAMILY', 'ROLE_CODE', '']\n",
"\n",
"dataset 3:\n",
"['RESOURCE', 'MGR_ID', 'ROLE_ROLLUP_1', 'ROLE_ROLLUP_2', 'ROLE_DEPTNAME', 'ROLE_TITLE', 'ROLE_FAMILY_DESC', 'ROLE_FAMILY', 'ROLE_CODE']\n",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
- "version": "2.7.15"
+ "version": "2.7.12"
},
"widgets": {
"state": {
