Scorecard

class Scorecard(var parent: Model, val attributes: ScorecardAttributes, val miningSchema: MiningSchema, val characteristics: Characteristics, val output: Option[Output], val targets: Option[Targets], val localTransformations: Option[LocalTransformations], val modelStats: Option[ModelStats], val modelExplanation: Option[ModelExplanation], val modelVerification: Option[ModelVerification], val extensions: Seq[Extension]) 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?"

Value members

Concrete methods

Creates an object of subclass of ModelOutputs that is for writing into an output series.

Creates an object of subclass of ModelOutputs that is for writing into an output series.

Definition Classes

Model element type.

Model element type.

Definition Classes
override def predict(values: Series): Series

The scoring procedure for a scorecard is simple. Partial scores are summed up to create an overall score, the result of the scorecard.

The scoring procedure for a scorecard is simple. Partial scores are summed up to create an overall score, the result of the scorecard.

Definition Classes

Inherited methods

def algorithmName: Option[String]
def baselineScore: Option[Double]
Inherited from:
HasOutput

The schema of candidate outputs.

The schema of candidate outputs.

Inherited from:
Model
def classes(name: String): Array[Any]

Returns class labels of the specified target.

Returns class labels of the specified target.

Inherited from:
Model
def combineOutputFields(listA: Array[OutputField], listB: Array[OutputField]): Array[OutputField]
Inherited from:
HasOutput
def containInterResults: Boolean
Inherited from:
HasOutput
def dVersion: Double

Returns PMML version as a double value

Returns PMML version as a double value

Inherited from:
HasVersion

The data dictionary of this model.

The data dictionary of this model.

Inherited from:
Model
def field(name: String): Field

Returns the field of a given name.

Returns the field of a given name.

Throws:
FieldNotFoundException

if a field with the given name does not exist

Inherited from:
HasField

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

Inherited from:
Model
override def getField(name: String): Option[Field]

Returns the field of a given name, None if a field with the given name does not exist.

Returns the field of a given name, None if a field with the given name does not exist.

Definition Classes
Inherited from:
Model
def hasExtensions: Boolean
Inherited from:
HasExtensions
def hasTarget: Boolean
Inherited from:
HasTargetFields

The header of this model.

The header of this model.

Inherited from:
Model
def importances: Map[String, Double]

Returns importances of predictors.

Returns importances of predictors.

Inherited from:
Model
def inferClasses: Array[Any]

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.

Inherited from:
Model
def isAssociationRules: Boolean

Tests if this is a association rules model.

Tests if this is a association rules model.

Inherited from:
HasModelAttributes
def isBinary: Boolean

Tests if the target is a binary field

Tests if the target is a binary field

Inherited from:
Model
override def isClassification: Boolean

Tests if this is a classification model.

Tests if this is a classification model.

Definition Classes
Inherited from:
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.

Inherited from:
Model
def isClustering: Boolean

Tests if this is a clustering model.

Tests if this is a clustering model.

Inherited from:
HasModelAttributes
def isMixed: Boolean

Tests if this is a mixed model.

Tests if this is a mixed model.

Inherited from:
HasModelAttributes
def isOrdinal: Boolean

Tests if the target is an ordinal field

Tests if the target is an ordinal field

Inherited from:
Model
def isPredictionOnly: Boolean
Inherited from:
HasOutput
override def isRegression: Boolean

Tests if this is a regression model.

Tests if this is a regression model.

Definition Classes
Inherited from:
Model
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.

Inherited from:
Model
def isScorable: Boolean
def isSequences: Boolean

Tests if this is a sequences model.

Tests if this is a sequences model.

Inherited from:
HasModelAttributes
def isSubModel: Boolean
Inherited from:
ModelLocation
def isTimeSeries: Boolean

Tests if this is a time series model.

Tests if this is a time series model.

Inherited from:
HasModelAttributes
def isTopLevelModel: Boolean
Inherited from:
ModelLocation
def modelName: Option[String]
def multiTargets: Boolean
Inherited from:
HasTargetFields
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.

Inherited from:
Model
def opType(name: String): OpType

Returns optype of the specified target.

Returns optype of the specified target.

Inherited from:
Model
Inherited from:
HasOutput
def outputIndex(feature: ResultFeature, value: Option[Any]): Int
Inherited from:
HasOutput
def outputNames: Array[String]
Inherited from:
HasOutput

The schema of final outputs.

The schema of final outputs.

Inherited from:
Model
def predict(it: Iterator[Series]): Iterator[Series]
Inherited from:
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]}
Value parameters:
json

Records in json

Returns:

Results in json

Inherited from:
Model
def predict(values: List[Any]): List[Any]
Inherited from:
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

Inherited from:
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.

Inherited from:
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.

Inherited from:
Model
def predict(values: Map[String, Any]): Map[String, Any]

Predicts values for a given data map.

Predicts values for a given data map.

Inherited from:
Model

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.

Inherited from:
Model
def setOutputFields(outputFields: Array[OutputField]): Scorecard
Inherited from:
HasOutput
def setParent(parent: Model): Scorecard
Inherited from:
HasParent
def setSupplementOutput(value: Boolean): Scorecard
Inherited from:
HasOutput
def singleTarget: Boolean
Inherited from:
HasTargetFields
def size: Int
Inherited from:
HasTargetFields

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.

Inherited from:
HasOutput
def targetName: String

Name of the first target for the supervised model.

Name of the first target for the supervised model.

Inherited from:
HasTargetFields
def targetNamesOfResidual: Array[String]
Inherited from:
HasOutput

The optional transformation dictionary.

The optional transformation dictionary.

Inherited from:
Model
Inherited from:
HasOutput
def version: String

PMML version.

PMML version.

Inherited from:
HasVersion

Concrete fields

val ch: Array[Characteristic]
lazy override val defaultOutputFields: Array[OutputField]

Returns all candidates output fields of this model when there is no output specified explicitly.

Returns all candidates output fields of this model when there is no output specified explicitly.

override val extensions: Seq[Extension]
override val modelExplanation: Option[ModelExplanation]
override val modelStats: Option[ModelStats]
override val modelVerification: Option[ModelVerification]
override val output: Option[Output]
val reasonCodes: SortedSet[Option[String]]

Collected all reason codes with order that appears in the PMML file, from top to bottom.

Collected all reason codes with order that appears in the PMML file, from top to bottom.

lazy val reasonCodesWanted: Int

The number of reason codes need to return.

The number of reason codes need to return.

override val targets: Option[Targets]

Inherited fields

lazy val classes: Array[Any]

The class labels in a classification model.

The class labels in a classification model.

Inherited from:
Model

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.

Inherited from:
HasOutput

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.

Inherited from:
Model
lazy val inputDerivedFields: Array[Field]

Referenced derived fields.

Referenced derived fields.

Inherited from:
Model
lazy val inputFields: Array[Field]

All input fields in an array.

All input fields in an array.

Inherited from:
Model
lazy val inputNames: Array[String]

All input names in an array.

All input names in an array.

Inherited from:
Model

The schema of inputs.

The schema of inputs.

Inherited from:
Model
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.

Inherited from:
Model
lazy val numClasses: Int

The number of class labels in a classification model.

The number of class labels in a classification model.

Inherited from:
Model
lazy val opType: OpType

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.

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.

Inherited from:
Model
lazy val predictedValueIndex: Int
Inherited from:
HasOutput
var 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.

Inherited from:
HasOutput
lazy val targetClasses: Map[String, Array[Any]]

The class labels of all categorical targets.

The class labels of all categorical targets.

Inherited from:
Model
lazy val targetField: Field

The first target field for the supervised model.

The first target field for the supervised model.

Inherited from:
Model
lazy val targetFields: Array[Field]

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.

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.

Inherited from:
Model
lazy val targetNames: Array[String]

All target names in an array.

All target names in an array.

Inherited from:
Model
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.

Inherited from:
Model

The schema of used fields.

The schema of used fields.

Inherited from:
Model