Posts

KNN algorithm simple explanation with code

Image
   KNN ALGORITHM K nearest neighbor   is a supervised machine learning algorithm that is non parametric(has no underlying assumptions). KNN is usually used for regression and classification (mostly used for classification) KNN is a lazy algorithm as it uses all the training data inorder   to classify new data points this may   lead to excessive use of computer memory. Although there are many clustering algorithm it is usually better to learn KNN first to provide a  basis for more complex algorithms.  KNN  can lead to overfitting  if a  small value is chosen for k and underfitting if a large value is used for k.  It is usually relevant to select an odd number for the value of k to reduce instances where some points are left out during clustering.  Dataset that has most outliers is usually classified welll if a large k value is chosen.  K is the neighbor to which distance is calculated from training data points to ...

R code for grading students using r shinny

  RCODE FOR GRADI N G STUDENTS   library(shiny) library(shinythemes)   ui<-fluidPage(theme=shinytheme("superhero"),     sidebarLayou t(       sidebarPanel(         titlePanel("ENTER YOUR GRADE"),   numericInput("num","MATH",value=0,min=0,max=100),   numericInput("num1","ENGLISH",value=1,min=0,max=100),   numericInput("num2","KISWAHILI",value=1,min=0,max=100),   numericInput("num3","SCIENCE",value=1,min=0,max=100),   numericInput("num4","CRE",value=1,min=0,max=100),   numericInput("num5","select no of units you took",value=1,min=1,max=80),   fileInput("fl","upload")   ),mainPanel(   titlePanel("Estimate your mean score"),     navbarPage(   tabPanel("dumm"),   tabPanel("How",tags$div(HTML("<i>Use the app by inputing marks you scored<br>  ...