|
370 | 370 | "plt.show()" |
371 | 371 | ] |
372 | 372 | }, |
373 | | - { |
374 | | - "cell_type": "markdown", |
375 | | - "metadata": {}, |
376 | | - "source": [ |
377 | | - "What about our other features?\n", |
378 | | - "===\n", |
379 | | - "You may remember that our original dataset contains two additional features, the length and width of the petals.\n", |
380 | | - "\n", |
381 | | - "What does the plot look like when you train on the petal length and width? How does it change when you change the number of neighbors?\n", |
382 | | - "\n", |
383 | | - "How would you plot our two new plants, A and B, on these new plots? Assume we have all four measurements for each plant, as shown below.\n", |
384 | | - "\n", |
385 | | - "Plant | Sepal length | Sepal width| Petal length | Petal width\n", |
386 | | - "------|--------------|------------|--------------|------------\n", |
387 | | - "A |4.3 |2.5 | 1.5 | 0.5\n", |
388 | | - "B |6.3 |2.1 | 4.8 | 1.5\n", |
389 | | - "\n" |
390 | | - ] |
391 | | - }, |
392 | | - { |
393 | | - "cell_type": "code", |
394 | | - "execution_count": null, |
395 | | - "metadata": { |
396 | | - "collapsed": false |
397 | | - }, |
398 | | - "outputs": [], |
399 | | - "source": [ |
400 | | - "# Put your code here! \n", |
401 | | - "\n", |
402 | | - "# Feel free to add as many code cells as you need" |
403 | | - ] |
404 | | - }, |
405 | 373 | { |
406 | 374 | "cell_type": "markdown", |
407 | 375 | "metadata": {}, |
|
499 | 467 | "cell_type": "markdown", |
500 | 468 | "metadata": {}, |
501 | 469 | "source": [ |
502 | | - "Using more than two features\n", |
| 470 | + "Using More Than Two Features\n", |
503 | 471 | "===\n", |
504 | | - "Using two features is great for visualizing, but it's often not good for training a good classifier. Below, we will train a classifier using the 'distance' weighting method and all four features, and use that to predict plants A and B.\n", |
| 472 | + "You may remember that our original dataset contains two additional features, the length and width of the petals.\n", |
| 473 | + "\n", |
| 474 | + "What does the plot look like when you train on the petal length and width? How does it change when you change the number of neighbors?\n", |
505 | 475 | "\n", |
506 | | - "How do the predictions compare to our predictions using only two labels?" |
| 476 | + "Assume we have all four measurements for each plant, as shown below. We simply train the classifier using all four columns in the dataset, and then predict using all four columns for plants A and B.\n", |
| 477 | + "\n", |
| 478 | + "Plant | Sepal length | Sepal width| Petal length | Petal width\n", |
| 479 | + "------|--------------|------------|--------------|------------\n", |
| 480 | + "A |4.3 |2.5 | 1.5 | 0.5\n", |
| 481 | + "B |6.3 |2.1 | 4.8 | 1.5\n", |
| 482 | + "\n" |
507 | 483 | ] |
508 | 484 | }, |
509 | 485 | { |
|
0 commit comments