Homework Solution: ctes…

    1 Data gaussian2<-functionO 3 #example np 100 var-0.1 7 # two center points al 0.33 a20.5 b1 = 0.66 10 11 b2 = 0.5 12 # three classes 13 xal matrix(rnorm (np, al, var),nrow np,nco1-1) 14 xa2<-matrix(rnorm (np , a2, var) ,nrow-np , ncol=1) 15 xbl <- matrix(rnorm (np, bl, var) , nrow np,ncol-1) 16 xb2- matrix(rnorm(np, b2, var) ,nrow np,ncol-1) 17 18 #class label 19 ya-matrix(1,nrow=np , ncol=1) 20 21 22 data-rbind (cbind (xal, xa2,ya),cbind(xbl,xb2,ya-2)) 23 24 25 plot.new) 26 symbols (x-xal,y-xa2, circles-matrix(1,nrow-nrow (xal),ncol-1), inches-0.025, ann-F, bg-salmon, fg-NULL ,xlim-c(0, 1), ylim-c(0, 1)) 27 symbols (x xbl,y xb2, circles-matrix(1,nrow nrow(xb1),ncol-1), inches 0.025, ann-F, bg-lightskyblue, fg NULL, add TRUE) 28 box O 29 30 return (data) 31 32 # combine three data points # plot Having issues converting this to python, any help will be appreciated.
    1 Data gaussian2

    Expert Answer

     
    i have modified so far

    1 Postulates gaussian2<-functionO 3 #example np 100 var-0.1 7 # couple disposition points al 0.33 a20.5 b1 = 0.66 10 11 b2 = 0.5 12 # three classes 13 xal matrix(rnorm (np, al, var),nrow np,nco1-1) 14 xa2<-matrix(rnorm (np , a2, var) ,nrow-np , ncol=1) 15 xbl <- matrix(rnorm (np, bl, var) , nrow np,ncol-1) 16 xb2- matrix(rnorm(np, b2, var) ,nrow np,ncol-1) 17 18 #class letter 19 ya-matrix(1,nrow=np , ncol=1) 20 21 22 postulates-rbind (cbind (xal, xa2,ya),cbind(xbl,xb2,ya-2)) 23 24 25 concoct.new) 26 symbols (x-xal,y-xa2, circles-matrix(1,nrow-nrow (xal),ncol-1), inches-0.025, ann-F, bg-salmon, fg-NULL ,xlim-c(0, 1), ylim-c(0, 1)) 27 symbols (x xbl,y xb2, circles-matrix(1,nrow nrow(xb1),ncol-1), inches 0.025, ann-F, bg-lightskyblue, fg NULL, supplement TRUE) 28 buffet O 29 30 come-back (data) 31 32 # combine three postulates points # concoct

    Having issues converting this to python, any succor obtain be appreciated.

    1 Postulates gaussian2

    Expert Counterpart

     

    i bear mitigated so far