public final class ExtraPredictorSpec
extends java.lang.Object
implements java.io.Serializable
PredictorType
and
ExpectedCorrelation
, to help the API test and rank regressions that
include data for that extra predictor.
These are held by the RegressionTestPlan
. There's some sample code in
the regression API docs on our website, and also there's some
additional practical information on specifying and using extra predictors in
the docs for our website regression tool (which itself uses the API
internally).
RegressionTestPlan.Builder.addExtraPredictorSpec(java.lang.String, net.degreedays.api.regression.ExtraPredictorSpec)
Instances of this class are immutable. You can safely reuse them and call them from multiple threads at once.
Constructor and Description |
---|
ExtraPredictorSpec(PredictorType predictorType,
ExpectedCorrelation expectedCorrelation)
Constructs an
ExtraPredictorSpec with the specified
PredictorType and ExpectedCorrelation . |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o)
Returns
true if o is an
ExtraPredictorSpec with the same predictorType()
and expectedCorrelation() as this . |
ExpectedCorrelation |
expectedCorrelation()
Returns the non-null
ExpectedCorrelation that defines how
the extra predictor is expected to correlate with energy usage. |
int |
hashCode()
Overridden to ensure consistency with
equals . |
PredictorType |
predictorType()
Returns the non-null
PredictorType that defines how the
extra predictor's figures vary with the length of the periods they are
measured over. |
java.lang.String |
toString()
Returns a non-null, non-empty string representation of this object for logging and debugging purposes.
|
public ExtraPredictorSpec(PredictorType predictorType, ExpectedCorrelation expectedCorrelation)
ExtraPredictorSpec
with the specified
PredictorType
and ExpectedCorrelation
.predictorType
- defines how the extra predictor's figures vary
with the length of the periods they are measured over. Cannot be
null
.expectedCorrelation
- defines how the extra predictor is expected to
correlate with energy usage. Cannot be null
.java.lang.NullPointerException
- if predictorType
or
expectedCorrelation
is null
.public PredictorType predictorType()
PredictorType
that defines how the
extra predictor's figures vary with the length of the periods they are
measured over.public ExpectedCorrelation expectedCorrelation()
ExpectedCorrelation
that defines how
the extra predictor is expected to correlate with energy usage.public boolean equals(java.lang.Object o)
true
if o
is an
ExtraPredictorSpec
with the same predictorType()
and expectedCorrelation()
as this
.equals
in class java.lang.Object
public int hashCode()
equals
.hashCode
in class java.lang.Object
public java.lang.String toString()
The exact details of the representation are unspecified and subject to change.
toString
in class java.lang.Object
See www.degreedays.net/api/ for more about the Degree Days.net API.
You can sign up for a Degree Days.net API account and read the integration guide that is useful and applicable whether you are using Java or not.