"The train-test split is stratified to ensure that the train and test samples from each class are almost the same percentage. This may be desirable for imbalanced number of samples as in this case. \n",
"\n",
"In such imbalanced datasets, the stratified K fold cross validation is used instead of the K-fold cross validation"
"C:\\Users\\60172\\AppData\\Local\\Packages\\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\\LocalCache\\local-packages\\Python311\\site-packages\\sklearn\\base.py:439: UserWarning: X does not have valid feature names, but KNeighborsClassifier was fitted with feature names\n",
The train-test split is stratified to ensure that the train and test samples from each class are almost the same percentage. This may be desirable for imbalanced number of samples as in this case.
In such imbalanced datasets, the stratified K fold cross validation is used instead of the K-fold cross validation
C:\Users\60172\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\sklearn\base.py:439: UserWarning: X does not have valid feature names, but KNeighborsClassifier was fitted with feature names
warnings.warn(
predicted marker
1 53
0 47
Name: count, dtype: int64
%% Cell type:markdown id: tags:
<h1> 7. Import to CSV file</h1>
%% Cell type:markdown id: tags:
Import to CSV (Marker Labels only)
%% Cell type:code id: tags:
``` python
y_testpred.to_csv('ShowingLabelsOnly.csv')
```
%% Cell type:markdown id: tags:
Import to CSV (marker column added to testing csv file)