Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 201867

Error Warning: Error in :: argument of length 0 in Shiny App for neuralnetwork analzye

$
0
0

This Syntax for server and i have error on this. i have problem on showing output to shiny app also

error found 99: renderPrint [C:\Users\TheBlackIZ\Documents\Simple
GUI\GUIfix/server.R#66] 98: func 82: origRenderFunc 81: output$hasil
1: runApp

library(shiny)
library(neuralnet)



# Define server logic required to draw a histogram
shinyServer(function(input, output,session) {

        # input$file1 will be NULL initially. After the user selects
        # and uploads a file, head of that data file by default,
        # or all rows if selected, will be shown.

    dInput <- reactive({
        in.file <- input$file1
        if (is.null(in.file)){
          return(NULL)

        }else
                data <- read.csv(input$file1$datapath,
                               header = input$header,
                               sep = input$sep,
                               quote = input$quote)


        if(input$disp == "head") {
            return(head(data))
        }
        else {
            return(data)
        }



      })
    output$contents <- renderTable({
      d.input <- dInput()

    })




    observeEvent(input$action,{
      dInput()
      nn<-reactive({
      f <- as.formula(paste(input$respon, "~ ."))
      set.seed(input$randseed)
      df <- data


      random <- sample(1:nrow(df), (input$train/100) * nrow(df))



      act.fct = input$activhid
      hidden = c(input$hidden)
      })

      # Prediction



      output$hasil<-renderPrint({
        fit=neuralnet(formula=nn()$f,data=nn()$df,act.fct = nn()$act.fct,
                      algorithm = "backprop",hidden = nn()$hidden,
                      err.fct = "sse",linear.output = "FALSE",learningrate = 0.05)
        output <- compute(fit, df[,-1])
        p1 <- output$net.result
        pred1 <- ifelse(p1>0.5, 1, 0)
        tabel <- table(pred1, training$y)

        print(fit)
        })

    })   
})

Viewing all articles
Browse latest Browse all 201867

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>