Skip to content

Instantly share code, notes, and snippets.

<!---demo for traditional BOX MODEL layout styling---->
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>IEEE HTML5 training </title>
<link rel="stylesheet" href="layout.css"></link>
</head>
<body>
<div id="big_wrapper">
%train the model to get the value of K
function k = KNNtrain(pointDistance,t,point)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%{
Done using Octave
Input :
%%%%%%%%
pointDistance: distancePoints(point,point) where point is the input traning data
t: target of the training data
@ranianr
ranianr / KNNtestdata.m
Created January 18, 2014 17:13
this Octave function returns the Accuracy of KNN classifier to call it
function acc = KNNtestdata (trainpointDistance, trainPointsTarget, pointDistance,k, testPointsTarget,point)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%{
Done using Octave
Input :
%%%%%%%%
trainpointDistance: distancePoints(point,point) where point are the input training data dimensions
trainPointsTarget : target of training data