title: Reuse Saved Model (Maxent) to predict new input in R
body: <p>I am trying to recreate a learning from multiple sources and trying to build a model with maxent in R with my own data. I was able to train and test and validate the result from a data set.</p>
  
  <p>I have saved the trained model and am trying to predict with new input by loading the new model.</p>
  
  <p>Below is my training model code</p>
  
  <pre><code>#Load file
  cat = read.csv("Trainingdatafilepath")
  
  #Create Matrix
  
   matrix = create_matrix(cat[, 1], language = "english", removeStopwords = TRUE, 
                     removeNumbers = TRUE, stemWords = FALSE, tm::weightTfIdf)
  # Create Container
  
  container = create_container(matrix, as.numeric(as.factor(cat[, 2])), trainSize = 1:150, 
                           testSize = 151:300, virgin = FALSE)   #removeSparseTerms
  
  models = train_models(container, algorithms = c("MAXENT"))
  
  #Save Model
  
  Save(models, file="mymodel.rda")
  </code></pre>
  
  <p>I reload the model using following code:</p>
  
  <pre><code>#Load file
  cat = read.csv("Newinputfilepath")
  
  #Create Matrix
  
  matrix = create_matrix(cat[, 1], language = "english", removeStopwords = TRUE, removePunctuation = TRUE, stripWhitespace = TRUE, 
                     removeNumbers = TRUE, stemWords = FALSE, tm::weightTfIdf)
  
  
  # Create Container - New Input
  
  container = create_container(matrix, as.factor(cat[, 1]), testSize = 1:70, virgin = FALSE)  #removeSparseTerms
  
  
  load("mymodel.rda")
  
  #predict
  
  results = classify_models(container, models)    
  </code></pre>
  
  <p>Am I approaching this right? The results when validated are not to the expected levels, but that could be because of the input too. The recall score is less than 20%.</p>