本文整理汇总了C#中Cloner.GetClone方法的典型用法代码示例。如果您正苦于以下问题:C# Cloner.GetClone方法的具体用法?C# Cloner.GetClone怎么用?C# Cloner.GetClone使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cloner
的用法示例。
在下文中一共展示了Cloner.GetClone方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CalculateImpactAndReplacementValues
public override void CalculateImpactAndReplacementValues(ISymbolicDataAnalysisModel model, ISymbolicExpressionTreeNode node,
IDataAnalysisProblemData problemData, IEnumerable<int> rows, out double impactValue, out double replacementValue, out double newQualityForImpactsCalculation,
double qualityForImpactsCalculation = Double.NaN) {
var classificationModel = (ISymbolicClassificationModel)model;
var classificationProblemData = (IClassificationProblemData)problemData;
if (double.IsNaN(qualityForImpactsCalculation))
qualityForImpactsCalculation = CalculateQualityForImpacts(classificationModel, classificationProblemData, rows);
replacementValue = CalculateReplacementValue(classificationModel, node, classificationProblemData, rows);
var constantNode = new ConstantTreeNode(new Constant()) { Value = replacementValue };
var cloner = new Cloner();
var tempModel = cloner.Clone(classificationModel);
var tempModelNode = (ISymbolicExpressionTreeNode)cloner.GetClone(node);
var tempModelParentNode = tempModelNode.Parent;
int i = tempModelParentNode.IndexOfSubtree(tempModelNode);
tempModelParentNode.RemoveSubtree(i);
tempModelParentNode.InsertSubtree(i, constantNode);
OnlineCalculatorError errorState;
var dataset = classificationProblemData.Dataset;
var targetClassValues = dataset.GetDoubleValues(classificationProblemData.TargetVariable, rows);
var estimatedClassValues = tempModel.GetEstimatedClassValues(dataset, rows);
newQualityForImpactsCalculation = OnlineAccuracyCalculator.Calculate(targetClassValues, estimatedClassValues, out errorState);
if (errorState != OnlineCalculatorError.None) newQualityForImpactsCalculation = 0.0;
impactValue = qualityForImpactsCalculation - newQualityForImpactsCalculation;
}
开发者ID:thunder176,项目名称:HeuristicLab,代码行数:30,代码来源:SymbolicClassificationSolutionImpactValuesCalculator.cs