hardlim returns 0.5 and 1 !!

I have a binarry classification problem with 0-1 classes. I used 3layered neural network with "hardlim" as the activation function of output layer and "tansig" for hidden and input layer. I am wonderfull why my predicted output contains 0.5 and 1 instead of 0-1 !!
Does MATLAB automatically normalizes data when we use it's standard function for NN? Or I should manually normalize data?

5 Commenti

Greg Heath
Greg Heath il 27 Mar 2019
Modificato: Greg Heath il 27 Mar 2019
Woefully insufficient information.
How many hidden layers??
% One is ALWAYS sufficient but may not be practical
Greg
Morteza
Morteza il 28 Mar 2019
My network contains 3 layers:
1-one input layer (with 25 neurons) and tansigfunction.
2-one hidden layer (with 13 neurons) and tansigfunction.
3- one output layer (just one neuron). Activation function hardlim
My data set has about 44000 samples, 25 features, all data are non-negative. one output is 0-1 (binary). I used MATLAB nftool with advanced script tool. Also "trainlm" as training algorithm. However, the output layer is hardlim, but my estimated outputs are 0.5 and 1 instead of 0 and 1.
Morteza
Morteza il 26 Apr 2019
Any suggestion?
Hugo Fournier
Hugo Fournier il 24 Feb 2020
Same problem here. Have you found a solution?
Morteza
Morteza il 25 Feb 2020
Unfortunately No. We can replace 0.5 by 0.

Accedi per commentare.

 Risposta accettata

Garrett Beard
Garrett Beard il 3 Dic 2021

0 voti

'net variable'.output.processFcns = {}
By default, the neural network class applies mapminmax to the output vector. Remove the normalization and you will get [0, 1] for outputs.

Più risposte (0)

Categorie

Scopri di più su Deep Learning Toolbox in Centro assistenza e File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by