Try it
<script> package com.mycompany.mavenproject2; import java.util.logging.Level; import java.util.logging.Logger; import weka.classifiers.Classifier; import weka.classifiers.evaluation.Evaluation; import weka.classifiers.functions.MultilayerPerceptron; import weka.core.Instances; import weka.core.Instance; import weka.core.SerializationHelper; import weka.core.converters.ConverterUtils.DataSource; import java.util.ArrayList; import weka.core.Attribute; import weka.core.DenseInstance; import weka.filters.Filter; import weka.filters.unsupervised.attribute.Normalize; String rootPath="/Users/athan/Desktop/WP"; Classifier cls = (Classifier) weka.core.SerializationHelper.read(rootPath+"model1.model"); Instances originalTrain= //load or create Instances to predict int s1=0; double value=cls.classifyInstance(originalTrain.instance(s1)); String prediction=originalTrain.classAttribute().value((int)value); System.out.println("The predicted value of instance "+ Integer.toString(s1)+ ": "+prediction); function myFunction() { Instance inst = new DenseInstance(3); var at1 = document.getElementById("att1").value; var at2 = document.getElementById("att2").value; var at3 = document.getElementById("att3").value; var at4 = document.getElementById("att4").value; var at5 = document.getElementById("att5").value; var at6 = document.getElementById("att6").value; var at7 = document.getElementById("att7").value; var at8 = document.getElementById("att8").value; } </script>Having trouble with Pages? Check out our documentation or contact support and we’ll help you sort it out.