org.knime.base.node.mine.regression.logistic.learner
Class LogisticRegressionContent

java.lang.Object
  extended by org.knime.base.node.mine.regression.logistic.learner.LogisticRegressionContent

public final class LogisticRegressionContent
extends Object

Utility class that stores results of logistic regression models. It is used by the learner node model and the predictor node model.

Author:
Heiko Hofer

Constructor Summary
LogisticRegressionContent(PMMLPortObjectSpec outSpec, List<String> factorList, List<String> covariateList, Matrix beta, double loglike, Matrix covMat, int iter)
          Create new instance.
 
Method Summary
 PMMLGeneralRegressionContent createGeneralRegressionContent()
          Creates a new PMML General Regression Content from this logistic regression model.
 BufferedDataTable createTablePortObject(ExecutionContext exec)
          Creates a BufferedDataTable with the
 Map<String,Double> getCoefficients(DataCell logit)
          Returns the parameters mapped to the coefficients for the given logit.
 double getEstimatedLikelihood()
           
 double getIntercept(DataCell logit)
          Returns the value of the intercept for the given logit.
 double getInterceptPValue(DataCell logit)
          Returns the value of the intercept's p-value.
 double getInterceptStdErr(DataCell logit)
          Returns the value of the intercept's standard error for the given logit.
 double getInterceptZScore(DataCell logit)
          Returns the value of the intercept's z-score for the given logit.
 int getIterationCount()
           
 List<DataCell> getLogits()
          Logits are elements of the target domain values except of the last one.
 List<String> getParameters()
          Returns the parameters.
 Map<String,Double> getPValues(DataCell logit)
          Returns the parameters mapped to the p-value for the given logit.
 PMMLPortObjectSpec getSpec()
          Returns the spec of the output.
 Map<String,Double> getStandardErrors(DataCell logit)
          Returns the parameters mapped to the standard error for the given logit.
 Map<String,Double> getZScores(DataCell logit)
          Returns the parameters mapped to the z-score for the given logit.
(package private) static LogisticRegressionContent load(ModelContentRO parContent, DataTableSpec spec)
           
(package private)  void save(ModelContentWO parContent)
          Save internals to the given content.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LogisticRegressionContent

LogisticRegressionContent(PMMLPortObjectSpec outSpec,
                          List<String> factorList,
                          List<String> covariateList,
                          Matrix beta,
                          double loglike,
                          Matrix covMat,
                          int iter)
Create new instance.

Parameters:
outSpec - the spec of the output
factorList - the factors (nominla parameters)
covariateList - the covariates (numeric parameters)
beta - the estimated regression factors
loglike - the estimated likelihood
covMat - the covariance matrix
iter - the number of iterations
Method Detail

getEstimatedLikelihood

public double getEstimatedLikelihood()
Returns:
the likelihood

getIterationCount

public int getIterationCount()
Returns:
the number of irls iterations

getLogits

public List<DataCell> getLogits()
Logits are elements of the target domain values except of the last one.

Returns:
the logits

getParameters

public List<String> getParameters()
Returns the parameters. The follow the notation rule: - for covariate (numeric learning column): "column_name" - for factors (nominal learning columns) there are n-1 entries when n is the number of domain values: "column_name=domain_value"

Returns:
the parameters

getCoefficients

public Map<String,Double> getCoefficients(DataCell logit)
Returns the parameters mapped to the coefficients for the given logit.

Parameters:
logit - the logit
Returns:
the variables mapped to the coefficients

getStandardErrors

public Map<String,Double> getStandardErrors(DataCell logit)
Returns the parameters mapped to the standard error for the given logit.

Parameters:
logit - the logit
Returns:
the parameters mapped to the standard error

getZScores

public Map<String,Double> getZScores(DataCell logit)
Returns the parameters mapped to the z-score for the given logit.

Parameters:
logit - the logit
Returns:
the parameters mapped to the z-score

getPValues

public Map<String,Double> getPValues(DataCell logit)
Returns the parameters mapped to the p-value for the given logit.

Parameters:
logit - the logit
Returns:
the parameters mapped to the p-value

getIntercept

public double getIntercept(DataCell logit)
Returns the value of the intercept for the given logit.

Parameters:
logit - the logit
Returns:
the value of the intercept

getInterceptStdErr

public double getInterceptStdErr(DataCell logit)
Returns the value of the intercept's standard error for the given logit.

Parameters:
logit - the logit
Returns:
the value of the intercept's standard error

getInterceptZScore

public double getInterceptZScore(DataCell logit)
Returns the value of the intercept's z-score for the given logit.

Parameters:
logit - the logit
Returns:
the value of the intercept's z-score

getInterceptPValue

public double getInterceptPValue(DataCell logit)
Returns the value of the intercept's p-value.

Parameters:
logit - the logit
Returns:
the value of the intercept's p-value

createTablePortObject

public BufferedDataTable createTablePortObject(ExecutionContext exec)
Creates a BufferedDataTable with the

Parameters:
exec - The execution context
Returns:
a port object

createGeneralRegressionContent

public PMMLGeneralRegressionContent createGeneralRegressionContent()
Creates a new PMML General Regression Content from this logistic regression model.

Returns:
the PMMLGeneralRegressionContent

load

static LogisticRegressionContent load(ModelContentRO parContent,
                                      DataTableSpec spec)
                               throws InvalidSettingsException
Parameters:
parContent - the content that holds the internals
spec - the data table spec of the training data
Returns:
a instance with he loaded values
Throws:
InvalidSettingsException - when data are not well formed

save

void save(ModelContentWO parContent)
Save internals to the given content.

Parameters:
parContent - the content used as a storage

getSpec

public PMMLPortObjectSpec getSpec()
Returns the spec of the output.

Returns:
spec of the output


Copyright, 2003 - 2012. All rights reserved.
University of Konstanz, Germany.
Chair for Bioinformatics and Information Mining, Prof. Dr. Michael R. Berthold.
You may not modify, publish, transmit, transfer or sell, reproduce, create derivative works from, distribute, perform, display, or in any way exploit any of the content, in whole or in part, except as otherwise expressly permitted in writing by the copyright owner or as specified in the license file distributed with this product.