Icon

4. knn classification

Simple Model Training KNN ClassificationThis workflow demonstrates how a K-nearest neighbors classifier is built and applied to new data. It also illustrates the use of KNIME'shiliting capabilities, which allow interactive views to be connected within the same workflow.Task Predict the whether the species has virus or not from demographic attributes of the west nile virus data set. Data ReadingRead the new file'westnilevirus.csv' created afterdata preprocessing. It contains:1. Trap Type2. Number of Mosquitoes3. Species4. Test Results Data PartitioningCreate two separate partitions ondata set1. training set (80%) 2. test set (20%). Train a ModelThis node builds a knn model. MostLearner nodes output a PMMLmodel (blue square output port). Score the ModelCompute a confusion matrixbetween real and predicted classvalues and calculate the relatedaccuracy measures. ROC Curve Evaluate predictions on basis ofROC Curve training set test set Reading westnilevirus.csvRandom drawing 80% upper port20% lower portBuild ROC for predictionsTarget Class = ResultMatch original vs. predicted Result valuesFile Reader Partitioning ROC Curve (local) K Nearest Neighbor Scorer Simple Model Training KNN ClassificationThis workflow demonstrates how a K-nearest neighbors classifier is built and applied to new data. It also illustrates the use of KNIME'shiliting capabilities, which allow interactive views to be connected within the same workflow.Task Predict the whether the species has virus or not from demographic attributes of the west nile virus data set. Data ReadingRead the new file'westnilevirus.csv' created afterdata preprocessing. It contains:1. Trap Type2. Number of Mosquitoes3. Species4. Test Results Data PartitioningCreate two separate partitions ondata set1. training set (80%) 2. test set (20%). Train a ModelThis node builds a knn model. MostLearner nodes output a PMMLmodel (blue square output port). Score the ModelCompute a confusion matrixbetween real and predicted classvalues and calculate the relatedaccuracy measures. ROC Curve Evaluate predictions on basis ofROC Curve training set test set Reading westnilevirus.csvRandom drawing 80% upper port20% lower portBuild ROC for predictionsTarget Class = ResultMatch original vs. predicted Result valuesFile Reader Partitioning ROC Curve (local) K Nearest Neighbor Scorer

Nodes

Extensions

Links