Type: Red Dwarf, Brown Dwarf, White Dwarf, Main Sequence, Supergiants, Hypergiants used as the target.
Note that neural networks work with numbers.
In this regard, the categorical variable "class" is transformed into three numerical variables as follows:
Red Dwarf: 1 0 0 0 0 0.
Brown Dwarf: 0 1 0 0 0 0.
White Dwarf: 0 0 1 0 0 0.
Main Sequence: 0 0 0 1 0 0.
Supergiants: 0 0 0 0 1 0.
Hypergiants: 0 0 0 0 0 1.
The instances are divided into training, selection, and testing subsets.
They represent 60% (144), 20% (48), and 20% (48) of the original instances, respectively, and are split at random.
We can calculate the distributions of all variables.
The next figure is the pie chart for the star types.
As we can see, the target is well-distributed.
3. Neural network
The second step is to choose a neural network.
For classification problems, it is usually composed by:
A scaling layer.
Two perceptron layers.
A probabilistic layer.
The scaling layer contains the statistics on the inputs calculated from the data file and the method for scaling the input variables.
Here the minimum and maximum method has been set.
Nevertheless, the mean and standard deviation method would produce very similar results.
The number of perceptron layers is 1. This perceptron layer has 22 inputs and 6 neurons.
The following chart shows how the training and selection errors decrease with the epochs during the training process.
The final values are training error = 0.0912 NSE (blue), and selection error = 0.0735 NSE (orange).
5. Model selection
The objective of model selection is to find the network architecture with the best generalization properties,
that is, that which minimizes the error on the selected instances of the data set.
Order selection algorithms train several network architectures with a different number of neurons
and select that with the smallest selection error.
The incremental order method starts with a small number of neurons and increases the complexity at each iteration.
6. Testing analysis
The purpose of the testing analysis is to validate the generalization performance of the model.
Here we compare the neural network outputs to the corresponding targets in the testing instances of the data set.
In the confusion matrix, the rows represent the targets (or real values) and the columns the corresponding outputs (or predictive values).
The diagonal cells show the cases that are correctly classified, and the off-diagonal cells show the misclassified cases.
Predicted Red Dwarf
Predicted Brown Dwarf
Predicted White Dwarf
Predicted Main Sequence
Real Red Dwarf
Real Brown Dwarf
Real White Dwarf
Real Main Sequence
As we can see, the number of instances that the model can correctly predict is 48 (100%) so there is no misclassified cases .
This shows that our predictive model has a great classification accuracy.
7. Model deployment
The neural network is now ready to predict outputs for inputs that it has never seen.
This process is called model deployment.
To classify a given star, we calculate the neural network outputs from the differents variables: temperature, luminosity, relative radius, absolute magnitude, color and spectral class.
Temperature: 10497.5 K.
L (L/L_0): 107188.
R (R/R_0): 237.2.
Probability of Red Dwarf: 1.3 %.
Probability of Brown Dwarf: 81.1 %.
Probability of White Dwarf: 0.2 %.
Probability of Main Sequence: 7.3 %.
Probability of Supergiants: 8.2 %.
Probability of Hypergiants: 1.9 %.
For this particular case, the neural network would classify the star as Brown Dwarf, since it has the highest probability.