Package weka.classifiers.functions
Class SimpleLinearRegressionIntervalEstimator
- java.lang.Object
-
- weka.classifiers.AbstractClassifier
-
- weka.classifiers.functions.SimpleLinearRegressionWithAccess
-
- weka.classifiers.functions.SimpleLinearRegressionIntervalEstimator
-
- All Implemented Interfaces:
Serializable,Cloneable,weka.classifiers.Classifier,weka.classifiers.IntervalEstimator,weka.core.BatchPredictor,weka.core.CapabilitiesHandler,weka.core.CapabilitiesIgnorer,weka.core.CommandlineRunnable,weka.core.OptionHandler,weka.core.RevisionHandler,weka.core.WeightedInstancesHandler
public class SimpleLinearRegressionIntervalEstimator extends SimpleLinearRegressionWithAccess implements weka.classifiers.IntervalEstimator
Learns a simple linear regression model. Picks the attribute that results in the lowest squared error. Can only deal with numeric attributes.
Makes standard errors available.
Provides confidence intervals as well. For more information see:
http://stattrek.com/regression/slope-confidence-interval.aspx Valid options are:-additional-stats Output additional statistics.
-output-debug-info If set, classifier is run in debug mode and may output additional info to the console
-do-not-check-capabilities If set, classifier capabilities are not checked before classifier is built (use with caution).
- Version:
- $Revision$
- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class weka.classifiers.functions.SimpleLinearRegressionWithAccess
m_attribute, m_attributeIndex, m_classMeanForMissing, m_df, m_fstat, m_intercept, m_outputAdditionalStats, m_rsquared, m_rsquaredAdj, m_seIntercept, m_seSlope, m_slope, m_suppressErrorMessage, m_tstatIntercept, m_tstatSlope
-
-
Constructor Summary
Constructors Constructor Description SimpleLinearRegressionIntervalEstimator()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetRevision()Returns the revision string.StringglobalInfo()Returns a string describing this classifierstatic voidmain(String[] argv)Generates a linear regression function predictor.double[][]predictIntervals(weka.core.Instance inst, double confidenceLevel)Returns an N * 2 array, where N is the number of prediction intervals.-
Methods inherited from class weka.classifiers.functions.SimpleLinearRegressionWithAccess
buildClassifier, classifyInstance, foundUsefulAttribute, getAttributeIndex, getCapabilities, getIntercept, getInterceptSE, getOptions, getOutputAdditionalStats, getSlope, getSlopeSE, listOptions, outputAdditionalStatsTipText, setOptions, setOutputAdditionalStats, setSuppressErrorMessage, toString
-
Methods inherited from class weka.classifiers.AbstractClassifier
batchSizeTipText, debugTipText, distributionForInstance, distributionsForInstances, doNotCheckCapabilitiesTipText, forName, getBatchSize, getDebug, getDoNotCheckCapabilities, getNumDecimalPlaces, implementsMoreEfficientBatchPrediction, makeCopies, makeCopy, numDecimalPlacesTipText, postExecution, preExecution, run, runClassifier, setBatchSize, setDebug, setDoNotCheckCapabilities, setNumDecimalPlaces
-
-
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing this classifier- Overrides:
globalInfoin classSimpleLinearRegressionWithAccess- Returns:
- a description of the classifier suitable for displaying in the explorer/experimenter gui
-
predictIntervals
public double[][] predictIntervals(weka.core.Instance inst, double confidenceLevel) throws ExceptionReturns an N * 2 array, where N is the number of prediction intervals. In each row, the first element contains the lower boundary of the corresponding prediction interval and the second element the upper boundary.- Specified by:
predictIntervalsin interfaceweka.classifiers.IntervalEstimator- Parameters:
inst- the instance to make the prediction for.confidenceLevel- the percentage of cases that the interval should cover.- Returns:
- an array of prediction intervals
- Throws:
Exception- if the intervals can't be computed
-
getRevision
public String getRevision()
Returns the revision string.- Specified by:
getRevisionin interfaceweka.core.RevisionHandler- Overrides:
getRevisionin classSimpleLinearRegressionWithAccess- Returns:
- the revision
-
main
public static void main(String[] argv)
Generates a linear regression function predictor.- Parameters:
argv- the options
-
-