程序包 weka.core.pmml
类 MiningSchema
java.lang.Object
weka.core.pmml.MiningSchema
- 所有已实现的接口:
Serializable
This class encapsulates the mining schema from
a PMML xml file. Specifically, it contains the
fields used in the PMML model as an Instances
object (just the header). It also contains meta
information such as value ranges and how to handle
missing values, outliers etc.
We also store various other PMML elements here, such as
the TransformationDictionary, DerivedFields and Targets
(if defined). They are not part of the mining schema per se, but
relate to inputs used by the model and it is convenient to
store them here.
- 版本:
- $Revision: 5562 $
- 作者:
- Mark Hall (mhall{[at]}pentaho{[dot]}com)
- 另请参阅:
-
构造器概要
构造器构造器说明MiningSchema
(Element model, Instances dataDictionary, weka.core.pmml.TransformationDictionary transDict) Constructor for MiningSchema. -
方法概要
修饰符和类型方法说明void
applyMissingAndOutlierTreatments
(double[] values) Apply both missing and outlier treatments to an incoming instance.void
applyMissingValuesTreatment
(double[] values) Apply the missing value treatments (if any) to an incoming instance.void
applyOutlierTreatment
(double[] values) Apply the outlier treatment methods (if any) to an incoming instance.void
convertNumericAttToNominal
(int index, ArrayList<String> newVals) Convert a numeric attribute in the mining schema to nominal.void
Method to convert any string attributes in the mining schema Instances to nominal attributes.Get the all the fields (both mining schema and derived) as Instances.Get the mining schema fields as an Instances object.Get the Target meta data.weka.core.pmml.TransformationDictionary
Get the transformation dictionary .boolean
Returns true if there is Target meta data.toString()
Get a textual description of the mining schema.
-
构造器详细资料
-
MiningSchema
public MiningSchema(Element model, Instances dataDictionary, weka.core.pmml.TransformationDictionary transDict) throws Exception Constructor for MiningSchema.- 参数:
model
- theElement
encapsulating the pmml modeldataDictionary
- the data dictionary as an Instances object- 抛出:
Exception
- if something goes wrong during construction of the mining schema
-
-
方法详细资料
-
applyMissingValuesTreatment
Apply the missing value treatments (if any) to an incoming instance.- 参数:
values
- an array of doubles in order of the fields in the mining schema that represents the incoming instance (note: use PMMLUtils.instanceToSchema() to generate this).- 抛出:
Exception
- if something goes wrong during missing value handling
-
applyOutlierTreatment
Apply the outlier treatment methods (if any) to an incoming instance.- 参数:
values
- an array of doubles in order of the fields in the mining schema that represents the incoming instance (note: use PMMLUtils.instanceToSchema() to generate this).- 抛出:
Exception
- if something goes wrong during outlier treatment handling
-
applyMissingAndOutlierTreatments
Apply both missing and outlier treatments to an incoming instance.- 参数:
values
- an array of doubles in order of the fields in the mining schema that represents the incoming instance (note: use MappingInfo.instanceToSchema() to generate this).- 抛出:
Exception
- if something goes wrong during this process
-
getFieldsAsInstances
Get the all the fields (both mining schema and derived) as Instances. Attributes are in order of those in the mining schema, followed by derived attributes from the TransformationDictionary followed by derived attributes from LocalTransformations.- 返回:
- all the fields as an Instances object
-
getMiningSchemaAsInstances
Get the mining schema fields as an Instances object.- 返回:
- the mining schema fields as an Instances object.
-
getTransformationDictionary
public weka.core.pmml.TransformationDictionary getTransformationDictionary()Get the transformation dictionary .- 返回:
- the transformation dictionary or null if none is defined.
-
hasTargetMetaData
public boolean hasTargetMetaData()Returns true if there is Target meta data.- 返回:
- true if there is Target meta data
-
getTargetMetaData
Get the Target meta data.- 返回:
- the Target meta data
-
convertStringAttsToNominal
public void convertStringAttsToNominal()Method to convert any string attributes in the mining schema Instances to nominal attributes. This may be necessary if there are no Value elements defined for categorical fields in the data dictionary. In this case, elements in the actual model definition will probably reveal the valid values for categorical fields. -
convertNumericAttToNominal
Convert a numeric attribute in the mining schema to nominal.- 参数:
index
- the index of the attribute to convertnewVals
- an ArrayList of the values of the nominal attribute
-
getDerivedFields
-
getMiningFields
-
toString
Get a textual description of the mining schema.
-