This commit is contained in:
Jen Looper 2021-06-17 17:36:40 -04:00
Родитель 7c4f4eefe3
Коммит 61a4a61713
2 изменённых файлов: 48 добавлений и 40 удалений

Просмотреть файл

@ -85,12 +85,12 @@ Accuracy (train) for Linear SVC: 78.6%
weighted avg 0.79 0.79 0.79 1199
```
✅ Learn about linear SVC
✅ Learn about Linear SVC
Support-Vector clustering (SVC) is a child of the Support-Vector machines family of ML techniques (learn more about these below). In this method, you can choose a 'kernel' to decide how to cluster the labels. The 'C' parameter refers to 'regularization' which regulates the influence of parameters. The kernel can be one of [several](https://scikit-learn.org/stable/modules/generated/sklearn.svm.SVC.html#sklearn.svm.SVC); here we set it to 'linear' to ensure that we leverage linear SVC. Probability defaults to 'false'; here we set it to 'true' to gather probability estimates. We set the random state to '0' to shuffle the data to get probabilities.
## K-Neighbors classifier
The previous classifier was good, and worked well with the data, but maybe we can get better accuracy. Try a K-Neighbors classifer. Add a line to your classifier array (add a comma after the Linear SVC item):
The previous classifier was good, and worked well with the data, but maybe we can get better accuracy. Try a K-Neighbors classifier. Add a line to your classifier array (add a comma after the Linear SVC item):
```python
'KNN classifier': KNeighborsClassifier(C),

Просмотреть файл

@ -1251,49 +1251,53 @@
"title": "Classification 3: Pre-Lecture Quiz",
"quiz": [
{
"questionText": "q1",
"questionText": "A good initial classifier to try is:",
"answerOptions": [
{
"answerText": "a",
"isCorrect": "false"
},
{
"answerText": "b",
"answerText": "Linear SVC",
"isCorrect": "true"
},
{
"answerText": "c",
"answerText": "K-Means",
"isCorrect": "false"
},
{
"answerText": "Logical SVC",
"isCorrect": "false"
}
]
},
{
"questionText": "q2",
"questionText": "Regularization controls:",
"answerOptions": [
{
"answerText": "a",
"answerText": "the influence of parameters",
"isCorrect": "true"
},
{
"answerText": "b",
"answerText": "the influence of training speed",
"isCorrect": "false"
},
{
"answerText": "the influence of outliers",
"isCorrect": "false"
}
]
},
{
"questionText": "q3",
"questionText": "K-Neighbors classifier can be used for:",
"answerOptions": [
{
"answerText": "a",
"answerText": "supervised learning",
"isCorrect": "false"
},
{
"answerText": "b",
"answerText": "unsupervised learning",
"isCorrect": "false"
},
{
"answerText": "both of these",
"isCorrect": "true"
},
{
"answerText": "c",
"isCorrect": "false"
}
]
}
@ -1304,48 +1308,52 @@
"title": "Classification 3: Post-Lecture Quiz",
"quiz": [
{
"questionText": "q1",
"questionText": "Support-Vector classifiers can be used for",
"answerOptions": [
{
"answerText": "a",
"answerText": "classification",
"isCorrect": "false"
},
{
"answerText": "b",
"answerText": "regression",
"isCorrect": "false"
},
{
"answerText": "both of these",
"isCorrect": "true"
}
]
},
{
"questionText": "Random Forest is a ___ type of classifier",
"answerOptions": [
{
"answerText": "Ensemble",
"isCorrect": "true"
},
{
"answerText": "c",
"answerText": "Dissemble",
"isCorrect": "false"
},
{
"answerText": "Assemble",
"isCorrect": "false"
}
]
},
{
"questionText": "q2",
"questionText": "Adaboost is known for:",
"answerOptions": [
{
"answerText": "a",
"answerText": "focusing on the weights of incorrectly classified items",
"isCorrect": "true"
},
{
"answerText": "b",
"isCorrect": "false"
}
]
},
{
"questionText": "q3",
"answerOptions": [
{
"answerText": "a",
"answerText": "focusing on outliers",
"isCorrect": "false"
},
{
"answerText": "b",
"isCorrect": "true"
},
{
"answerText": "c",
"answerText": "focusing on incorrect data",
"isCorrect": "false"
}
]