2
* Copyright (C) 2004-2007 The Chemistry Development Kit (CDK) project
4
* Contact: cdk-devel@lists.sourceforge.net
6
* This program is free software; you can redistribute it and/or
7
* modify it under the terms of the GNU Lesser General Public License
8
* as published by the Free Software Foundation; either version 2.1
9
* of the License, or (at your option) any later version.
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU Lesser General Public License for more details.
16
* You should have received a copy of the GNU Lesser General Public License
17
* along with this program; if not, write to the Free Software
18
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
21
package org.openscience.cdk.qsar.model.R;
24
/** A class that represents a summary of a CNN regression model.
26
* This class essentially wraps the result of summary.nnet. As with other
27
* backend classes this class should not be instantiated directly by the
28
* user, though the various fields may be accessed with the provided
31
* @author Rajarshi Guha
32
* @cdk.require r-project
36
public class CNNRegressionModelSummary {
39
boolean entropy, softmax, censored;
44
* Constructor for an object that wraps the return value from summary.lm.
46
* This should not be instantiated directly. The class is meant to be instantiated
49
* @param n A 3 element array containing the number of neurons in the
50
* input, hidden and output layer respectively
51
* @param entropy A boolean indicating whether the entropy setting was used
52
* @param softmax A boolean indicating whether the softmax setting was used
53
* @param censored A boolean indicating whether the censored setting was used
54
* @param value The final value of the convergenc criterion
55
* @param residuals A 1-dimensional array of residual values
57
public CNNRegressionModelSummary( int[] n, boolean entropy,
58
boolean softmax, boolean censored, double value,
62
this.residuals = new double[residuals.length];
63
for (int i = 0; i < residuals.length; i++)
64
this.residuals[i] = residuals[i];
66
this.n = new int[n.length];
67
for (int i = 0; i < n.length; i++)
70
this.softmax = softmax;
71
this.censored = censored;
72
this.entropy = entropy;
76
* Constructor for an object that wraps the return value from summary.lm.
78
* This should not be instantiated directly. The class is meant to be instantiated
81
* @param n A 3 element array containing the number of neurons in the
82
* input, hidden and output layer respectively
83
* @param entropy A boolean indicating whether the entropy setting was used
84
* @param softmax A boolean indicating whether the softmax setting was used
85
* @param censored A boolean indicating whether the censored setting was used
86
* @param value The final value of the convergenc criterion
87
* @param residuals A 1-dimensional array of residual values
89
public CNNRegressionModelSummary( double[] n, boolean entropy,
90
boolean softmax, boolean censored, double value,
94
this.residuals = new double[residuals.length];
95
for (int i = 0; i < residuals.length; i++)
96
this.residuals[i] = residuals[i];
98
this.n = new int[n.length];
99
for (int i = 0; i < n.length; i++)
100
this.n[i] = (int)n[i];
102
this.softmax = softmax;
103
this.censored = censored;
104
this.entropy = entropy;
110
* Return the residuals of the fit.
112
* @return A 1-dimensional array of doubles containing the
113
* residuals of the fit
115
public double[] getResiduals() {
116
return(this.residuals);
121
* Return the number of neurons in the CNN layers.
123
* This method returns a 3-element array containing the number
124
* of neurons in the input, hidden and output layer
127
* @return A 3-element int array
129
public int[] getNumNeurons() {
134
* Return the final value of the convergence criterion.
136
* @return The final value of the convergence criterion
138
public double getValue(){
143
* Return whether softmax was used.
145
* @return A boolean indicating whether softmax was used or not
147
public boolean getSoftmax() {
148
return(this.softmax);
151
* Return whether entropy was used.
153
* @return A boolean indicating whether entropy was used or not
155
public boolean getEntropy() {
156
return(this.entropy);
159
* Return whether censored was used.
161
* @return A boolean indicating whether censored was used or not
163
public boolean getCensored() {
164
return(this.censored);