I’d like your help…
So here’s my problem: at the beginning I had a CSV file with 3 columns as :
date, averageNumberPersonSick person, cityName.
My goal is to estimate the number of sick people in city x compared to the data of all the surrounding cities.
So I transform the data to have an integer instead of the name of the city as a string.
So for example the city “Paris” becomes 9, “Bordeaux” 8 etc …
and I want to estimate for “Bordeaux” only for example …
and i converted it into :
averageNumberPersonSick , cityName
because the following error appeared:
java.lang.NumberFormatException: For input string: “2007-05-04”
But that doesn’t solve my problem … because the result doesn’t seem relevant to me and false :
How can I (re)start to have a basis for work?
That’s my model conf :
MultiLayerConfiguration conf = new NeuralNetConfiguration.Builder()
.seed(12345)
.optimizationAlgo(OptimizationAlgorithm.STOCHASTIC_GRADIENT_DESCENT)
.weightInit(WeightInit.XAVIER)
.updater(new Nesterovs(0.005))
.gradientNormalization(GradientNormalization.ClipElementWiseAbsoluteValue)
.gradientNormalizationThreshold(0.5)
.list()
.setInputType(InputType.feedForward(numInputs)) // new input way
.layer(0, new DenseLayer.Builder()
// .nIn(numInputs)
.nOut(outputNum)
.weightInit(WeightInit.XAVIER)
.activation(Activation.RELU)
.build())
.layer(1, new OutputLayer.Builder(LossFunctions.LossFunction.NEGATIVELOGLIKELIHOOD)
.weightInit(WeightInit.XAVIER)
.activation(Activation.SOFTMAX)
// .nIn(numInputs) // revoir les couches hidden
.nOut(outputNum)
.build())
.build();
and that’s when i train & evaluate the model :
MultiLayerNetwork model = new MultiLayerNetwork(conf);
model.init();
model.setListeners(new ScoreIterationListener(500));
for(int i=0; i<300; i++ ) {
model.fit(trainIter);
}
//evaluate the model on the test set
System.out.println("Evaluation du model ... ");
Evaluation eval = new Evaluation(10);
while (testIter.hasNext()) {
DataSet t = testIter.next();
INDArray features = t.getFeatures();
INDArray labels = t.getLabels();
INDArray predicted = model.output(features, false);
eval.eval(labels, predicted);
}
System.out.println(eval.stats());
Thank u
PS : I’m just starting to use DL4J