class Scorecard extends Model with HasWrappedScorecardAttributes
A data mining model contains a set of input fields which are used to predict a certain target value. This prediction can be seen as an assessment about a prospect, a customer, or a scenario for which an outcome is predicted based on historical data. In a scorecard, input fields, also referred to as characteristics (for example, "age"), are broken down into attributes (for example, "19-29" and "30-39" age groups or ranges) with specific partial scores associated with them. These scores represent the influence of the input attributes on the target and are readily available for inspection. Partial scores are then summed up so that an overall score can be obtained for the target value.
Scorecards are very popular in the financial industry for their interpretability and ease of implementation, and because input attributes can be mapped to a series of reason codes which provide explanations of each individual's score. Usually, the lower the overall score produced by a scorecard, the higher the chances of it triggering an adverse decision, which usually involves the referral or denial of services. Reason codes, as the name suggests, allow for an explanation of scorecard behavior and any adverse decisions generated as a consequence of the overall score. They basically answer the question: "Why is the score low, given its input conditions?"
- Alphabetic
- By Inheritance
- Scorecard
- HasWrappedScorecardAttributes
- HasScorecardAttributes
- Model
- PmmlElement
- Serializable
- HasExtensions
- HasModelVerification
- Predictable
- HasTargetFields
- ModelLocation
- FieldScope
- HasField
- HasLocalTransformations
- HasTargets
- HasModelExplanation
- HasModelStats
- HasOutput
- HasMiningSchema
- HasWrappedModelAttributes
- HasModelAttributes
- HasVersion
- HasParent
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new Scorecard(parent: Model, attributes: ScorecardAttributes, miningSchema: MiningSchema, characteristics: Characteristics, output: Option[Output] = None, targets: Option[Targets] = None, localTransformations: Option[LocalTransformations] = None, modelStats: Option[ModelStats] = None, modelExplanation: Option[ModelExplanation] = None, modelVerification: Option[ModelVerification] = None, extensions: Seq[Extension] = immutable.Seq.empty)
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- val NullOutputsPair: (Series, ModelOutputs)
- Attributes
- protected
- Definition Classes
- Model
- def algorithmName: Option[String]
The algorithm name is free-type and can be any description for the specific algorithm that produced the model.
The algorithm name is free-type and can be any description for the specific algorithm that produced the model. This attribute is for information only.
- Definition Classes
- HasWrappedModelAttributes → HasModelAttributes
- def anyMissing(series: Series): Boolean
Returns true if there are any missing values of all input fields in the specified series.
Returns true if there are any missing values of all input fields in the specified series.
- Attributes
- protected
- Definition Classes
- Model
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- val attributes: ScorecardAttributes
Common attributes of this model
Common attributes of this model
- Definition Classes
- Scorecard → HasWrappedScorecardAttributes → HasWrappedModelAttributes
- def baselineMethod: BaselineMethod
An informational string describing the technique used by the model designer to establish the baseline scores.
An informational string describing the technique used by the model designer to establish the baseline scores.
- Definition Classes
- HasWrappedScorecardAttributes → HasScorecardAttributes
- def baselineScore: Option[Double]
A single value to use as the baseline comparison score for all characteristics, when determining reason code ranking.
A single value to use as the baseline comparison score for all characteristics, when determining reason code ranking. Alternatively, unique baseline scores may be set for each individual Characteristic as shown below. This attribute is required only when useReasonCodes is "true" and attribute baselineScore is not given for each Characteristic.
- Definition Classes
- HasWrappedScorecardAttributes → HasScorecardAttributes
- def candidateOutputFields: Array[OutputField]
- Definition Classes
- HasOutput
- def candidateOutputSchema: StructType
The schema of candidate outputs.
The schema of candidate outputs.
- Definition Classes
- Model
- val characteristics: Characteristics
- def classes(name: String): Array[DataVal]
Returns class labels of the specified target.
Returns class labels of the specified target.
- Definition Classes
- Model
- lazy val classes: Array[DataVal]
The class labels in a classification model.
The class labels in a classification model.
- Definition Classes
- Model
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @IntrinsicCandidate() @native()
- def combineOutputFields(listA: Array[OutputField], listB: Array[OutputField]): Array[OutputField]
- Definition Classes
- HasOutput
- def containInterResults: Boolean
- Definition Classes
- HasOutput
- def createOutputs(): ScorecardOutput
Creates an object of subclass of ModelOutputs that is for writing into an output series.
- val customOutputFields: Array[OutputField]
User-defined custom output fields, both the internal output of PMML and predefined output are ignored when the field is specified.
User-defined custom output fields, both the internal output of PMML and predefined output are ignored when the field is specified.
- Definition Classes
- HasOutput
- def dVersion: Double
Returns PMML version as a double value
Returns PMML version as a double value
- Definition Classes
- HasVersion
- def dataDictionary: DataDictionary
The data dictionary of this model.
The data dictionary of this model.
- Definition Classes
- Model
- lazy val defaultOutputFields: Array[OutputField]
Returns all candidates output fields of this model when there is no output specified explicitly.
- def encode(series: Series): DSeries
Encodes the input series.
Encodes the input series.
- Attributes
- protected
- Definition Classes
- Model
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- val extensions: Seq[Extension]
- Definition Classes
- Scorecard → HasExtensions
- def field(name: String): Field
Returns the field of a given name.
Returns the field of a given name.
- Definition Classes
- HasField
- Exceptions thrown
FieldNotFoundExceptionif a field with the given name does not exist
- def fieldsOfUsageType(typ: UsageType): Array[Field]
Get fields by its usage type: 'active', 'target', 'predicted', 'group' and so on
Get fields by its usage type: 'active', 'target', 'predicted', 'group' and so on
- Definition Classes
- Model
- def functionName: MiningFunction
Describe the kind of mining model, e.g., whether it is intended to be used for clustering or for classification.
Describe the kind of mining model, e.g., whether it is intended to be used for clustering or for classification.
- Definition Classes
- HasWrappedModelAttributes → HasModelAttributes
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @IntrinsicCandidate() @native()
- def getField(name: String): Option[Field]
Returns the field of a given name, None if a field with the given name does not exist.
- def hasExtensions: Boolean
- Definition Classes
- HasExtensions
- def hasTarget: Boolean
- Definition Classes
- HasTargetFields
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @IntrinsicCandidate() @native()
- def header: Header
The header of this model.
The header of this model.
- Definition Classes
- Model
- lazy val implicitInputDerivedFields: Array[Field]
Implicit referenced derived fields for the sub-model except ones defined in the mining schema.
Implicit referenced derived fields for the sub-model except ones defined in the mining schema.
- Definition Classes
- Model
- def importances: Map[String, Double]
Returns importances of predictors.
Returns importances of predictors.
- Definition Classes
- Model
- def inferClasses: Array[DataVal]
The sub-classes can override this method to provide classes of target inside model.
The sub-classes can override this method to provide classes of target inside model.
- Definition Classes
- Model
- def initialScore: Double
Initial score contains a value which is added to the overall score whenever partial scores are summed up.
Initial score contains a value which is added to the overall score whenever partial scores are summed up.
- Definition Classes
- HasWrappedScorecardAttributes → HasScorecardAttributes
- lazy val inputDerivedFields: Array[Field]
Referenced derived fields.
Referenced derived fields.
- Definition Classes
- Model
- lazy val inputFields: Array[Field]
All input fields in an array.
All input fields in an array.
- Definition Classes
- Model
- lazy val inputNames: Array[String]
All input names in an array.
All input names in an array.
- Definition Classes
- Model
- lazy val inputSchema: StructType
The schema of inputs.
The schema of inputs.
- Definition Classes
- Model
- def isAssociationRules: Boolean
Tests if this is a association rules model.
Tests if this is a association rules model.
- Definition Classes
- HasModelAttributes
- def isBinary: Boolean
Tests if the target is a binary field
Tests if the target is a binary field
- Definition Classes
- Model
- def isClassification(name: String): Boolean
Tests if this is a classification model of the specified target, it's applicable for multiple targets.
Tests if this is a classification model of the specified target, it's applicable for multiple targets.
- Definition Classes
- Model
- def isClassification: Boolean
Tests if this is a classification model.
Tests if this is a classification model.
- Definition Classes
- Model → HasModelAttributes
- def isClustering: Boolean
Tests if this is a clustering model.
Tests if this is a clustering model.
- Definition Classes
- HasModelAttributes
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def isMixed: Boolean
Tests if this is a mixed model.
Tests if this is a mixed model.
- Definition Classes
- HasModelAttributes
- def isOrdinal: Boolean
Tests if the target is an ordinal field
Tests if the target is an ordinal field
- Definition Classes
- Model
- def isPredictionOnly: Boolean
- Definition Classes
- HasOutput
- def isRegression(name: String): Boolean
Tests if this is a regression model of the specified target, it's applicable for multiple targets.
Tests if this is a regression model of the specified target, it's applicable for multiple targets.
- Definition Classes
- Model
- def isRegression: Boolean
Tests if this is a regression model.
Tests if this is a regression model.
- Definition Classes
- Model → HasModelAttributes
- def isScorable: Boolean
Indicates if the model is valid for scoring.
Indicates if the model is valid for scoring. If this attribute is true or if it is missing, then the model should be processed normally. However, if the attribute is false, then the model producer has indicated that this model is intended for information purposes only and should not be used to generate results.
- Definition Classes
- HasWrappedModelAttributes → HasModelAttributes
- def isSequences: Boolean
Tests if this is a sequences model.
Tests if this is a sequences model.
- Definition Classes
- HasModelAttributes
- val isSubModel: Boolean
- Definition Classes
- ModelLocation
- def isTimeSeries: Boolean
Tests if this is a time series model.
Tests if this is a time series model.
- Definition Classes
- HasModelAttributes
- val isTopLevelModel: Boolean
- Definition Classes
- ModelLocation
- val localTransformations: Option[LocalTransformations]
The optional local transformations.
The optional local transformations.
- Definition Classes
- Scorecard → HasLocalTransformations
- val miningSchema: MiningSchema
- Definition Classes
- Scorecard → HasMiningSchema
- def modelElement: ModelElement
Model element type.
- val modelExplanation: Option[ModelExplanation]
- Definition Classes
- Scorecard → HasModelExplanation
- def modelName: Option[String]
Identifies the model with a unique name in the context of the PMML file.
Identifies the model with a unique name in the context of the PMML file. This attribute is not required. Consumers of PMML models are free to manage the names of the models at their discretion.
- Definition Classes
- HasWrappedModelAttributes → HasModelAttributes
- val modelStats: Option[ModelStats]
- Definition Classes
- Scorecard → HasModelStats
- val modelVerification: Option[ModelVerification]
- Definition Classes
- Scorecard → HasModelVerification
- def multiTargets: Boolean
- Definition Classes
- HasTargetFields
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @IntrinsicCandidate() @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @IntrinsicCandidate() @native()
- lazy val nullSeries: Series
A series with all null values is returned when can not produce a result.
A series with all null values is returned when can not produce a result.
- Definition Classes
- Model
- def numClasses(name: String): Int
Returns the number of class labels of the specified target.
Returns the number of class labels of the specified target.
- Definition Classes
- Model
- lazy val numClasses: Int
The number of class labels in a classification model.
The number of class labels in a classification model.
- Definition Classes
- Model
- def opType(name: String): OpType
Returns optype of the specified target.
Returns optype of the specified target.
- Definition Classes
- Model
- lazy val opType: OpType
When Target specifies optype then it overrides the optype attribute in a corresponding MiningField, if it exists.
When Target specifies optype then it overrides the optype attribute in a corresponding MiningField, if it exists. If the target does not specify optype then the MiningField is used as default. And, in turn, if the MiningField does not specify an optype, it is taken from the corresponding DataField. In other words, a MiningField overrides a DataField, and a Target overrides a MiningField.
- Definition Classes
- Model
- val output: Option[Output]
- def outputFields: Array[OutputField]
- Definition Classes
- HasOutput
- def outputIndex(feature: ResultFeature, value: Option[Any] = None): Int
- Definition Classes
- HasOutput
- def outputNames: Array[String]
- Definition Classes
- HasOutput
- def outputSchema: StructType
The schema of final outputs.
The schema of final outputs.
- Definition Classes
- Model
- var parent: Model
The parent model.
- def postClassification(name: String = null): (DataVal, Map[DataVal, Double])
- Attributes
- protected
- Definition Classes
- Model
- def postPredictedValue(outputs: MutablePredictedValue, name: String = null): MutablePredictedValue
- Attributes
- protected
- Definition Classes
- Model
- def postRegression(predictedValue: DataVal, name: String = null): DataVal
- Attributes
- protected
- Definition Classes
- Model
- def predict(values: Series): Series
The scoring procedure for a scorecard is simple.
The scoring procedure for a scorecard is simple. Partial scores are summed up to create an overall score, the result of the scorecard.
- values
An input data series
- returns
An output data series
- Definition Classes
- Scorecard → Model → Predictable
- def predict(it: Iterator[Series]): Iterator[Series]
- Definition Classes
- Model
- def predict(json: String): String
Predicts one or multiple records in json format, there are two formats supported:
Predicts one or multiple records in json format, there are two formats supported:
- ‘records’ : list like [{column -> value}, … , {column -> value}] - ‘split’ : dict like {‘columns’ -> [columns], ‘data’ -> [values]}
- json
Records in json
- returns
Results in json
- Definition Classes
- Model
- def predict(values: List[Any]): List[Any]
- Definition Classes
- Model
- def predict[T](values: Array[T]): Array[Any]
Predicts values for a given Array, and the order of those values is supposed as same as the input fields list
Predicts values for a given Array, and the order of those values is supposed as same as the input fields list
- Definition Classes
- Model
- def predict(values: (String, Any)*): Seq[(String, Any)]
Predicts values for a given list of key/value pairs.
Predicts values for a given list of key/value pairs.
- Definition Classes
- Model
- def predict(values: Map[String, Any]): Map[String, Any]
Predicts values for a given data map of Java.
Predicts values for a given data map of Java.
- Definition Classes
- Model
- def predict(values: Map[String, Any]): Map[String, Any]
Predicts values for a given data map.
Predicts values for a given data map.
- Definition Classes
- Model
- lazy val predictedValueIndex: Int
- Definition Classes
- HasOutput
- def prepare(series: Series): (Series, Boolean)
Pre-process the input series.
Pre-process the input series.
- Attributes
- protected
- Definition Classes
- Model
- def probabilitiesSupported: Boolean
Tests if probabilities of categories of target can be produced by this model.
Tests if probabilities of categories of target can be produced by this model.
- Definition Classes
- Model
- def reasonCodeAlgorithm: ReasonCodeAlgorithm
May be "pointsAbove" or "pointsBelow", describing how reason codes shall be ranked, relative to the baseline score of each Characteristic, or as set at the top-level scorecard.
May be "pointsAbove" or "pointsBelow", describing how reason codes shall be ranked, relative to the baseline score of each Characteristic, or as set at the top-level scorecard.
- Definition Classes
- HasWrappedScorecardAttributes → HasScorecardAttributes
- val reasonCodes: SortedSet[Option[String]]
Collected all reason codes with order that appears in the PMML file, from top to bottom.
- def result(series: Series, modelOutputs: ModelOutputs, fields: Array[OutputField] = Array.empty): Series
- Attributes
- protected
- Definition Classes
- Model
- def score(values: Series, modelOutputs: Option[ModelOutputs] = None): (Series, ModelOutputs)
Predicts value for a given data series
Predicts value for a given data series
- values
An input data series
- modelOutputs
An input model outputs that can hold all results, it will be ignored if its type doesn't match the current model.
- returns
An object of model outputs
- Definition Classes
- Model
- def setOutputFields(outputFields: Array[OutputField]): Scorecard.this.type
- Definition Classes
- HasOutput
- def setParent(parent: Model): Scorecard.this.type
- Definition Classes
- HasParent
- def setSupplementOutput(value: Boolean): Scorecard.this.type
- Definition Classes
- HasOutput
- def singleTarget: Boolean
- Definition Classes
- HasTargetFields
- def size: Int
- Definition Classes
- HasTargetFields
- val supplementOutput: Boolean
A flag for whether to return those predefined output fields not exist in the output element explicitly.
A flag for whether to return those predefined output fields not exist in the output element explicitly.
- Definition Classes
- HasOutput
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- lazy val targetClasses: Map[String, Array[DataVal]]
The class labels of all categorical targets.
The class labels of all categorical targets.
- Definition Classes
- Model
- lazy val targetField: Field
The first target field for the supervised model.
The first target field for the supervised model.
- Definition Classes
- Model
- lazy val targetFields: Array[Field]
All target fields in an array.
All target fields in an array. Multiple target fields are allowed. It depends on the kind of the model whether prediction of multiple fields is supported.
- Definition Classes
- Model
- def targetFieldsOfResidual: Array[Field]
Returns targets that are residual values to be computed, the input data must include target values.
Returns targets that are residual values to be computed, the input data must include target values.
- Definition Classes
- HasOutput
- def targetName: String
Name of the first target for the supervised model.
Name of the first target for the supervised model.
- Definition Classes
- HasTargetFields
- lazy val targetNames: Array[String]
All target names in an array.
All target names in an array.
- Definition Classes
- Model → HasTargetFields
- def targetNamesOfResidual: Array[String]
- Definition Classes
- HasOutput
- val targets: Option[Targets]
- Definition Classes
- Scorecard → HasTargets
- def toString(): String
- Definition Classes
- AnyRef → Any
- def transformationDictionary: Option[TransformationDictionary]
The optional transformation dictionary.
The optional transformation dictionary.
- Definition Classes
- Model
- def unionCandidateOutputFields: Array[OutputField]
- Definition Classes
- HasOutput
- def unionOutputFields: Array[OutputField]
- Definition Classes
- HasOutput
- def useReasonCodes: Boolean
If "false", reason codes are not computed as part of the scorecard.
If "false", reason codes are not computed as part of the scorecard.
- Definition Classes
- HasWrappedScorecardAttributes → HasScorecardAttributes
- lazy val usedFields: Array[Field]
Setup indices to retrieve data from series faster by index instead of name, the index is immutable when model is built because the model object could run in multiple threads, so it's important make sure the model object is totally immutable.
Setup indices to retrieve data from series faster by index instead of name, the index is immutable when model is built because the model object could run in multiple threads, so it's important make sure the model object is totally immutable.
Setup indices of targets that are usually not used by the scoring process, they are only used when residual values to be computed.
- Definition Classes
- Model
- lazy val usedSchema: StructType
The schema of used fields.
The schema of used fields.
- Definition Classes
- Model
- def version: String
PMML version.
PMML version.
- Definition Classes
- HasVersion
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated
(Since version 9)