v22.2.5
This commit is contained in:
Родитель
1d5b89238f
Коммит
de082f42cd
|
@ -0,0 +1,31 @@
|
|||
# Copyright Syncfusion Inc. 2001 - 2016. All rights reserved.
|
||||
# Use of this code is subject to the terms of our license.
|
||||
# A copy of the current license can be obtained at any time by e-mailing
|
||||
# licensing@syncfusion.com. Any infringement will be prosecuted under
|
||||
# applicable laws.
|
||||
|
||||
|
||||
# If you are not familiar with R you can obtain a quick introduction by downloading
|
||||
# R Succinctly for free from Syncfusion - http://www.syncfusion.com/resources/techportal/ebooks/rsuccinctly
|
||||
# R Succinctly is also included with this installation and is available here
|
||||
# Installed Drive :\Program Files (x86)\Syncfusion\Essential Studio\XX.X.X.XX\Infrastructure\EBooks\R_Succintly.pdf OF R Succinctly
|
||||
# Uncomment below lines to install necessary packages if not installed already
|
||||
# install.packages("pmml")
|
||||
# install.packages("arules")
|
||||
|
||||
# Load below packages
|
||||
library(pmml)
|
||||
library(arules)
|
||||
|
||||
# Here we directly load the Adult dataset installed with the "arules" package.
|
||||
data(Adult)
|
||||
|
||||
#To look at the contents of the sparse matrix, use the inspect() function in combination with vector operators.
|
||||
inspect(Adult[1:5])
|
||||
|
||||
# Create model for the dataset using apriori
|
||||
adultRules <- apriori(Adult, parameter = list(confidence=0.99,minlen = 2))
|
||||
|
||||
# PMML generation
|
||||
saveXML(pmml(adultRules), "Adult.pmml")
|
||||
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -0,0 +1,113 @@
|
|||
#region Copyright Syncfusion Inc. 2001-2018.
|
||||
// Copyright Syncfusion Inc. 2001-2018. All rights reserved.
|
||||
// Use of this code is subject to the terms of our license.
|
||||
// A copy of the current license can be obtained at any time by e-mailing
|
||||
// licensing@syncfusion.com. Any infringement will be prosecuted under
|
||||
// applicable laws.
|
||||
#endregion
|
||||
using Syncfusion.PMML;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace Adult
|
||||
{
|
||||
/// <summary>
|
||||
/// Console program to demonstrate PMML execution engine
|
||||
/// </summary>
|
||||
public class Program
|
||||
{
|
||||
//Create Table instance for input and output
|
||||
public Table inputTable = null;
|
||||
private Table outputTable = null;
|
||||
|
||||
#if CONSOLE
|
||||
|
||||
private static void Main(string[] args)
|
||||
{
|
||||
//Create instance
|
||||
Program program = new Program();
|
||||
//Load input csv
|
||||
program.inputTable = new Table("../../Model/Adult.txt", true, '\t');
|
||||
//Invoke PredictResult
|
||||
program.outputTable = program.PredictResult(program.inputTable,
|
||||
"../../Model/Adult.pmml");
|
||||
//Write the Result as CSV File
|
||||
program.outputTable.WriteToCSV("../../Model/PredictedOutput.csv", true, ',');
|
||||
//Dispose the output Table
|
||||
program.outputTable.Dispose();
|
||||
//Display the result saved location
|
||||
Console.WriteLine("\nResult saved in : " + Path.GetFullPath("../../Model/PredictedOutput.csv"));
|
||||
Console.ReadKey();
|
||||
}
|
||||
#endif
|
||||
#region PredictResult
|
||||
|
||||
/// <summary>
|
||||
/// Predicts the results for given PMML and CSV file and serialize the results in a CSV file
|
||||
/// </summary>
|
||||
public Table PredictResult(Table inputTable, string pmmlPath)
|
||||
{
|
||||
string[] recommendations = null;
|
||||
string[] exclusiveRecommendations = null;
|
||||
string[] ruleAssociations = null;
|
||||
List<string> input = null;
|
||||
int index = 0;
|
||||
|
||||
//Get PMML Evaluator instance
|
||||
PMMLEvaluator evaluator = new PMMLEvaluatorFactory().
|
||||
GetPMMLEvaluatorInstance(pmmlPath);
|
||||
|
||||
for (int i = 0; i < inputTable.ColumnNames.Length; i++)
|
||||
{
|
||||
if (inputTable.ColumnNames[i].ToLower() == "items")
|
||||
index = i;
|
||||
}
|
||||
|
||||
//Predict the recommendations, exclusiveRecommendations and ruleAssociations for each transactions using the PMML Evaluator instance
|
||||
for (int i = 0; i < inputTable.RowCount; i++)
|
||||
{
|
||||
input = inputTable[i, index].ToString().Replace("{", "").Replace("}", "").Split(new char[] { ',' }).ToList();
|
||||
|
||||
//Get result
|
||||
PredictedResult predictedResult = evaluator.GetResult(input, null);
|
||||
recommendations = predictedResult.GetRecommendations();
|
||||
exclusiveRecommendations = predictedResult.GetExclusiveRecommendations();
|
||||
ruleAssociations = predictedResult.GetRuleAssociations();
|
||||
|
||||
if (i == 0)
|
||||
{
|
||||
InitializeTable(inputTable.RowCount);
|
||||
}
|
||||
|
||||
outputTable[i, 0] = "[" + string.Join(",", recommendations) + "]";
|
||||
outputTable[i, 1] = "[" + string.Join(",", exclusiveRecommendations) + "]";
|
||||
outputTable[i, 2] = "[" + string.Join(",", ruleAssociations) + "]";
|
||||
}
|
||||
|
||||
return outputTable;
|
||||
}
|
||||
|
||||
#endregion PredictResult
|
||||
|
||||
#region Initialize OutputTable
|
||||
|
||||
/// <summary>
|
||||
/// Initialize the outputTable
|
||||
/// </summary>
|
||||
/// <param name="rowCount">rowCount of output table</param>
|
||||
private void InitializeTable(int rowCount)
|
||||
{
|
||||
//Create instance to hold evaluated results
|
||||
outputTable = new Table(rowCount, 3);
|
||||
//Add predicted column names
|
||||
outputTable.ColumnNames[0] = "Recommendation";
|
||||
outputTable.ColumnNames[1] = "Exclusive_Recommendation";
|
||||
outputTable.ColumnNames[2] = "Rule_Association";
|
||||
}
|
||||
|
||||
#endregion Initialize OutputTable
|
||||
}
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
# Copyright Syncfusion Inc. 2001 - 2016. All rights reserved.
|
||||
# Use of this code is subject to the terms of our license.
|
||||
# A copy of the current license can be obtained at any time by e-mailing
|
||||
# licensing@syncfusion.com. Any infringement will be prosecuted under
|
||||
# applicable laws.
|
||||
|
||||
|
||||
# If you are not familiar with R you can obtain a quick introduction by downloading
|
||||
# R Succinctly for free from Syncfusion - http://www.syncfusion.com/resources/techportal/ebooks/rsuccinctly
|
||||
# R Succinctly is also included with this installation and is available here
|
||||
# Installed Drive :\Program Files (x86)\Syncfusion\Essential Studio\XX.X.X.XX\Infrastructure\EBooks\R_Succintly.pdf OF R Succinctly
|
||||
# Uncomment below lines to install necessary packages if not installed already
|
||||
# install.packages("pmml")
|
||||
# install.packages("arules")
|
||||
|
||||
# Load below packages
|
||||
library(pmml)
|
||||
library(arules)
|
||||
|
||||
# Here we directly load the Epub dataset installed with the "arules" package.
|
||||
data(Epub)
|
||||
|
||||
#To look at the contents of the sparse matrix, use the inspect() function in combination with vector operators.
|
||||
inspect(Epub[1:5])
|
||||
|
||||
# Create model for the dataset using apriori
|
||||
epubRules <- apriori(Epub, parameter = list(support =0.001, confidence = 0.01,minlen = 2))
|
||||
|
||||
# PMML generation
|
||||
saveXML(pmml(epubRules), "Epub.pmml")
|
||||
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -0,0 +1,113 @@
|
|||
#region Copyright Syncfusion Inc. 2001-2018.
|
||||
// Copyright Syncfusion Inc. 2001-2018. All rights reserved.
|
||||
// Use of this code is subject to the terms of our license.
|
||||
// A copy of the current license can be obtained at any time by e-mailing
|
||||
// licensing@syncfusion.com. Any infringement will be prosecuted under
|
||||
// applicable laws.
|
||||
#endregion
|
||||
using Syncfusion.PMML;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace Epub
|
||||
{
|
||||
/// <summary>
|
||||
/// Console program to demonstrate PMML execution engine
|
||||
/// </summary>
|
||||
public class Program
|
||||
{
|
||||
//Create Table instance for input and output
|
||||
public Table inputTable = null;
|
||||
private Table outputTable = null;
|
||||
|
||||
#if CONSOLE
|
||||
|
||||
private static void Main(string[] args)
|
||||
{
|
||||
//Create instance
|
||||
Program program = new Program();
|
||||
//Load input csv
|
||||
program.inputTable = new Table("../../Model/Epub.txt", true, '\t');
|
||||
//Invoke PredictResult
|
||||
program.outputTable = program.PredictResult(program.inputTable,
|
||||
"../../Model/Epub.pmml");
|
||||
//Write the Result as CSV File
|
||||
program.outputTable.WriteToCSV("../../Model/PredictedOutput.csv", true, ',');
|
||||
//Dispose the output Table
|
||||
program.outputTable.Dispose();
|
||||
//Display the result saved location
|
||||
Console.WriteLine("\nResult saved in : " + Path.GetFullPath("../../Model/PredictedOutput.csv"));
|
||||
Console.ReadKey();
|
||||
}
|
||||
#endif
|
||||
#region PredictResult
|
||||
|
||||
/// <summary>
|
||||
/// Predicts the results for given PMML and CSV file and serialize the results in a CSV file
|
||||
/// </summary>
|
||||
public Table PredictResult(Table inputTable, string pmmlPath)
|
||||
{
|
||||
string[] recommendations = null;
|
||||
string[] exclusiveRecommendations = null;
|
||||
string[] ruleAssociations = null;
|
||||
List<string> input = null;
|
||||
int index = 0;
|
||||
|
||||
//Get PMML Evaluator instance
|
||||
PMMLEvaluator evaluator = new PMMLEvaluatorFactory().
|
||||
GetPMMLEvaluatorInstance(pmmlPath);
|
||||
|
||||
for (int i = 0; i < inputTable.ColumnNames.Length; i++)
|
||||
{
|
||||
if (inputTable.ColumnNames[i].ToLower() == "items")
|
||||
index = i;
|
||||
}
|
||||
|
||||
//Predict the recommendations, exclusiveRecommendations and ruleAssociations for each transactions using the PMML Evaluator instance
|
||||
for (int i = 0; i < inputTable.RowCount; i++)
|
||||
{
|
||||
input = inputTable[i, index].ToString().Replace("{", "").Replace("}", "").Split(new char[] { ',' }).ToList();
|
||||
|
||||
//Get result
|
||||
PredictedResult predictedResult = evaluator.GetResult(input, null);
|
||||
recommendations = predictedResult.GetRecommendations();
|
||||
exclusiveRecommendations = predictedResult.GetExclusiveRecommendations();
|
||||
ruleAssociations = predictedResult.GetRuleAssociations();
|
||||
|
||||
if (i == 0)
|
||||
{
|
||||
InitializeTable(inputTable.RowCount);
|
||||
}
|
||||
|
||||
outputTable[i, 0] = "[" + string.Join(",", recommendations) + "]";
|
||||
outputTable[i, 1] = "[" + string.Join(",", exclusiveRecommendations) + "]";
|
||||
outputTable[i, 2] = "[" + string.Join(",", ruleAssociations) + "]";
|
||||
}
|
||||
|
||||
return outputTable;
|
||||
}
|
||||
|
||||
#endregion PredictResult
|
||||
|
||||
#region Initialize OutputTable
|
||||
|
||||
/// <summary>
|
||||
/// Initialize the outputTable
|
||||
/// </summary>
|
||||
/// <param name="rowCount">rowCount of output table</param>
|
||||
private void InitializeTable(int rowCount)
|
||||
{
|
||||
//Create instance to hold evaluated results
|
||||
outputTable = new Table(rowCount, 3);
|
||||
//Add predicted column names
|
||||
outputTable.ColumnNames[0] = "Recommendation";
|
||||
outputTable.ColumnNames[1] = "Exclusive_Recommendation";
|
||||
outputTable.ColumnNames[2] = "Rule_Association";
|
||||
}
|
||||
|
||||
#endregion Initialize OutputTable
|
||||
}
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
# Copyright Syncfusion Inc. 2001 - 2016. All rights reserved.
|
||||
# Use of this code is subject to the terms of our license.
|
||||
# A copy of the current license can be obtained at any time by e-mailing
|
||||
# licensing@syncfusion.com. Any infringement will be prosecuted under
|
||||
# applicable laws.
|
||||
|
||||
|
||||
# If you are not familiar with R you can obtain a quick introduction by downloading
|
||||
# R Succinctly for free from Syncfusion - http://www.syncfusion.com/resources/techportal/ebooks/rsuccinctly
|
||||
# R Succinctly is also included with this installation and is available here
|
||||
# Installed Drive :\Program Files (x86)\Syncfusion\Essential Studio\XX.X.X.XX\Infrastructure\EBooks\R_Succintly.pdf OF R Succinctly
|
||||
# Uncomment below lines to install necessary packages if not installed already
|
||||
# install.packages("pmml")
|
||||
# install.packages("arules")
|
||||
|
||||
# Load below packages
|
||||
library(pmml)
|
||||
library(arules)
|
||||
|
||||
# Here we directly load the Groceries dataset installed with the "arules" package.
|
||||
data(Groceries)
|
||||
|
||||
#To look at the contents of the sparse matrix, use the inspect() function in combination with vector operators.
|
||||
inspect(Groceries[1:5])
|
||||
|
||||
# Create model for the dataset using apriori
|
||||
groceriesRules <- apriori(Groceries, parameter = list(support =0.006, confidence = 0.25,minlen = 2))
|
||||
|
||||
# PMML generation
|
||||
saveXML(pmml(groceriesRules), "Groceries.pmml")
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -0,0 +1,114 @@
|
|||
#region Copyright Syncfusion Inc. 2001-2018.
|
||||
// Copyright Syncfusion Inc. 2001-2018. All rights reserved.
|
||||
// Use of this code is subject to the terms of our license.
|
||||
// A copy of the current license can be obtained at any time by e-mailing
|
||||
// licensing@syncfusion.com. Any infringement will be prosecuted under
|
||||
// applicable laws.
|
||||
#endregion
|
||||
using Syncfusion.PMML;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace Groceries
|
||||
{
|
||||
/// <summary>
|
||||
/// Console program to demonstrate PMML execution engine
|
||||
/// </summary>
|
||||
public class Program
|
||||
{
|
||||
//Create Table instance for input and output
|
||||
public Table inputTable = null;
|
||||
private Table outputTable = null;
|
||||
|
||||
#if CONSOLE
|
||||
|
||||
private static void Main(string[] args)
|
||||
{
|
||||
//Create instance
|
||||
Program program = new Program();
|
||||
//Load input csv
|
||||
program.inputTable = new Table("../../Model/Groceries.txt", true, '\t');
|
||||
//Invoke PredictResult
|
||||
program.outputTable = program.PredictResult(program.inputTable,
|
||||
"../../Model/Groceries.pmml");
|
||||
//Write the Result as CSV File
|
||||
program.outputTable.WriteToCSV("../../Model/PredictedOutput.csv", true, ',');
|
||||
//Dispose the output Table
|
||||
program.outputTable.Dispose();
|
||||
//Display the result saved location
|
||||
Console.WriteLine("\nResult saved in : " + Path.GetFullPath("../../Model/PredictedOutput.csv"));
|
||||
Console.ReadKey();
|
||||
}
|
||||
#endif
|
||||
#region PredictResult
|
||||
|
||||
/// <summary>
|
||||
/// Predicts the results for given PMML and CSV file and serialize the results in a CSV file
|
||||
/// </summary>
|
||||
public Table PredictResult(Table inputTable, string pmmlPath)
|
||||
{
|
||||
string[] recommendations = null;
|
||||
string[] exclusiveRecommendations = null;
|
||||
string[] ruleAssociations = null;
|
||||
List<string> input = null;
|
||||
int index = 0;
|
||||
|
||||
//Get PMML Evaluator instance
|
||||
PMMLEvaluator evaluator = new PMMLEvaluatorFactory().
|
||||
GetPMMLEvaluatorInstance(pmmlPath);
|
||||
|
||||
for (int i = 0; i < inputTable.ColumnNames.Length; i++)
|
||||
{
|
||||
if (inputTable.ColumnNames[i].ToLower() == "items")
|
||||
index = i;
|
||||
}
|
||||
|
||||
//Predict the recommendations, exclusiveRecommendations and ruleAssociations for each transactions using the PMML Evaluator instance
|
||||
for (int i = 0; i < inputTable.RowCount; i++)
|
||||
{
|
||||
input = inputTable[i,index].ToString().Replace("{", "").Replace("}", "").Split(new char[] { ',' }).ToList();
|
||||
|
||||
//Get result
|
||||
PredictedResult predictedResult = evaluator.GetResult(input, null);
|
||||
recommendations = predictedResult.GetRecommendations();
|
||||
exclusiveRecommendations = predictedResult.GetExclusiveRecommendations();
|
||||
ruleAssociations = predictedResult.GetRuleAssociations();
|
||||
|
||||
if (i == 0)
|
||||
{
|
||||
InitializeTable(inputTable.RowCount);
|
||||
}
|
||||
|
||||
outputTable[i, 0] = "[" + string.Join(",", recommendations) + "]";
|
||||
outputTable[i, 1] = "[" + string.Join(",", exclusiveRecommendations) + "]";
|
||||
outputTable[i, 2] = "[" + string.Join(",", ruleAssociations) + "]";
|
||||
}
|
||||
|
||||
return outputTable;
|
||||
}
|
||||
|
||||
#endregion PredictResult
|
||||
|
||||
#region Initialize OutputTable
|
||||
|
||||
/// <summary>
|
||||
/// Initialize the outputTable
|
||||
/// </summary>
|
||||
/// <param name="rowCount">rowCount of output table</param>
|
||||
private void InitializeTable(int rowCount)
|
||||
{
|
||||
//Create instance to hold evaluated results
|
||||
outputTable = new Table(rowCount, 3);
|
||||
//Add predicted column names
|
||||
outputTable.ColumnNames[0] = "Recommendation";
|
||||
outputTable.ColumnNames[1] = "Exclusive_Recommendation";
|
||||
outputTable.ColumnNames[2] = "Rule_Association";
|
||||
}
|
||||
|
||||
#endregion Initialize OutputTable
|
||||
}
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
# Copyright Syncfusion Inc. 2001 - 2016. All rights reserved.
|
||||
# Use of this code is subject to the terms of our license.
|
||||
# A copy of the current license can be obtained at any time by e-mailing
|
||||
# licensing@syncfusion.com. Any infringement will be prosecuted under
|
||||
# applicable laws.
|
||||
|
||||
|
||||
# If you are not familiar with R you can obtain a quick introduction by downloading
|
||||
# R Succinctly for free from Syncfusion - http://www.syncfusion.com/resources/techportal/ebooks/rsuccinctly
|
||||
# R Succinctly is also included with this installation and is available here
|
||||
# Installed Drive :\Program Files (x86)\Syncfusion\Essential Studio\XX.X.X.XX\Infrastructure\EBooks\R_Succintly.pdf OF R Succinctly
|
||||
# Uncomment below lines to install necessary packages if not installed already
|
||||
# install.packages("pmml")
|
||||
# install.packages("arules")
|
||||
|
||||
# Load below packages
|
||||
library(pmml)
|
||||
library(arules)
|
||||
|
||||
# Here we directly load the Income dataset installed with the "arules" package.
|
||||
data(Income)
|
||||
|
||||
#To look at the contents of the sparse matrix, use the inspect() function in combination with vector operators.
|
||||
inspect(Income[1:5])
|
||||
|
||||
# Create model for the dataset using apriori
|
||||
incomeRules <- apriori(Income, parameter = list(confidence=0.99,minlen = 2))
|
||||
|
||||
# PMML generation
|
||||
saveXML(pmml(incomeRules), "Income.pmml")
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -0,0 +1,114 @@
|
|||
#region Copyright Syncfusion Inc. 2001-2018.
|
||||
// Copyright Syncfusion Inc. 2001-2018. All rights reserved.
|
||||
// Use of this code is subject to the terms of our license.
|
||||
// A copy of the current license can be obtained at any time by e-mailing
|
||||
// licensing@syncfusion.com. Any infringement will be prosecuted under
|
||||
// applicable laws.
|
||||
#endregion
|
||||
using Syncfusion.PMML;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace Income
|
||||
{
|
||||
/// <summary>
|
||||
/// Console program to demonstrate PMML execution engine
|
||||
/// </summary>
|
||||
public class Program
|
||||
{
|
||||
//Create Table instance for input and output
|
||||
public Table inputTable = null;
|
||||
private Table outputTable = null;
|
||||
|
||||
#if CONSOLE
|
||||
|
||||
private static void Main(string[] args)
|
||||
{
|
||||
//Create instance
|
||||
Program program = new Program();
|
||||
//Load input csv
|
||||
program.inputTable = new Table("../../Model/Income.txt", true, '\t');
|
||||
//Invoke PredictResult
|
||||
program.outputTable = program.PredictResult(program.inputTable,
|
||||
"../../Model/Income.pmml");
|
||||
//Write the Result as CSV File
|
||||
program.outputTable.WriteToCSV("../../Model/PredictedOutput.csv", true, ',');
|
||||
//Dispose the output Table
|
||||
program.outputTable.Dispose();
|
||||
//Display the result saved location
|
||||
Console.WriteLine("\nResult saved in : " + Path.GetFullPath("../../Model/PredictedOutput.csv"));
|
||||
Console.ReadKey();
|
||||
}
|
||||
|
||||
#endif
|
||||
#region PredictResult
|
||||
|
||||
/// <summary>
|
||||
/// Predicts the results for given PMML and CSV file and serialize the results in a CSV file
|
||||
/// </summary>
|
||||
public Table PredictResult(Table inputTable, string pmmlPath)
|
||||
{
|
||||
string[] recommendations = null;
|
||||
string[] exclusiveRecommendations = null;
|
||||
string[] ruleAssociations = null;
|
||||
List<string> input = null;
|
||||
int index = 0;
|
||||
|
||||
//Get PMML Evaluator instance
|
||||
PMMLEvaluator evaluator = new PMMLEvaluatorFactory().
|
||||
GetPMMLEvaluatorInstance(pmmlPath);
|
||||
|
||||
for (int i = 0; i < inputTable.ColumnNames.Length; i++)
|
||||
{
|
||||
if (inputTable.ColumnNames[i].ToLower() == "items")
|
||||
index = i;
|
||||
}
|
||||
|
||||
//Predict the recommendations, exclusiveRecommendations and ruleAssociations for each transactions using the PMML Evaluator instance
|
||||
for (int i = 0; i < inputTable.RowCount; i++)
|
||||
{
|
||||
input = inputTable[i, index].ToString().Replace("{", "").Replace("}", "").Split(new char[] { ',' }).ToList();
|
||||
|
||||
//Get result
|
||||
PredictedResult predictedResult = evaluator.GetResult(input, null);
|
||||
recommendations = predictedResult.GetRecommendations();
|
||||
exclusiveRecommendations = predictedResult.GetExclusiveRecommendations();
|
||||
ruleAssociations = predictedResult.GetRuleAssociations();
|
||||
|
||||
if (i == 0)
|
||||
{
|
||||
InitializeTable(inputTable.RowCount);
|
||||
}
|
||||
|
||||
outputTable[i, 0] = "[" + string.Join(",", recommendations) + "]";
|
||||
outputTable[i, 1] = "[" + string.Join(",", exclusiveRecommendations) + "]";
|
||||
outputTable[i, 2] = "[" + string.Join(",", ruleAssociations) + "]";
|
||||
}
|
||||
|
||||
return outputTable;
|
||||
}
|
||||
|
||||
#endregion PredictResult
|
||||
|
||||
#region Initialize OutputTable
|
||||
|
||||
/// <summary>
|
||||
/// Initialize the outputTable
|
||||
/// </summary>
|
||||
/// <param name="rowCount">rowCount of output table</param>
|
||||
private void InitializeTable(int rowCount)
|
||||
{
|
||||
//Create instance to hold evaluated results
|
||||
outputTable = new Table(rowCount, 3);
|
||||
//Add predicted column names
|
||||
outputTable.ColumnNames[0] = "Recommendation";
|
||||
outputTable.ColumnNames[1] = "Exclusive_Recommendation";
|
||||
outputTable.ColumnNames[2] = "Rule_Association";
|
||||
}
|
||||
|
||||
#endregion Initialize OutputTable
|
||||
}
|
||||
}
|
|
@ -0,0 +1,72 @@
|
|||
# Copyright Syncfusion Inc. 2001 - 2016. All rights reserved.
|
||||
# Use of this code is subject to the terms of our license.
|
||||
# A copy of the current license can be obtained at any time by e-mailing
|
||||
# licensing@syncfusion.com. Any infringement will be prosecuted under
|
||||
# applicable laws.
|
||||
|
||||
|
||||
# If you are not familiar with R you can obtain a quick introduction by downloading
|
||||
# R Succinctly for free from Syncfusion - http://www.syncfusion.com/resources/techportal/ebooks/rsuccinctly
|
||||
# R Succinctly is also included with this installation and is available here
|
||||
# Installed Drive :\Program Files (x86)\Syncfusion\Essential Studio\XX.X.X.XX\Infrastructure\EBooks\R_Succintly.pdf OF R Succinctly
|
||||
# Uncomment below lines to install necessary packages if not installed already
|
||||
# install.packages("pmml")
|
||||
# install.packages("rattle")
|
||||
|
||||
# Load below packages
|
||||
library(rattle)
|
||||
library(pmml)
|
||||
|
||||
# Here we directly load the audit dataset installed with the "pmml" package.
|
||||
data(audit)
|
||||
|
||||
# rename column names for audit dataset from pmml package
|
||||
auditOriginal <- setNames(audit, c("ID", "Age", "Employment", "Education", "Marital", "Occupation", "Income", "Sex", "Deductions", "Hours", "Accounts", "Adjustment", "Adjusted"))
|
||||
|
||||
# Omit rows with missing values
|
||||
auditOriginal <- na.omit(auditOriginal)
|
||||
|
||||
# Code below demonstrates loading the same dataset from a CSV file shipped with our installer.
|
||||
# Please check installed samples (Data) location to set actual working directory
|
||||
# Uncomment below lines and comment out the code to read data from CSV file.
|
||||
# setwd("C:/actual_data_location")
|
||||
# audit<- read.csv("Audit.csv")
|
||||
|
||||
# Get numeric fields data of audit
|
||||
numericAuditData <- auditOriginal[,c("ID","Age","Income","Deductions","Hours","Adjustment","Adjusted")]
|
||||
|
||||
# Randomizing data
|
||||
audit<-numericAuditData[sample(nrow(numericAuditData)),]
|
||||
|
||||
# Divide dataset for training and test
|
||||
trainData<-audit[1:1487,]
|
||||
testData<-audit[1488:1859,]
|
||||
|
||||
# Applying KMeans Clustering Algorithm with centroids "2"
|
||||
audit_KMeans <- kmeans(trainData, 2)
|
||||
audit_KMeans
|
||||
|
||||
# Predict "Adjusted" column for test data set
|
||||
auditTestPrediction<-predict(audit_KMeans,testData)
|
||||
# Display predicted values
|
||||
auditTestPrediction
|
||||
|
||||
# PMML generation
|
||||
pmmlFile<-pmml(audit_KMeans,data=trainData)
|
||||
write(toString(pmmlFile),file="Audit.pmml")
|
||||
saveXML(pmmlFile,file="Audit.pmml")
|
||||
|
||||
# The code below is used for evaluation purpose.
|
||||
# The model is applied for original Audit data set and predicted results are saved in "ROuput.csv"
|
||||
# "ROuput.csv" file used for comparing the R results with PMML Evaluation engine results
|
||||
|
||||
# Applying KMeans Clustering algorithm to entire dataset and save the results in a CSV file
|
||||
auditEntirePrediction<-predict(audit_KMeans,numericAuditData)
|
||||
auditEntirePrediction
|
||||
|
||||
# Save predicted value in a data frame
|
||||
result <- data.frame(auditEntirePrediction)
|
||||
names(result) <- c("Predicted_Adjusted")
|
||||
|
||||
# Write the results in a CSV file
|
||||
write.csv(result,"ROutput.csv",quote=F)
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -0,0 +1,49 @@
|
|||
<?xml version="1.0"?>
|
||||
<PMML version="4.3" xmlns="http://www.dmg.org/PMML-4_3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.dmg.org/PMML-4_3 http://www.dmg.org/pmml/v4-3/pmml-4-3.xsd">
|
||||
<Header copyright="Copyright (c) 2017 Syncfusion" description="KMeans cluster model">
|
||||
<Extension name="user" value="Syncfusion" extender="Rattle/PMML"/>
|
||||
<Application name="Rattle/PMML" version="1.4"/>
|
||||
<Timestamp>2017-11-06 14:20:06</Timestamp>
|
||||
</Header>
|
||||
<DataDictionary numberOfFields="7">
|
||||
<DataField name="ID" optype="continuous" dataType="double"/>
|
||||
<DataField name="Age" optype="continuous" dataType="double"/>
|
||||
<DataField name="Income" optype="continuous" dataType="double"/>
|
||||
<DataField name="Deductions" optype="continuous" dataType="double"/>
|
||||
<DataField name="Hours" optype="continuous" dataType="double"/>
|
||||
<DataField name="Adjustment" optype="continuous" dataType="double"/>
|
||||
<DataField name="Adjusted" optype="continuous" dataType="double"/>
|
||||
</DataDictionary>
|
||||
<ClusteringModel modelName="KMeans_Model" functionName="clustering" algorithmName="KMeans: Hartigan and Wong" modelClass="centerBased" numberOfClusters="2">
|
||||
<MiningSchema>
|
||||
<MiningField name="ID"/>
|
||||
<MiningField name="Age"/>
|
||||
<MiningField name="Income"/>
|
||||
<MiningField name="Deductions"/>
|
||||
<MiningField name="Hours"/>
|
||||
<MiningField name="Adjustment"/>
|
||||
<MiningField name="Adjusted"/>
|
||||
</MiningSchema>
|
||||
<Output>
|
||||
<OutputField name="predictedValue" feature="predictedValue"/>
|
||||
<OutputField name="clusterAffinity_1" feature="clusterAffinity" value="1"/>
|
||||
<OutputField name="clusterAffinity_2" feature="clusterAffinity" value="2"/>
|
||||
</Output>
|
||||
<ComparisonMeasure kind="distance">
|
||||
<squaredEuclidean/>
|
||||
</ComparisonMeasure>
|
||||
<ClusteringField field="ID" compareFunction="absDiff"/>
|
||||
<ClusteringField field="Age" compareFunction="absDiff"/>
|
||||
<ClusteringField field="Income" compareFunction="absDiff"/>
|
||||
<ClusteringField field="Deductions" compareFunction="absDiff"/>
|
||||
<ClusteringField field="Hours" compareFunction="absDiff"/>
|
||||
<ClusteringField field="Adjustment" compareFunction="absDiff"/>
|
||||
<ClusteringField field="Adjusted" compareFunction="absDiff"/>
|
||||
<Cluster name="1" size="764" id="1">
|
||||
<Array n="7" type="real">7722088.79319372 38.1125654450262 85054.3567670157 62.5013219895288 40.4973821989529 1576.47120418848 0.145287958115183</Array>
|
||||
</Cluster>
|
||||
<Cluster name="2" size="723" id="2">
|
||||
<Array n="7" type="real">3260383.70401106 38.1009681881051 83307.3383264178 73.0834578146611 40.6362378976487 2117.5836791148 0.189488243430152</Array>
|
||||
</Cluster>
|
||||
</ClusteringModel>
|
||||
</PMML>
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -0,0 +1,184 @@
|
|||
#region Copyright Syncfusion Inc. 2001-2018.
|
||||
// Copyright Syncfusion Inc. 2001-2018. All rights reserved.
|
||||
// Use of this code is subject to the terms of our license.
|
||||
// A copy of the current license can be obtained at any time by e-mailing
|
||||
// licensing@syncfusion.com. Any infringement will be prosecuted under
|
||||
// applicable laws.
|
||||
#endregion
|
||||
using Syncfusion.PMML;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
namespace AuditKMeans
|
||||
{ /// <summary>
|
||||
/// Console program to demonstrate PMML execution engine
|
||||
/// </summary>
|
||||
public class Program
|
||||
{
|
||||
//Create Table instance for input, output and R Result
|
||||
public Table inputTable = null;
|
||||
private Table outputTable = null;
|
||||
private Table rResults = null;
|
||||
|
||||
#if CONSOLE
|
||||
|
||||
private static void Main(string[] args)
|
||||
{
|
||||
//Create instance
|
||||
Program program = new Program();
|
||||
//Load input csv
|
||||
program.inputTable = new Table("../../Model/Audit.csv", true, ',');
|
||||
//Invoke PredictResult
|
||||
program.outputTable = program.PredictResult(program.inputTable,
|
||||
"../../Model/Audit.pmml");
|
||||
//Dispose the inputTable values
|
||||
program.inputTable.Dispose();
|
||||
//Compare predicted results of PMML execution engine with R Results
|
||||
program.ComparePredictedResultsWithR("../../Model/ROutput.csv");
|
||||
//Write the Result as CSV File
|
||||
program.outputTable.WriteToCSV("../../Model/PredictedOutput.csv", true, ',');
|
||||
//Dispose the output Table
|
||||
program.outputTable.Dispose();
|
||||
//Display the result saved location
|
||||
Console.WriteLine("\nResult saved in : " + Path.GetFullPath("../../Model/PredictedOutput.csv"));
|
||||
Console.ReadKey();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#region PredictResult
|
||||
|
||||
/// <summary>
|
||||
/// Predicts the results for given PMML and CSV file and serialize the results in a CSV file
|
||||
/// </summary>
|
||||
public Table PredictResult(Table inputTable, string pmmlPath)
|
||||
{
|
||||
//Get PMML Evaluator instance
|
||||
PMMLEvaluator evaluator = new PMMLEvaluatorFactory().
|
||||
GetPMMLEvaluatorInstance(pmmlPath);
|
||||
|
||||
string[] predictedCategories = null;
|
||||
|
||||
//Predict the value for each record using the PMML Evaluator instance
|
||||
for (int i = 0; i < inputTable.RowCount; i++)
|
||||
{
|
||||
var audit = GetDataObject(inputTable, i);
|
||||
|
||||
//Get result
|
||||
PredictedResult predictedResult = evaluator.GetResult(audit, null);
|
||||
|
||||
if (i == 0)
|
||||
{
|
||||
//Get the predicted propability fields
|
||||
predictedCategories = predictedResult.GetPredictedCategories();
|
||||
//Initialize the output table
|
||||
InitializeTable(inputTable.RowCount, predictedCategories);
|
||||
}
|
||||
|
||||
//Add predicted value
|
||||
outputTable[i, 0] = predictedResult.PredictedValue;
|
||||
}
|
||||
|
||||
return outputTable;
|
||||
}
|
||||
|
||||
#endregion PredictResult
|
||||
|
||||
#region Compare Predicted Results With R
|
||||
|
||||
/// <summary>
|
||||
/// Compare predicted results of PMML execution engine with R results
|
||||
/// </summary>
|
||||
|
||||
public void ComparePredictedResultsWithR(string rOutputDataCSVPath)
|
||||
{
|
||||
//Create instance to hold results of R
|
||||
rResults = new Table(rOutputDataCSVPath, true, ',');
|
||||
string differentIndices = string.Empty;
|
||||
//Pass the Table to the compare method of resultTable
|
||||
bool isDifferent = Compare(rResults, 1, 0, ref differentIndices);
|
||||
//Display mismatched index
|
||||
#if CONSOLE
|
||||
if (isDifferent)
|
||||
{
|
||||
Console.WriteLine("\nDifference in predicted results by R and PMML execution engine");
|
||||
Console.WriteLine("\nDifferent indices are " + differentIndices);
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("\nBoth predicted results by R and PMML execution engine are equal");
|
||||
}
|
||||
#endif
|
||||
//Dispose the R results Table
|
||||
rResults.Dispose();
|
||||
}
|
||||
|
||||
#endregion Compare Predicted Results With R
|
||||
|
||||
#region Initialize OutputTable
|
||||
|
||||
/// <summary>
|
||||
/// Initialize the outputTable
|
||||
/// </summary>
|
||||
/// <param name="rowCount">rowCount of output table</param>
|
||||
/// <param name="predictedfield">predictedfield name</param>
|
||||
/// <param name="predictedCategories">probableFields</param>
|
||||
private void InitializeTable(int rowCount, string[] predictedCategories)
|
||||
{
|
||||
//Create instance to hold evaluated results
|
||||
outputTable = new Table(rowCount, predictedCategories.Length + 1);
|
||||
//Add predicted column names
|
||||
outputTable.ColumnNames[0] = "Predicted_Cluster";
|
||||
}
|
||||
|
||||
#endregion Initialize OutputTable
|
||||
|
||||
#region GetDataObject
|
||||
|
||||
/// <summary>
|
||||
/// Returns the row as anonymous object
|
||||
/// </summary>
|
||||
/// <param name="inputTable"> input Table values</param>
|
||||
/// <param name="row">input row</param>
|
||||
/// <returns>Anonymous object</returns>
|
||||
public Dictionary<string,object> GetDataObject(Table inputTable, int row)
|
||||
{
|
||||
Dictionary<string, object> audit = new Dictionary<string, object>();
|
||||
for (int i = 0; i < inputTable.ColumnCount; i++)
|
||||
{
|
||||
audit.Add(inputTable.ColumnNames[i], inputTable[row, inputTable.ColumnNames[i]]);
|
||||
}
|
||||
return audit;
|
||||
}
|
||||
|
||||
#endregion GetDataObject
|
||||
|
||||
#region Compare
|
||||
|
||||
/// <summary>
|
||||
/// Compares the result of 2 Tables based on column index.
|
||||
/// </summary>
|
||||
/// <param name="rOutput">R output table</param>
|
||||
/// <param name="rColumnIndex">R's Column to be compared</param>
|
||||
/// <param name="predictedColumnIndex">predicted result's column index</param>
|
||||
/// <param name="differentIndices"> different indices</param>
|
||||
public bool Compare(Table table, int rColumnIndex, int predictedColumnIndex, ref string differentIndices)
|
||||
{
|
||||
bool isDifferent = false;
|
||||
//Compare predicted values
|
||||
for (int i = 0; i < table.RowCount; i++)
|
||||
{
|
||||
//Compare Results based on column index
|
||||
if (outputTable[i, predictedColumnIndex].ToString() != table[i, rColumnIndex].ToString())
|
||||
{
|
||||
differentIndices += ", " + i;
|
||||
isDifferent = true;
|
||||
}
|
||||
}
|
||||
return isDifferent;
|
||||
}
|
||||
|
||||
#endregion Compare
|
||||
}
|
||||
}
|
|
@ -0,0 +1,75 @@
|
|||
# Copyright Syncfusion Inc. 2001 - 2016. All rights reserved.
|
||||
# Use of this code is subject to the terms of our license.
|
||||
# A copy of the current license can be obtained at any time by e-mailing
|
||||
# licensing@syncfusion.com. Any infringement will be prosecuted under
|
||||
# applicable laws.
|
||||
|
||||
|
||||
# If you are not familiar with R you can obtain a quick introduction by downloading
|
||||
# R Succinctly for free from Syncfusion - http://www.syncfusion.com/resources/techportal/ebooks/rsuccinctly
|
||||
# R Succinctly is also included with this installation and is available here
|
||||
# Installed Drive :\Program Files (x86)\Syncfusion\Essential Studio\XX.X.X.XX\Infrastructure\EBooks\R_Succintly.pdf OF R Succinctly
|
||||
# Uncomment below lines to install necessary packages if not installed already
|
||||
# install.packages("pmml")
|
||||
# install.packages("rattle")
|
||||
# install.packages("TH.data")
|
||||
|
||||
# Load below packages
|
||||
library(TH.data) # This package is specifically loaded for breast cancer(GBSG2) dataset shipped within it.
|
||||
library(rattle)
|
||||
library(pmml)
|
||||
|
||||
# Here we directly load the GBSG2 dataset installed with the "TH.data" package.
|
||||
data(GBSG2)
|
||||
|
||||
# rename column names for GBSG2 dataset from TH.data package
|
||||
breastCancerOriginal <- setNames(GBSG2, c("Hormonal_Therapy", "Age", "Menopausal_Status", "Tumor_Size", "Tumor_Grade", "Positive_Nodes", "Progesterone", "Estrogen_Receptor",
|
||||
"Survival_Time", "Indicator"))
|
||||
|
||||
# Omit rows with missing values
|
||||
breastCancerOriginal <- na.omit(breastCancerOriginal)
|
||||
|
||||
# Code below demonstrates loading the same dataset from a CSV file shipped with our installer.
|
||||
# Please check installed samples (Data) location to set actual working directory
|
||||
# Uncomment below lines and comment out the code to read data from CSV file.
|
||||
# setwd("C:/actual_data_location")
|
||||
# breastCancer<- read.csv("BreastCancer.csv")
|
||||
|
||||
# Get numeric fields data of breast cancer
|
||||
numericBCData <- breastCancerOriginal[,c("Age","Tumor_Size","Positive_Nodes","Progesterone","Estrogen_Receptor","Survival_Time","Indicator")]
|
||||
|
||||
# Randomizing data
|
||||
breastCancer <- numericBCData[sample(nrow(numericBCData)),]
|
||||
|
||||
# Divide dataset for training and test
|
||||
trainData<-breastCancer[1:549,]
|
||||
testData<-breastCancer[550:686,]
|
||||
|
||||
# Applying KMeans Clustering algorithm with centriods "2"
|
||||
breastCancer_KMeans <- kmeans(trainData,2)
|
||||
breastCancer_KMeans
|
||||
|
||||
# Predict "Cens" column for test data set
|
||||
breastCancerTestPrediction<-predict(breastCancer_KMeans,testData)
|
||||
# Display predicted values
|
||||
breastCancerTestPrediction
|
||||
|
||||
# PMML generation
|
||||
pmmlFile<-pmml(breastCancer_KMeans,data=trainData)
|
||||
write(toString(pmmlFile),file="BreastCancer.pmml")
|
||||
saveXML(pmmlFile,file="BreastCancer.pmml")
|
||||
|
||||
# The code below is used for evaluation purpose.
|
||||
# The model is applied for original Breast Cancer data set and predicted results are saved in "ROuput.csv"
|
||||
# "ROuput.csv" file used for comparing the R results with PMML Evaluation engine results
|
||||
|
||||
# Applying KMeans Clustering algorithm to entire dataset and save the results in a CSV file
|
||||
breastCancerEntirePrediction<-predict(breastCancer_KMeans,numericBCData)
|
||||
breastCancerEntirePrediction
|
||||
|
||||
# Save predicted value in a data frame
|
||||
result <- data.frame(breastCancerEntirePrediction)
|
||||
names(result) <- c("Predicted_censored")
|
||||
|
||||
# Write the results in a CSV file
|
||||
write.csv(result,"ROutput.csv",quote=F)
|
|
@ -0,0 +1,687 @@
|
|||
Hormonal_Therapy,Age,Menopausal_Status,Tumor_Size,Tumor_Grade,Positive_Nodes,Progesterone,Estrogen_Receptor,Survival_Time,Indicator
|
||||
no,70,Post,21,II,3,48,66,1814,1
|
||||
yes,56,Post,12,II,7,61,77,2018,1
|
||||
yes,58,Post,35,II,9,52,271,712,1
|
||||
yes,59,Post,17,II,4,60,29,1807,1
|
||||
no,73,Post,35,II,1,26,65,772,1
|
||||
no,32,Pre,57,III,24,0,13,448,1
|
||||
yes,59,Post,8,II,2,181,0,2172,0
|
||||
no,65,Post,16,II,1,192,25,2161,0
|
||||
no,80,Post,39,II,30,0,59,471,1
|
||||
no,66,Post,18,II,7,0,3,2014,0
|
||||
yes,68,Post,40,II,9,16,20,577,1
|
||||
yes,71,Post,21,II,9,0,0,184,1
|
||||
yes,59,Post,58,II,1,154,101,1840,0
|
||||
no,50,Post,27,III,1,16,12,1842,0
|
||||
yes,70,Post,22,II,3,113,139,1821,0
|
||||
no,54,Post,30,II,1,135,6,1371,1
|
||||
no,39,Pre,35,I,4,79,28,707,1
|
||||
yes,66,Post,23,II,1,112,225,1743,0
|
||||
yes,69,Post,25,I,1,131,196,1781,0
|
||||
no,55,Post,65,I,4,312,76,865,1
|
||||
no,56,Post,22,II,1,28,23,1684,1
|
||||
no,57,Post,21,II,2,184,294,1701,0
|
||||
no,65,Post,25,III,1,0,0,1701,0
|
||||
yes,70,Post,15,II,3,89,151,1693,0
|
||||
no,65,Post,70,III,26,2,64,379,1
|
||||
no,44,Pre,23,II,2,299,35,1105,1
|
||||
yes,59,Post,23,III,3,8,0,548,1
|
||||
no,43,Pre,35,II,4,37,5,1296,1
|
||||
yes,53,Post,58,II,1,0,0,1483,0
|
||||
no,32,Pre,25,II,2,36,10,1570,0
|
||||
no,45,Pre,45,III,2,0,0,1469,0
|
||||
no,36,Pre,44,III,2,6,5,1472,0
|
||||
yes,57,Post,35,III,1,1490,209,1342,0
|
||||
no,55,Post,25,I,2,26,53,1349,0
|
||||
no,34,Pre,15,II,5,103,118,1162,1
|
||||
yes,58,Post,35,II,2,38,18,1342,0
|
||||
no,62,Post,22,II,12,0,8,797,1
|
||||
no,64,Post,25,I,9,67,86,1232,0
|
||||
no,53,Post,23,II,3,13,7,1230,0
|
||||
no,53,Post,13,II,8,423,175,1205,0
|
||||
no,65,Post,52,III,7,25,155,1090,0
|
||||
no,45,Pre,38,II,38,160,5,1095,0
|
||||
no,58,Post,42,III,1,0,0,449,1
|
||||
yes,68,Post,23,II,1,27,5,972,0
|
||||
yes,67,Post,25,II,1,15,55,825,0
|
||||
no,59,Post,25,I,2,33,51,2438,0
|
||||
no,65,Post,20,II,1,6,6,2233,0
|
||||
yes,34,Pre,30,III,12,0,5,286,1
|
||||
yes,65,Post,18,II,5,133,175,1861,0
|
||||
no,61,Post,30,II,9,41,51,1080,1
|
||||
yes,61,Post,25,II,1,21,172,1521,1
|
||||
no,46,Post,25,II,1,2,0,1693,0
|
||||
no,63,Post,25,II,1,86,366,1528,1
|
||||
yes,45,Pre,19,II,7,19,0,169,1
|
||||
no,46,Pre,35,II,7,67,44,272,1
|
||||
no,63,Post,40,II,3,5,8,731,1
|
||||
yes,53,Pre,21,II,9,29,9,2059,0
|
||||
yes,43,Post,40,I,4,233,19,1853,0
|
||||
no,31,Pre,23,II,4,20,0,1854,0
|
||||
yes,71,Post,15,II,9,85,9,1645,0
|
||||
yes,59,Post,28,II,18,0,7,544,1
|
||||
no,62,Post,15,II,4,22,70,1666,0
|
||||
no,54,Post,30,II,2,31,11,353,1
|
||||
no,46,Pre,25,II,13,82,20,1791,0
|
||||
yes,53,Post,25,II,2,9,1,1685,0
|
||||
no,45,Pre,10,II,1,14,3,191,1
|
||||
no,48,Pre,30,II,4,19,4,370,1
|
||||
no,32,Pre,20,II,5,55,41,173,1
|
||||
no,30,Pre,12,II,11,4,3,242,1
|
||||
no,53,Post,16,III,1,1,1,420,1
|
||||
no,42,Pre,12,II,6,388,30,438,1
|
||||
no,48,Pre,35,II,1,41,61,1624,0
|
||||
yes,54,Post,30,II,6,15,81,1036,1
|
||||
no,56,Post,25,II,11,0,36,359,1
|
||||
no,51,Pre,25,II,16,91,31,171,1
|
||||
no,68,Post,18,II,14,0,2,959,1
|
||||
no,46,Pre,21,II,3,73,13,1351,0
|
||||
no,41,Pre,15,II,4,11,11,486,1
|
||||
no,48,Pre,16,III,10,0,0,525,1
|
||||
no,55,Pre,23,II,3,295,34,762,1
|
||||
no,52,Pre,36,II,6,6,16,175,1
|
||||
no,36,Pre,8,III,1,10,0,1195,0
|
||||
no,44,Pre,25,III,6,5,2,338,1
|
||||
no,47,Post,20,III,6,408,36,1125,0
|
||||
yes,47,Post,40,III,6,187,24,916,0
|
||||
yes,59,Post,23,II,1,13,20,972,0
|
||||
no,65,Post,10,II,3,42,59,867,0
|
||||
no,42,Pre,25,II,7,0,2,249,1
|
||||
no,63,Post,32,II,16,7,132,281,1
|
||||
no,40,Pre,22,II,2,13,18,758,0
|
||||
yes,62,Post,50,II,11,1,2,377,1
|
||||
no,55,Post,40,I,2,64,81,1976,0
|
||||
yes,47,Pre,45,II,2,264,59,2539,0
|
||||
no,63,Post,23,II,3,22,32,2467,0
|
||||
no,69,Post,20,II,2,154,191,876,1
|
||||
no,43,Pre,21,II,1,206,87,2132,0
|
||||
no,59,Post,24,II,14,2,22,426,1
|
||||
no,75,Post,50,II,1,170,317,554,1
|
||||
yes,41,Pre,40,II,4,100,100,1246,1
|
||||
no,47,Pre,36,III,2,154,99,1926,0
|
||||
no,43,Pre,80,II,20,2,25,1207,1
|
||||
no,42,Pre,30,III,4,65,81,1852,0
|
||||
no,46,Pre,35,I,5,100,0,1174,1
|
||||
no,65,Post,58,II,11,390,119,1250,0
|
||||
no,59,Post,30,II,3,0,2,530,1
|
||||
no,48,Pre,70,II,7,8,0,1502,0
|
||||
no,44,Pre,27,II,3,525,61,1364,0
|
||||
no,53,Post,25,II,13,77,131,1170,1
|
||||
no,53,Post,25,II,2,54,58,1729,0
|
||||
no,60,Pre,23,II,3,136,507,1642,0
|
||||
no,64,Post,24,II,2,206,304,1218,1
|
||||
no,56,Post,8,II,1,110,0,1358,0
|
||||
no,66,Post,30,II,16,0,508,360,1
|
||||
no,50,Pre,30,II,1,183,243,550,1
|
||||
yes,63,Post,22,II,9,64,19,857,0
|
||||
no,61,Post,60,II,51,45,38,768,0
|
||||
no,46,Pre,26,I,3,33,68,858,0
|
||||
yes,63,Post,23,II,3,3,2,770,0
|
||||
no,49,Pre,55,II,7,0,0,679,1
|
||||
no,33,Pre,35,III,1,26,0,1164,1
|
||||
no,50,Post,52,II,1,0,0,350,1
|
||||
no,45,Pre,29,II,1,0,0,578,1
|
||||
no,51,Pre,20,II,1,0,0,1460,1
|
||||
no,39,Pre,30,III,1,0,0,1434,0
|
||||
yes,56,Post,40,II,3,0,3,1763,1
|
||||
no,60,Post,15,II,2,84,93,889,1
|
||||
yes,47,Pre,35,III,17,14,3,357,1
|
||||
no,58,Post,50,II,7,77,77,547,1
|
||||
yes,56,Pre,21,II,3,111,20,1722,0
|
||||
yes,54,Post,21,II,1,7,139,2372,0
|
||||
yes,56,Post,40,II,3,0,59,2030,1
|
||||
no,57,Post,26,II,1,166,521,1002,1
|
||||
no,53,Post,10,II,1,17,61,1280,1
|
||||
no,31,Pre,60,II,7,542,77,338,1
|
||||
yes,41,Pre,80,II,1,0,0,533,1
|
||||
yes,66,Post,33,II,3,0,0,168,0
|
||||
yes,37,Pre,25,II,1,235,38,1169,0
|
||||
no,66,Post,15,II,1,252,185,1675,1
|
||||
no,48,Pre,45,III,1,0,0,1862,0
|
||||
no,44,Pre,21,II,3,1600,70,629,0
|
||||
no,51,Pre,50,II,9,0,0,1167,0
|
||||
no,57,Post,20,II,3,39,83,495,1
|
||||
no,65,Post,17,I,1,935,200,967,0
|
||||
yes,40,Pre,30,II,2,320,30,1720,0
|
||||
yes,62,Post,19,II,1,35,1060,598,1
|
||||
yes,64,Post,30,III,12,0,0,392,1
|
||||
no,46,Pre,12,II,3,175,80,1502,0
|
||||
yes,62,Post,25,II,1,35,185,229,0
|
||||
no,44,Pre,30,II,7,110,20,310,0
|
||||
no,69,Post,27,I,3,140,350,1296,0
|
||||
no,48,Pre,15,II,6,0,110,488,0
|
||||
no,47,Post,12,II,2,0,50,942,0
|
||||
yes,64,Post,26,II,5,370,220,570,0
|
||||
no,58,Post,52,III,5,0,0,1177,0
|
||||
yes,65,Post,30,II,5,85,365,1113,0
|
||||
no,40,Pre,40,II,5,50,75,288,1
|
||||
yes,62,Post,21,II,2,0,0,723,0
|
||||
no,55,Post,20,III,16,0,0,403,1
|
||||
no,62,Post,25,III,5,0,0,1225,1
|
||||
no,29,Pre,12,II,4,32,150,338,1
|
||||
no,38,Pre,18,III,5,141,105,1337,1
|
||||
no,52,Pre,20,I,1,78,14,1420,1
|
||||
no,47,Post,55,II,18,29,87,2048,0
|
||||
no,53,Pre,75,III,19,375,107,600,1
|
||||
no,37,Pre,15,I,1,162,22,1765,0
|
||||
no,63,Post,60,II,15,180,12,491,1
|
||||
no,63,Post,45,III,7,20,93,305,1
|
||||
no,59,Post,22,II,2,23,235,1582,0
|
||||
no,48,Pre,30,II,15,250,45,1771,0
|
||||
no,33,Pre,15,III,33,66,8,960,1
|
||||
no,38,Pre,57,III,9,18,62,571,1
|
||||
no,32,Pre,28,II,12,33,107,675,0
|
||||
no,31,Pre,28,II,2,349,189,285,1
|
||||
no,53,Post,48,II,7,254,117,1472,0
|
||||
no,47,Pre,30,II,1,422,89,1279,1
|
||||
no,40,Pre,24,I,3,25,11,148,0
|
||||
yes,64,Post,19,II,1,19,9,1863,0
|
||||
yes,49,Post,56,I,3,356,64,1933,0
|
||||
no,53,Post,52,II,9,6,29,358,1
|
||||
yes,70,Post,18,II,1,107,307,734,0
|
||||
yes,61,Post,22,II,2,6,173,2372,1
|
||||
no,43,Pre,30,II,1,22,0,2563,0
|
||||
yes,74,Post,20,II,1,462,240,2372,0
|
||||
yes,58,Post,18,I,2,74,67,1989,1
|
||||
yes,49,Pre,20,II,6,56,98,2015,1
|
||||
yes,61,Post,35,III,2,23,9,1956,0
|
||||
no,66,Post,40,III,16,21,412,945,1
|
||||
yes,66,Post,20,III,3,54,17,2153,0
|
||||
no,59,Post,23,II,2,88,38,838,1
|
||||
no,51,Post,70,III,6,28,5,113,1
|
||||
yes,71,Post,18,II,2,31,9,1833,0
|
||||
no,46,Pre,50,III,10,44,4,1722,0
|
||||
no,52,Pre,40,III,6,32,5,241,1
|
||||
yes,60,Post,16,II,1,184,51,1352,1
|
||||
no,60,Post,50,II,7,65,30,1702,0
|
||||
yes,67,Post,27,II,4,1118,753,1222,0
|
||||
no,54,Post,30,III,3,1,0,1089,0
|
||||
no,55,Post,12,II,1,63,19,1243,0
|
||||
no,38,Pre,20,II,9,24,34,579,1
|
||||
yes,52,Post,25,II,13,31,196,1043,1
|
||||
no,43,Pre,30,II,3,45,11,2234,0
|
||||
no,50,Pre,22,I,1,135,111,2297,0
|
||||
yes,61,Post,25,I,2,32,144,2014,0
|
||||
no,62,Post,20,II,2,7,9,518,1
|
||||
no,46,Pre,30,III,1,36,33,940,0
|
||||
no,50,Pre,25,III,1,20,13,766,0
|
||||
no,52,Post,20,III,10,7,8,251,1
|
||||
no,45,Pre,20,II,2,64,48,1959,0
|
||||
no,52,Post,10,II,3,109,12,1897,0
|
||||
no,51,Post,120,II,12,3,1,160,1
|
||||
no,66,Post,28,II,2,488,298,970,0
|
||||
no,50,Pre,35,I,1,408,44,892,0
|
||||
yes,60,Post,32,I,3,104,203,753,0
|
||||
no,61,Post,20,II,5,25,75,348,1
|
||||
yes,64,Post,45,III,5,1,8,275,1
|
||||
no,64,Post,17,I,1,227,0,1329,1
|
||||
no,51,Post,35,III,1,6,1,1193,1
|
||||
yes,63,Post,30,II,7,0,0,698,1
|
||||
no,62,Post,12,II,7,0,0,436,1
|
||||
yes,65,Post,18,III,1,0,0,552,1
|
||||
yes,67,Post,20,II,1,0,0,564,1
|
||||
no,62,Post,30,II,1,8,371,2239,0
|
||||
yes,48,Pre,25,II,1,235,33,2237,0
|
||||
no,67,Post,25,II,1,6,19,529,1
|
||||
no,46,Pre,11,II,2,0,0,1820,0
|
||||
yes,56,Post,20,I,1,2,334,1756,0
|
||||
yes,72,Post,34,III,36,2,1091,515,1
|
||||
yes,50,Post,70,II,19,10,57,272,1
|
||||
no,58,Post,21,III,2,1,1,891,1
|
||||
no,63,Post,21,II,1,0,378,1356,0
|
||||
no,45,Post,15,II,6,1,162,1352,0
|
||||
no,46,Pre,21,III,1,7,109,1077,0
|
||||
yes,58,Post,18,II,3,64,418,675,1
|
||||
yes,60,Post,39,III,9,0,0,855,0
|
||||
no,53,Post,30,III,1,1,4,740,0
|
||||
yes,63,Post,21,II,1,26,30,2551,0
|
||||
no,60,Post,35,II,12,41,62,754,1
|
||||
no,33,Pre,25,II,8,96,13,819,1
|
||||
yes,63,Post,19,II,5,18,38,1280,1
|
||||
no,70,Post,16,II,2,126,338,2388,0
|
||||
yes,60,Post,30,II,2,92,18,2296,0
|
||||
yes,54,Post,25,II,1,5,57,1884,0
|
||||
yes,64,Post,25,III,3,56,272,1059,1
|
||||
no,57,Post,55,III,6,22,186,859,0
|
||||
yes,50,Post,21,I,1,82,2,1109,0
|
||||
no,53,Post,20,II,1,1,1,1192,1
|
||||
no,77,Post,20,III,4,94,325,1806,1
|
||||
yes,47,Pre,60,II,15,5,38,500,1
|
||||
no,41,Pre,20,II,4,8,38,1589,1
|
||||
yes,47,Pre,30,II,5,12,11,1463,1
|
||||
yes,63,Post,25,II,2,8,195,1826,0
|
||||
no,48,Pre,22,II,4,26,29,1231,0
|
||||
no,40,Pre,15,II,1,204,138,1117,0
|
||||
yes,57,Post,30,II,8,40,40,836,1
|
||||
no,47,Pre,40,II,2,33,59,1222,0
|
||||
no,46,Pre,22,II,4,24,74,663,0
|
||||
yes,58,Post,35,III,7,0,0,722,1
|
||||
yes,51,Pre,25,II,1,167,109,322,0
|
||||
yes,62,Post,23,II,2,0,14,1150,1
|
||||
no,50,Pre,60,III,4,0,0,446,1
|
||||
yes,65,Post,30,II,5,0,36,1855,0
|
||||
yes,59,Post,30,II,8,0,0,238,1
|
||||
no,49,Pre,18,II,2,0,0,1838,0
|
||||
yes,52,Post,25,II,13,0,0,1826,0
|
||||
no,45,Pre,30,II,1,0,0,1093,1
|
||||
no,49,Post,14,II,1,0,0,2051,0
|
||||
no,58,Post,45,III,4,0,0,370,1
|
||||
no,25,Pre,22,II,2,250,87,861,1
|
||||
no,50,Pre,30,III,6,0,0,1587,1
|
||||
no,43,Pre,27,II,1,23,9,552,1
|
||||
no,46,Pre,12,II,1,6,49,2353,0
|
||||
yes,64,Post,24,III,5,366,201,2471,0
|
||||
yes,63,Post,43,II,5,21,174,893,1
|
||||
no,40,Pre,35,II,2,279,99,2093,1
|
||||
yes,57,Post,22,II,4,16,5,2612,0
|
||||
yes,58,Post,56,I,11,51,50,956,1
|
||||
yes,62,Post,25,III,4,12,49,1637,0
|
||||
yes,50,Pre,42,I,2,238,26,2456,0
|
||||
no,49,Post,30,II,4,40,177,2227,0
|
||||
no,64,Post,24,II,2,41,80,1601,1
|
||||
yes,66,Post,15,II,2,15,42,1841,0
|
||||
yes,37,Pre,30,II,4,104,107,2177,0
|
||||
no,60,Post,18,III,2,12,8,2052,0
|
||||
yes,63,Post,23,III,12,3,2,973,0
|
||||
no,51,Pre,12,I,2,55,64,2156,0
|
||||
yes,49,Pre,28,I,4,364,120,1499,0
|
||||
yes,57,Post,7,II,1,1,1,2030,0
|
||||
yes,68,Post,14,II,6,40,68,573,1
|
||||
no,47,Pre,25,II,1,199,134,1666,0
|
||||
no,51,Post,13,II,5,89,134,1979,0
|
||||
yes,49,Pre,19,I,5,69,14,1786,0
|
||||
no,63,Post,28,II,4,258,46,1847,0
|
||||
yes,64,Post,15,II,1,340,71,2009,0
|
||||
no,65,Post,24,II,1,328,115,1926,0
|
||||
yes,63,Post,13,II,1,124,361,1490,0
|
||||
no,33,Pre,23,III,10,2,3,233,1
|
||||
no,44,Pre,35,II,6,26,4,1240,0
|
||||
no,47,Pre,13,II,3,242,14,1751,0
|
||||
no,46,Pre,19,I,11,56,24,1878,0
|
||||
no,52,Pre,26,II,1,258,10,1171,0
|
||||
no,62,Post,55,III,8,3,2,1751,0
|
||||
yes,61,Post,24,II,2,28,50,1756,0
|
||||
no,60,Post,27,II,6,401,159,714,1
|
||||
yes,67,Post,44,II,10,431,267,1505,0
|
||||
no,47,Pre,78,II,14,168,53,776,1
|
||||
no,70,Post,38,III,2,24,15,1443,0
|
||||
no,50,Pre,11,I,1,10,11,1317,0
|
||||
yes,62,Post,20,II,1,11,6,870,0
|
||||
no,58,Post,30,III,13,7,46,859,1
|
||||
no,59,Post,20,II,1,2,4,223,1
|
||||
no,45,Pre,18,I,1,56,40,1212,0
|
||||
no,45,Pre,30,II,3,345,31,1119,0
|
||||
no,41,Pre,34,II,10,25,10,740,0
|
||||
yes,54,Post,29,II,10,26,284,1062,0
|
||||
no,50,Pre,29,I,2,90,30,8,0
|
||||
yes,52,Post,20,II,1,1,8,936,0
|
||||
no,59,Post,45,II,6,739,526,740,0
|
||||
yes,60,Post,24,III,7,10,10,632,1
|
||||
yes,51,Pre,30,III,2,1152,38,1760,0
|
||||
no,56,Post,40,III,1,0,3,1013,0
|
||||
no,48,Pre,20,III,7,0,0,779,0
|
||||
no,49,Pre,45,III,6,0,22,375,1
|
||||
yes,47,Pre,42,II,7,164,204,1323,0
|
||||
no,37,Pre,50,III,2,170,130,1233,0
|
||||
no,54,Pre,35,II,2,145,16,986,0
|
||||
no,49,Pre,35,II,7,3,0,650,0
|
||||
no,54,Post,28,III,4,1,2,628,0
|
||||
no,44,Pre,29,II,1,27,23,1866,0
|
||||
yes,38,Pre,18,II,4,28,5,491,1
|
||||
yes,51,Pre,34,II,3,13,12,1918,1
|
||||
no,59,Post,8,II,5,1,30,72,1
|
||||
yes,52,Post,49,III,6,8,5,1140,1
|
||||
yes,64,Post,32,II,4,402,372,799,1
|
||||
no,55,Post,37,II,1,82,234,1105,1
|
||||
no,61,Post,22,II,2,179,124,548,1
|
||||
yes,44,Pre,28,III,17,2,3,227,1
|
||||
no,38,Pre,24,II,3,13,5,1838,0
|
||||
yes,43,Pre,11,I,1,126,22,1833,0
|
||||
no,65,Post,36,III,2,9,7,550,1
|
||||
yes,59,Post,48,III,1,5,17,426,1
|
||||
no,38,Pre,31,I,10,365,206,1834,0
|
||||
no,47,Pre,25,II,3,18,42,1604,0
|
||||
no,59,Post,35,II,5,5,125,772,0
|
||||
yes,47,Post,30,I,9,114,26,1146,1
|
||||
no,36,Pre,25,II,2,70,22,371,1
|
||||
no,47,Pre,24,II,20,30,8,883,1
|
||||
no,38,Pre,23,III,3,14,6,1735,0
|
||||
yes,50,Post,23,II,8,98,30,554,1
|
||||
no,44,Pre,5,II,10,11,10,790,1
|
||||
no,54,Post,22,II,2,211,129,1340,0
|
||||
no,52,Pre,30,II,12,11,20,490,1
|
||||
no,34,Pre,3,III,1,14,11,1557,0
|
||||
no,64,Post,33,III,3,20,14,594,1
|
||||
yes,54,Post,19,III,9,9,2,828,0
|
||||
no,65,Post,27,II,4,148,191,594,1
|
||||
no,49,Pre,24,II,11,106,62,841,0
|
||||
yes,70,Post,17,I,1,142,329,695,0
|
||||
yes,47,Pre,30,I,3,195,45,2556,0
|
||||
no,51,Pre,20,II,1,77,89,1753,1
|
||||
no,63,Post,15,III,5,0,0,417,1
|
||||
no,36,Pre,30,III,2,0,0,956,1
|
||||
yes,63,Post,34,II,12,223,236,1846,0
|
||||
no,47,Pre,70,II,5,796,24,1703,0
|
||||
no,51,Pre,21,III,1,0,0,1720,0
|
||||
yes,62,Post,30,II,1,88,544,1355,0
|
||||
no,56,Post,40,III,3,0,0,1603,0
|
||||
no,62,Post,33,I,5,239,76,476,1
|
||||
yes,61,Post,30,II,8,472,293,1350,0
|
||||
yes,55,Post,15,III,3,97,194,1341,0
|
||||
yes,56,Post,11,II,1,270,369,2449,0
|
||||
no,69,Post,22,II,8,282,191,2286,1
|
||||
no,57,Post,25,II,3,48,65,456,1
|
||||
no,27,Pre,22,II,1,56,99,536,1
|
||||
no,38,Pre,25,II,1,102,11,612,1
|
||||
no,42,Pre,25,III,2,11,10,2034,1
|
||||
no,69,Post,19,I,3,73,386,1990,1
|
||||
no,61,Post,50,II,4,10,10,2456,1
|
||||
no,53,Pre,13,III,3,10,20,2205,0
|
||||
no,50,Pre,25,III,1,24,85,544,1
|
||||
no,52,Pre,27,II,5,0,8,336,1
|
||||
no,47,Pre,38,II,2,58,10,2057,0
|
||||
no,65,Post,27,II,19,23,13,575,1
|
||||
no,48,Pre,38,II,3,92,41,2011,0
|
||||
no,61,Post,38,II,17,46,52,537,1
|
||||
yes,47,Pre,12,II,1,110,14,2217,0
|
||||
no,46,Post,20,II,11,680,152,1814,1
|
||||
yes,59,Post,15,II,1,30,122,890,1
|
||||
yes,60,Post,22,III,1,218,442,1114,0
|
||||
no,65,Post,33,II,6,11,28,974,0
|
||||
yes,44,Pre,28,II,1,0,0,296,0
|
||||
yes,45,Pre,100,II,6,178,77,2320,0
|
||||
no,58,Post,35,I,6,130,162,795,1
|
||||
no,51,Post,40,II,8,132,64,867,1
|
||||
no,49,Pre,15,II,1,111,19,1703,0
|
||||
no,43,Pre,30,II,2,32,16,670,1
|
||||
no,37,Pre,35,II,7,53,19,981,1
|
||||
no,51,Pre,30,II,2,505,270,1094,0
|
||||
yes,48,Pre,35,II,1,340,32,755,1
|
||||
no,54,Post,21,II,7,6,8,1388,1
|
||||
no,64,Post,21,III,1,4,3,1387,1
|
||||
no,44,Pre,55,III,4,8,8,535,1
|
||||
no,67,Post,30,II,2,5,14,1653,0
|
||||
no,63,Post,24,II,3,46,25,1904,0
|
||||
yes,42,Pre,28,III,4,27,22,1868,0
|
||||
yes,60,Post,12,I,2,402,90,1767,0
|
||||
no,39,Pre,20,II,1,38,110,855,1
|
||||
no,53,Post,16,II,1,16,120,1157,1
|
||||
yes,38,Pre,61,II,8,624,569,1869,0
|
||||
no,61,Post,40,I,15,185,206,1152,0
|
||||
no,47,Pre,15,II,1,38,0,1401,0
|
||||
no,52,Post,25,III,3,10,15,918,0
|
||||
no,67,Post,65,II,8,0,0,745,1
|
||||
yes,61,Post,25,II,18,595,419,1283,0
|
||||
yes,57,Post,15,II,3,44,78,1481,1
|
||||
yes,42,Pre,9,I,8,77,40,1807,0
|
||||
yes,39,Pre,20,III,1,2,2,542,1
|
||||
no,34,Pre,50,III,7,4,1,1441,0
|
||||
yes,52,Pre,50,II,7,45,39,1277,0
|
||||
yes,53,Pre,45,II,4,395,44,1486,0
|
||||
no,49,Pre,20,I,3,151,16,273,0
|
||||
yes,46,Pre,23,III,8,2,1,177,1
|
||||
no,36,Pre,36,II,1,76,14,545,1
|
||||
no,39,Pre,28,II,3,5,4,1185,0
|
||||
no,46,Pre,28,III,16,12,8,631,0
|
||||
no,47,Pre,70,II,1,51,28,995,0
|
||||
no,46,Pre,45,I,9,239,58,1088,0
|
||||
no,47,Pre,35,II,1,48,68,877,0
|
||||
no,57,Post,18,II,6,74,124,798,0
|
||||
yes,60,Post,25,II,7,116,435,2380,0
|
||||
yes,64,Post,36,II,2,122,198,1679,1
|
||||
yes,54,Post,40,III,4,3,2,498,1
|
||||
no,54,Post,27,II,5,138,23,2138,0
|
||||
no,46,Pre,35,II,6,405,27,2175,0
|
||||
no,49,Pre,17,II,2,324,94,2271,0
|
||||
no,50,Pre,18,III,1,1,4,17,0
|
||||
yes,55,Post,15,II,3,16,14,964,1
|
||||
yes,45,Pre,23,II,4,1,4,540,1
|
||||
no,51,Post,30,III,10,15,103,747,1
|
||||
no,43,Pre,25,II,11,1,1,650,1
|
||||
yes,59,Post,30,II,13,7,81,410,1
|
||||
no,59,Post,27,III,20,9,2,624,1
|
||||
no,47,Pre,28,III,7,16,92,1560,0
|
||||
no,48,Pre,35,III,10,2,222,455,1
|
||||
no,47,Pre,16,II,2,128,18,1629,0
|
||||
no,49,Post,21,II,5,80,152,1730,0
|
||||
yes,65,Post,25,III,2,17,14,1483,0
|
||||
no,60,Post,21,II,1,58,701,687,1
|
||||
no,52,Post,35,III,1,8,5,308,1
|
||||
no,48,Post,22,II,4,14,0,563,1
|
||||
yes,62,Post,20,II,1,100,100,46,0
|
||||
no,46,Post,20,II,2,32,29,2144,0
|
||||
no,59,Post,21,II,4,0,75,344,1
|
||||
yes,69,Post,21,III,1,51,749,945,0
|
||||
yes,68,Post,45,I,3,31,145,1905,0
|
||||
yes,74,Post,35,II,11,10,472,855,1
|
||||
no,45,Pre,50,I,2,132,200,2370,0
|
||||
no,43,Pre,55,II,1,23,45,853,0
|
||||
no,44,Pre,28,III,4,350,127,692,0
|
||||
yes,44,Pre,24,III,5,187,62,475,1
|
||||
yes,72,Post,17,II,1,229,533,2195,0
|
||||
yes,80,Post,7,II,7,2380,972,758,0
|
||||
yes,49,Pre,100,II,35,84,24,648,1
|
||||
no,57,Post,12,I,1,84,24,761,0
|
||||
no,60,Post,32,III,8,162,315,596,0
|
||||
no,76,Post,37,III,24,11,0,195,1
|
||||
yes,57,Post,35,II,4,18,0,473,1
|
||||
yes,75,Post,16,I,1,250,533,747,0
|
||||
yes,62,Post,22,II,1,263,34,2659,0
|
||||
yes,46,Pre,60,II,19,2,16,1977,1
|
||||
yes,53,Post,17,II,1,25,30,2401,0
|
||||
no,43,Pre,20,II,3,980,45,1499,0
|
||||
no,51,Post,32,III,10,0,0,1856,0
|
||||
no,41,Pre,30,III,11,6,5,595,1
|
||||
no,63,Post,45,III,2,530,328,2148,0
|
||||
yes,41,Pre,20,III,3,13,1,2126,0
|
||||
yes,74,Post,30,III,12,432,246,1975,1
|
||||
yes,57,Post,30,II,1,17,83,1641,1
|
||||
yes,44,Pre,20,II,6,150,67,1717,0
|
||||
yes,48,Pre,24,II,1,211,187,1858,0
|
||||
no,47,Pre,15,III,1,139,36,2049,0
|
||||
yes,70,Post,25,II,4,34,273,1502,1
|
||||
no,49,Pre,14,II,1,160,12,1922,0
|
||||
yes,49,Post,24,II,2,120,117,1818,0
|
||||
yes,58,Post,35,II,11,2,76,1100,0
|
||||
no,59,Post,30,II,1,87,8,1499,0
|
||||
no,60,Post,35,II,2,5,4,359,1
|
||||
yes,63,Post,30,I,5,144,221,1645,0
|
||||
no,44,Pre,15,II,1,175,88,1356,0
|
||||
yes,79,Post,23,I,1,60,80,1632,0
|
||||
no,47,Pre,25,I,1,38,44,967,0
|
||||
yes,61,Post,30,II,1,24,38,1091,0
|
||||
yes,64,Post,35,II,3,47,64,918,1
|
||||
yes,51,Pre,21,II,1,3,2,557,1
|
||||
no,44,Pre,22,II,2,107,94,1219,1
|
||||
yes,60,Post,25,I,3,78,363,2170,0
|
||||
yes,55,Post,50,II,1,14,203,729,1
|
||||
no,70,Post,80,III,8,0,0,1449,1
|
||||
no,65,Post,20,I,2,912,606,991,1
|
||||
no,53,Pre,20,II,2,89,36,481,1
|
||||
yes,54,Post,25,III,3,1,83,1655,0
|
||||
no,65,Post,25,II,2,86,135,857,1
|
||||
yes,62,Post,30,II,2,5,104,369,1
|
||||
yes,48,Pre,30,I,3,133,129,1627,0
|
||||
yes,48,Post,35,I,2,845,105,1578,0
|
||||
no,42,Pre,40,II,10,130,51,732,1
|
||||
no,48,Pre,30,II,16,29,43,460,1
|
||||
no,66,Post,25,I,2,22,121,1208,0
|
||||
yes,63,Post,25,II,13,26,348,730,1
|
||||
no,64,Post,35,I,4,858,15,722,0
|
||||
yes,68,Post,35,II,2,3,99,717,0
|
||||
no,44,Pre,40,II,4,364,159,651,0
|
||||
no,43,Pre,27,II,2,91,117,637,0
|
||||
no,67,Post,35,II,3,19,38,615,0
|
||||
yes,37,Pre,20,II,9,0,0,42,0
|
||||
no,54,Post,23,III,10,13,6,307,1
|
||||
no,52,Post,17,II,4,558,522,983,1
|
||||
no,43,Pre,80,III,11,9,1,120,1
|
||||
no,56,Post,31,II,1,45,286,1525,1
|
||||
no,42,Post,21,I,4,147,95,1680,0
|
||||
no,56,Post,16,II,10,4,2,1730,1
|
||||
no,61,Post,36,II,6,107,158,805,1
|
||||
no,67,Post,17,II,4,390,386,2388,0
|
||||
yes,63,Post,21,I,2,16,241,559,1
|
||||
yes,66,Post,20,II,9,1,11,1977,0
|
||||
no,37,Pre,25,III,1,13,1,476,1
|
||||
yes,71,Post,16,II,1,98,306,1514,0
|
||||
no,43,Pre,28,I,1,437,33,1617,0
|
||||
no,64,Post,22,III,1,8,11,1094,1
|
||||
yes,64,Post,27,II,3,186,139,784,1
|
||||
no,46,Pre,32,II,5,9,13,181,1
|
||||
no,45,Pre,50,II,7,20,23,415,1
|
||||
yes,67,Post,24,II,4,96,90,1120,1
|
||||
no,37,Pre,25,III,8,9,0,316,1
|
||||
no,65,Post,22,I,6,386,31,637,1
|
||||
no,21,Pre,15,II,3,24,25,247,1
|
||||
yes,54,Post,21,II,7,25,88,888,0
|
||||
no,46,Pre,45,II,8,2,4,622,1
|
||||
yes,63,Post,18,II,1,48,18,806,0
|
||||
yes,46,Post,31,III,1,6,3,1163,0
|
||||
no,58,Post,31,II,2,240,394,1721,0
|
||||
no,48,Pre,15,II,2,166,128,741,0
|
||||
no,41,Pre,23,III,2,26,4,372,1
|
||||
no,32,Pre,17,III,1,19,8,1331,0
|
||||
yes,66,Post,42,III,11,412,339,394,1
|
||||
no,64,Post,14,II,1,199,604,652,0
|
||||
no,50,Pre,13,III,5,8,32,657,0
|
||||
no,47,Pre,23,III,2,18,9,567,0
|
||||
yes,60,Post,15,I,7,14,8,429,0
|
||||
no,49,Pre,23,II,2,98,31,566,0
|
||||
yes,57,Post,60,III,18,11,13,15,0
|
||||
no,57,Post,50,III,13,22,47,98,1
|
||||
yes,67,Post,15,I,1,208,257,368,0
|
||||
yes,58,Post,25,I,1,241,28,432,0
|
||||
no,61,Post,25,II,2,406,174,319,0
|
||||
no,65,Post,22,II,8,4,2,65,0
|
||||
no,44,Pre,70,II,19,28,31,16,0
|
||||
no,61,Post,18,III,4,8,10,29,0
|
||||
no,62,Post,22,II,7,76,153,18,0
|
||||
no,51,Pre,50,II,5,360,57,17,0
|
||||
yes,47,Post,23,III,5,0,0,308,1
|
||||
no,44,Pre,15,II,1,0,0,1965,0
|
||||
yes,61,Post,35,III,16,10,13,548,1
|
||||
no,48,Pre,21,III,8,0,0,293,1
|
||||
yes,51,Pre,16,II,5,167,15,2017,0
|
||||
no,66,Post,22,II,4,11,22,1093,0
|
||||
no,45,Pre,14,III,1,5,43,792,0
|
||||
no,66,Post,21,II,1,9,898,586,1
|
||||
yes,69,Post,40,III,1,3,9,1434,0
|
||||
no,49,Pre,20,II,7,63,27,67,0
|
||||
no,62,Post,12,II,5,142,91,623,0
|
||||
yes,33,Pre,19,II,2,0,0,2128,0
|
||||
no,46,Pre,30,II,2,26,223,1965,0
|
||||
no,47,Pre,20,II,1,48,26,2161,0
|
||||
yes,35,Pre,35,II,4,0,0,1183,1
|
||||
no,34,Pre,40,III,1,0,37,1108,1
|
||||
no,38,Pre,24,I,1,138,82,2065,0
|
||||
no,54,Post,27,III,1,27,792,1598,0
|
||||
no,31,Pre,55,II,3,28,89,491,1
|
||||
no,41,Pre,25,II,5,6,9,1366,1
|
||||
no,43,Pre,55,II,1,4,124,424,0
|
||||
yes,52,Post,35,II,21,11,57,859,1
|
||||
yes,65,Post,25,III,18,0,0,180,1
|
||||
no,47,Post,45,II,2,345,42,1625,0
|
||||
no,65,Post,10,I,2,213,209,1938,0
|
||||
yes,53,Post,37,II,5,345,47,1343,1
|
||||
no,45,Pre,15,II,3,28,27,646,1
|
||||
no,53,Pre,19,III,1,74,534,2192,0
|
||||
yes,50,Post,25,II,3,0,496,502,1
|
||||
no,54,Post,50,III,6,7,0,1675,0
|
||||
yes,64,Post,40,II,23,16,22,1363,1
|
||||
no,29,Pre,15,III,12,18,40,420,1
|
||||
no,48,Pre,60,I,4,312,20,982,1
|
||||
no,40,Pre,30,III,3,2,16,1459,0
|
||||
no,65,Post,35,II,1,7,74,1192,0
|
||||
no,50,Post,40,II,1,80,21,1264,0
|
||||
no,55,Post,34,II,6,109,477,1095,0
|
||||
yes,51,Post,42,II,7,58,75,1078,0
|
||||
yes,59,Post,12,III,1,1,3,737,0
|
||||
yes,51,Post,4,I,4,638,232,461,0
|
||||
no,35,Pre,22,II,13,16,25,465,1
|
||||
no,48,Pre,52,II,11,0,0,842,1
|
||||
no,48,Post,40,II,1,10,72,918,0
|
||||
yes,62,Post,39,II,4,73,235,374,1
|
||||
no,47,Pre,40,II,1,44,11,1089,0
|
||||
no,51,Post,19,II,2,92,245,1527,0
|
||||
no,42,Pre,40,II,10,256,0,285,1
|
||||
no,63,Post,27,II,1,0,0,1306,1
|
||||
yes,62,Post,20,II,7,0,0,797,1
|
||||
no,57,Post,15,II,1,91,125,1441,0
|
||||
no,25,Pre,29,II,3,0,0,343,1
|
||||
yes,35,Pre,30,III,4,49,288,936,0
|
||||
no,51,Pre,30,II,1,119,44,195,0
|
||||
no,51,Post,25,II,2,0,80,503,1
|
||||
yes,47,Pre,30,II,10,0,0,827,1
|
||||
yes,34,Pre,30,II,2,210,49,1427,0
|
||||
no,68,Post,30,II,1,20,312,854,0
|
||||
yes,64,Post,30,III,12,550,263,177,1
|
||||
no,42,Pre,55,III,7,20,20,281,1
|
||||
no,37,Pre,35,III,1,242,67,205,1
|
||||
yes,65,Post,45,II,17,27,32,751,0
|
||||
no,62,Post,27,II,13,197,79,629,1
|
||||
no,36,Pre,24,III,2,0,0,526,0
|
||||
no,49,Pre,22,III,3,0,0,463,0
|
||||
no,45,Post,30,I,2,197,49,529,0
|
||||
no,38,Pre,22,II,10,48,78,623,0
|
||||
no,55,Post,40,II,13,0,0,546,0
|
||||
yes,57,Post,17,II,3,502,145,213,0
|
||||
no,47,Pre,40,II,1,0,90,276,0
|
||||
yes,51,Post,22,II,4,250,81,2010,0
|
||||
yes,45,Pre,13,III,4,21,27,2009,0
|
||||
no,41,Pre,10,I,2,241,214,1984,0
|
||||
no,39,Pre,32,II,9,1,8,1981,0
|
||||
no,53,Post,26,III,8,1,1,624,1
|
||||
no,59,Post,35,II,4,1,1,742,1
|
||||
yes,53,Post,10,II,2,217,20,1818,0
|
||||
yes,60,Post,100,II,10,102,88,1493,1
|
||||
no,50,Pre,29,I,2,323,60,1432,0
|
||||
no,51,Pre,18,I,1,94,60,801,1
|
||||
no,51,Pre,25,II,2,20,11,1182,0
|
||||
no,43,Pre,18,II,1,10,41,71,0
|
||||
yes,55,Post,20,I,4,10,128,114,0
|
||||
yes,52,Post,20,II,3,0,15,63,0
|
||||
yes,57,Post,32,II,2,43,287,1722,0
|
||||
yes,46,Pre,18,II,1,120,628,1692,0
|
||||
no,45,Pre,25,III,1,0,4,177,0
|
||||
no,43,Pre,32,II,1,171,43,57,0
|
||||
yes,64,Post,26,II,2,1356,1144,1152,0
|
||||
no,62,Post,35,II,1,2,70,733,0
|
||||
yes,37,Pre,22,I,3,23,64,1459,1
|
||||
no,64,Post,21,II,3,403,253,2237,0
|
||||
no,45,Pre,60,II,3,74,212,933,0
|
||||
no,48,Pre,18,I,1,137,73,2056,0
|
||||
yes,50,Post,50,II,6,1,2,1729,0
|
||||
yes,32,Pre,20,II,6,8,3,2024,0
|
||||
no,49,Pre,19,II,2,388,137,2039,1
|
||||
yes,33,Pre,28,III,1,1,1,2027,0
|
||||
yes,58,Post,35,II,1,6,11,2007,0
|
||||
no,57,Post,25,II,1,26,299,1253,1
|
||||
no,45,Pre,35,II,2,26,36,1789,0
|
||||
no,66,Post,30,I,5,100,288,1707,0
|
||||
no,52,Pre,37,II,3,66,104,1714,0
|
||||
yes,49,Pre,25,II,3,152,25,1717,0
|
||||
no,49,Post,22,II,1,14,41,329,1
|
||||
no,48,Post,45,I,1,312,236,1624,0
|
||||
yes,62,Post,60,II,1,56,17,1600,0
|
||||
no,60,Post,35,II,3,115,300,385,1
|
||||
no,45,Pre,10,II,1,82,8,1475,0
|
||||
no,60,Post,37,I,1,296,35,1435,0
|
||||
no,42,Pre,60,II,15,7,5,541,0
|
||||
yes,57,Post,36,III,1,170,192,1329,0
|
||||
yes,53,Post,27,III,12,44,42,1357,0
|
||||
no,56,Post,55,III,3,46,31,1343,0
|
||||
no,46,Pre,23,II,2,120,41,748,1
|
||||
no,49,Post,30,II,2,254,353,1090,1
|
||||
yes,56,Post,32,II,2,53,174,1219,0
|
||||
no,59,Post,24,II,1,860,413,553,0
|
||||
yes,56,Post,42,I,5,113,700,662,1
|
||||
no,46,Pre,32,II,1,108,52,969,0
|
||||
yes,61,Post,27,II,5,141,346,974,0
|
||||
no,40,Pre,40,II,6,227,10,866,1
|
||||
yes,60,Post,40,II,6,8,11,504,1
|
||||
no,49,Pre,30,III,3,1,84,721,0
|
||||
yes,53,Post,25,III,17,0,0,186,0
|
||||
no,51,Pre,25,III,5,43,0,769,1
|
||||
no,52,Post,23,II,3,15,34,727,1
|
||||
no,55,Post,23,II,9,116,15,1701,1
|
|
|
@ -0,0 +1,49 @@
|
|||
<?xml version="1.0"?>
|
||||
<PMML version="4.3" xmlns="http://www.dmg.org/PMML-4_3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.dmg.org/PMML-4_3 http://www.dmg.org/pmml/v4-3/pmml-4-3.xsd">
|
||||
<Header copyright="Copyright (c) 2017 Syncfusion" description="KMeans cluster model">
|
||||
<Extension name="user" value="Syncfusion" extender="Rattle/PMML"/>
|
||||
<Application name="Rattle/PMML" version="1.4"/>
|
||||
<Timestamp>2017-11-06 14:20:09</Timestamp>
|
||||
</Header>
|
||||
<DataDictionary numberOfFields="7">
|
||||
<DataField name="Age" optype="continuous" dataType="double"/>
|
||||
<DataField name="Tumor_Size" optype="continuous" dataType="double"/>
|
||||
<DataField name="Positive_Nodes" optype="continuous" dataType="double"/>
|
||||
<DataField name="Progesterone" optype="continuous" dataType="double"/>
|
||||
<DataField name="Estrogen_Receptor" optype="continuous" dataType="double"/>
|
||||
<DataField name="Survival_Time" optype="continuous" dataType="double"/>
|
||||
<DataField name="Indicator" optype="continuous" dataType="double"/>
|
||||
</DataDictionary>
|
||||
<ClusteringModel modelName="KMeans_Model" functionName="clustering" algorithmName="KMeans: Hartigan and Wong" modelClass="centerBased" numberOfClusters="2">
|
||||
<MiningSchema>
|
||||
<MiningField name="Age"/>
|
||||
<MiningField name="Tumor_Size"/>
|
||||
<MiningField name="Positive_Nodes"/>
|
||||
<MiningField name="Progesterone"/>
|
||||
<MiningField name="Estrogen_Receptor"/>
|
||||
<MiningField name="Survival_Time"/>
|
||||
<MiningField name="Indicator"/>
|
||||
</MiningSchema>
|
||||
<Output>
|
||||
<OutputField name="predictedValue" feature="predictedValue"/>
|
||||
<OutputField name="clusterAffinity_1" feature="clusterAffinity" value="1"/>
|
||||
<OutputField name="clusterAffinity_2" feature="clusterAffinity" value="2"/>
|
||||
</Output>
|
||||
<ComparisonMeasure kind="distance">
|
||||
<squaredEuclidean/>
|
||||
</ComparisonMeasure>
|
||||
<ClusteringField field="Age" compareFunction="absDiff"/>
|
||||
<ClusteringField field="Tumor_Size" compareFunction="absDiff"/>
|
||||
<ClusteringField field="Positive_Nodes" compareFunction="absDiff"/>
|
||||
<ClusteringField field="Progesterone" compareFunction="absDiff"/>
|
||||
<ClusteringField field="Estrogen_Receptor" compareFunction="absDiff"/>
|
||||
<ClusteringField field="Survival_Time" compareFunction="absDiff"/>
|
||||
<ClusteringField field="Indicator" compareFunction="absDiff"/>
|
||||
<Cluster name="1" size="244" id="1">
|
||||
<Array n="7" type="real">53.5368852459016 27.9795081967213 3.45491803278689 137.323770491803 108.434426229508 1768.18852459016 0.188524590163934</Array>
|
||||
</Cluster>
|
||||
<Cluster name="2" size="305" id="2">
|
||||
<Array n="7" type="real">52.5868852459016 30.4229508196721 5.80983606557377 87.1639344262295 87.8327868852459 641.970491803279 0.60327868852459</Array>
|
||||
</Cluster>
|
||||
</ClusteringModel>
|
||||
</PMML>
|
|
@ -0,0 +1,687 @@
|
|||
,Predicted_censored
|
||||
1,1
|
||||
2,1
|
||||
3,2
|
||||
4,1
|
||||
5,2
|
||||
6,2
|
||||
7,1
|
||||
8,1
|
||||
9,2
|
||||
10,1
|
||||
11,2
|
||||
12,2
|
||||
13,1
|
||||
14,1
|
||||
15,1
|
||||
16,1
|
||||
17,2
|
||||
18,1
|
||||
19,1
|
||||
20,2
|
||||
21,1
|
||||
22,1
|
||||
23,1
|
||||
24,1
|
||||
25,2
|
||||
26,2
|
||||
27,2
|
||||
28,1
|
||||
29,1
|
||||
30,1
|
||||
31,1
|
||||
32,1
|
||||
33,1
|
||||
34,1
|
||||
35,2
|
||||
36,1
|
||||
37,2
|
||||
38,1
|
||||
39,1
|
||||
40,2
|
||||
41,2
|
||||
42,2
|
||||
43,2
|
||||
44,2
|
||||
45,2
|
||||
46,1
|
||||
47,1
|
||||
48,2
|
||||
49,1
|
||||
50,2
|
||||
51,1
|
||||
52,1
|
||||
53,1
|
||||
54,2
|
||||
55,2
|
||||
56,2
|
||||
57,1
|
||||
58,1
|
||||
59,1
|
||||
60,1
|
||||
61,2
|
||||
62,1
|
||||
63,2
|
||||
64,1
|
||||
65,1
|
||||
66,2
|
||||
67,2
|
||||
68,2
|
||||
69,2
|
||||
70,2
|
||||
71,2
|
||||
72,1
|
||||
73,2
|
||||
74,2
|
||||
75,2
|
||||
76,2
|
||||
77,1
|
||||
78,2
|
||||
79,2
|
||||
80,2
|
||||
81,2
|
||||
82,2
|
||||
83,2
|
||||
84,2
|
||||
85,2
|
||||
86,2
|
||||
87,2
|
||||
88,2
|
||||
89,2
|
||||
90,2
|
||||
91,2
|
||||
92,1
|
||||
93,1
|
||||
94,1
|
||||
95,2
|
||||
96,1
|
||||
97,2
|
||||
98,2
|
||||
99,1
|
||||
100,1
|
||||
101,2
|
||||
102,1
|
||||
103,2
|
||||
104,1
|
||||
105,2
|
||||
106,1
|
||||
107,1
|
||||
108,2
|
||||
109,1
|
||||
110,1
|
||||
111,1
|
||||
112,1
|
||||
113,2
|
||||
114,2
|
||||
115,2
|
||||
116,2
|
||||
117,2
|
||||
118,2
|
||||
119,2
|
||||
120,2
|
||||
121,2
|
||||
122,2
|
||||
123,1
|
||||
124,1
|
||||
125,1
|
||||
126,2
|
||||
127,2
|
||||
128,2
|
||||
129,1
|
||||
130,1
|
||||
131,1
|
||||
132,2
|
||||
133,1
|
||||
134,2
|
||||
135,2
|
||||
136,2
|
||||
137,2
|
||||
138,1
|
||||
139,1
|
||||
140,2
|
||||
141,2
|
||||
142,2
|
||||
143,2
|
||||
144,1
|
||||
145,2
|
||||
146,2
|
||||
147,1
|
||||
148,2
|
||||
149,2
|
||||
150,1
|
||||
151,2
|
||||
152,2
|
||||
153,2
|
||||
154,2
|
||||
155,2
|
||||
156,2
|
||||
157,2
|
||||
158,2
|
||||
159,1
|
||||
160,2
|
||||
161,1
|
||||
162,1
|
||||
163,1
|
||||
164,2
|
||||
165,1
|
||||
166,2
|
||||
167,2
|
||||
168,1
|
||||
169,1
|
||||
170,2
|
||||
171,2
|
||||
172,2
|
||||
173,2
|
||||
174,1
|
||||
175,1
|
||||
176,2
|
||||
177,1
|
||||
178,1
|
||||
179,2
|
||||
180,2
|
||||
181,1
|
||||
182,1
|
||||
183,1
|
||||
184,1
|
||||
185,1
|
||||
186,1
|
||||
187,2
|
||||
188,1
|
||||
189,2
|
||||
190,2
|
||||
191,1
|
||||
192,1
|
||||
193,2
|
||||
194,1
|
||||
195,1
|
||||
196,1
|
||||
197,2
|
||||
198,1
|
||||
199,2
|
||||
200,2
|
||||
201,1
|
||||
202,1
|
||||
203,1
|
||||
204,2
|
||||
205,2
|
||||
206,2
|
||||
207,2
|
||||
208,1
|
||||
209,1
|
||||
210,2
|
||||
211,2
|
||||
212,2
|
||||
213,2
|
||||
214,2
|
||||
215,2
|
||||
216,1
|
||||
217,2
|
||||
218,2
|
||||
219,2
|
||||
220,2
|
||||
221,2
|
||||
222,1
|
||||
223,1
|
||||
224,2
|
||||
225,1
|
||||
226,1
|
||||
227,2
|
||||
228,2
|
||||
229,2
|
||||
230,1
|
||||
231,1
|
||||
232,2
|
||||
233,2
|
||||
234,2
|
||||
235,2
|
||||
236,1
|
||||
237,2
|
||||
238,2
|
||||
239,1
|
||||
240,1
|
||||
241,1
|
||||
242,1
|
||||
243,2
|
||||
244,2
|
||||
245,2
|
||||
246,2
|
||||
247,1
|
||||
248,2
|
||||
249,1
|
||||
250,1
|
||||
251,1
|
||||
252,1
|
||||
253,2
|
||||
254,2
|
||||
255,1
|
||||
256,2
|
||||
257,2
|
||||
258,2
|
||||
259,2
|
||||
260,2
|
||||
261,1
|
||||
262,2
|
||||
263,1
|
||||
264,1
|
||||
265,2
|
||||
266,1
|
||||
267,2
|
||||
268,2
|
||||
269,1
|
||||
270,2
|
||||
271,1
|
||||
272,1
|
||||
273,2
|
||||
274,1
|
||||
275,1
|
||||
276,2
|
||||
277,1
|
||||
278,1
|
||||
279,1
|
||||
280,1
|
||||
281,1
|
||||
282,1
|
||||
283,1
|
||||
284,2
|
||||
285,1
|
||||
286,1
|
||||
287,1
|
||||
288,2
|
||||
289,1
|
||||
290,1
|
||||
291,1
|
||||
292,1
|
||||
293,1
|
||||
294,1
|
||||
295,1
|
||||
296,2
|
||||
297,1
|
||||
298,1
|
||||
299,1
|
||||
300,2
|
||||
301,1
|
||||
302,1
|
||||
303,2
|
||||
304,1
|
||||
305,2
|
||||
306,1
|
||||
307,1
|
||||
308,2
|
||||
309,2
|
||||
310,2
|
||||
311,2
|
||||
312,2
|
||||
313,2
|
||||
314,2
|
||||
315,2
|
||||
316,2
|
||||
317,2
|
||||
318,2
|
||||
319,1
|
||||
320,2
|
||||
321,2
|
||||
322,2
|
||||
323,1
|
||||
324,1
|
||||
325,2
|
||||
326,2
|
||||
327,2
|
||||
328,1
|
||||
329,2
|
||||
330,1
|
||||
331,2
|
||||
332,2
|
||||
333,2
|
||||
334,2
|
||||
335,2
|
||||
336,2
|
||||
337,1
|
||||
338,1
|
||||
339,2
|
||||
340,2
|
||||
341,1
|
||||
342,1
|
||||
343,2
|
||||
344,2
|
||||
345,2
|
||||
346,2
|
||||
347,1
|
||||
348,2
|
||||
349,2
|
||||
350,1
|
||||
351,2
|
||||
352,1
|
||||
353,2
|
||||
354,2
|
||||
355,2
|
||||
356,2
|
||||
357,2
|
||||
358,1
|
||||
359,1
|
||||
360,2
|
||||
361,2
|
||||
362,1
|
||||
363,1
|
||||
364,1
|
||||
365,1
|
||||
366,1
|
||||
367,2
|
||||
368,1
|
||||
369,1
|
||||
370,1
|
||||
371,1
|
||||
372,2
|
||||
373,2
|
||||
374,2
|
||||
375,1
|
||||
376,1
|
||||
377,1
|
||||
378,1
|
||||
379,2
|
||||
380,2
|
||||
381,1
|
||||
382,2
|
||||
383,1
|
||||
384,2
|
||||
385,1
|
||||
386,1
|
||||
387,2
|
||||
388,2
|
||||
389,2
|
||||
390,2
|
||||
391,1
|
||||
392,2
|
||||
393,2
|
||||
394,1
|
||||
395,2
|
||||
396,2
|
||||
397,2
|
||||
398,2
|
||||
399,1
|
||||
400,1
|
||||
401,2
|
||||
402,1
|
||||
403,1
|
||||
404,1
|
||||
405,1
|
||||
406,2
|
||||
407,2
|
||||
408,1
|
||||
409,2
|
||||
410,1
|
||||
411,2
|
||||
412,2
|
||||
413,1
|
||||
414,1
|
||||
415,1
|
||||
416,2
|
||||
417,1
|
||||
418,1
|
||||
419,1
|
||||
420,2
|
||||
421,2
|
||||
422,2
|
||||
423,2
|
||||
424,2
|
||||
425,2
|
||||
426,2
|
||||
427,2
|
||||
428,2
|
||||
429,1
|
||||
430,1
|
||||
431,2
|
||||
432,1
|
||||
433,1
|
||||
434,1
|
||||
435,2
|
||||
436,2
|
||||
437,2
|
||||
438,2
|
||||
439,2
|
||||
440,2
|
||||
441,2
|
||||
442,1
|
||||
443,2
|
||||
444,1
|
||||
445,1
|
||||
446,1
|
||||
447,2
|
||||
448,2
|
||||
449,2
|
||||
450,2
|
||||
451,1
|
||||
452,2
|
||||
453,2
|
||||
454,1
|
||||
455,2
|
||||
456,1
|
||||
457,2
|
||||
458,2
|
||||
459,2
|
||||
460,1
|
||||
461,2
|
||||
462,2
|
||||
463,2
|
||||
464,2
|
||||
465,2
|
||||
466,2
|
||||
467,2
|
||||
468,1
|
||||
469,1
|
||||
470,1
|
||||
471,1
|
||||
472,1
|
||||
473,2
|
||||
474,1
|
||||
475,1
|
||||
476,1
|
||||
477,1
|
||||
478,1
|
||||
479,1
|
||||
480,1
|
||||
481,1
|
||||
482,1
|
||||
483,1
|
||||
484,2
|
||||
485,1
|
||||
486,2
|
||||
487,1
|
||||
488,1
|
||||
489,1
|
||||
490,2
|
||||
491,2
|
||||
492,2
|
||||
493,2
|
||||
494,1
|
||||
495,1
|
||||
496,2
|
||||
497,1
|
||||
498,2
|
||||
499,2
|
||||
500,1
|
||||
501,2
|
||||
502,2
|
||||
503,1
|
||||
504,1
|
||||
505,2
|
||||
506,2
|
||||
507,2
|
||||
508,2
|
||||
509,2
|
||||
510,2
|
||||
511,2
|
||||
512,2
|
||||
513,2
|
||||
514,2
|
||||
515,2
|
||||
516,2
|
||||
517,2
|
||||
518,1
|
||||
519,1
|
||||
520,1
|
||||
521,2
|
||||
522,1
|
||||
523,2
|
||||
524,1
|
||||
525,2
|
||||
526,1
|
||||
527,1
|
||||
528,2
|
||||
529,2
|
||||
530,2
|
||||
531,2
|
||||
532,2
|
||||
533,2
|
||||
534,2
|
||||
535,2
|
||||
536,2
|
||||
537,2
|
||||
538,2
|
||||
539,2
|
||||
540,1
|
||||
541,2
|
||||
542,2
|
||||
543,1
|
||||
544,2
|
||||
545,2
|
||||
546,2
|
||||
547,2
|
||||
548,2
|
||||
549,2
|
||||
550,2
|
||||
551,2
|
||||
552,2
|
||||
553,2
|
||||
554,2
|
||||
555,2
|
||||
556,2
|
||||
557,2
|
||||
558,2
|
||||
559,2
|
||||
560,2
|
||||
561,1
|
||||
562,2
|
||||
563,2
|
||||
564,1
|
||||
565,2
|
||||
566,2
|
||||
567,2
|
||||
568,1
|
||||
569,2
|
||||
570,2
|
||||
571,1
|
||||
572,1
|
||||
573,1
|
||||
574,2
|
||||
575,2
|
||||
576,1
|
||||
577,1
|
||||
578,2
|
||||
579,1
|
||||
580,2
|
||||
581,2
|
||||
582,2
|
||||
583,1
|
||||
584,1
|
||||
585,1
|
||||
586,2
|
||||
587,1
|
||||
588,2
|
||||
589,1
|
||||
590,1
|
||||
591,2
|
||||
592,2
|
||||
593,1
|
||||
594,2
|
||||
595,1
|
||||
596,2
|
||||
597,2
|
||||
598,2
|
||||
599,2
|
||||
600,2
|
||||
601,2
|
||||
602,2
|
||||
603,2
|
||||
604,2
|
||||
605,1
|
||||
606,2
|
||||
607,1
|
||||
608,2
|
||||
609,1
|
||||
610,2
|
||||
611,2
|
||||
612,2
|
||||
613,2
|
||||
614,2
|
||||
615,1
|
||||
616,2
|
||||
617,2
|
||||
618,2
|
||||
619,2
|
||||
620,2
|
||||
621,2
|
||||
622,2
|
||||
623,2
|
||||
624,2
|
||||
625,2
|
||||
626,2
|
||||
627,2
|
||||
628,2
|
||||
629,1
|
||||
630,1
|
||||
631,1
|
||||
632,1
|
||||
633,2
|
||||
634,2
|
||||
635,1
|
||||
636,1
|
||||
637,1
|
||||
638,2
|
||||
639,2
|
||||
640,2
|
||||
641,2
|
||||
642,2
|
||||
643,1
|
||||
644,1
|
||||
645,2
|
||||
646,2
|
||||
647,2
|
||||
648,2
|
||||
649,1
|
||||
650,1
|
||||
651,2
|
||||
652,1
|
||||
653,1
|
||||
654,1
|
||||
655,1
|
||||
656,1
|
||||
657,1
|
||||
658,1
|
||||
659,1
|
||||
660,1
|
||||
661,1
|
||||
662,1
|
||||
663,2
|
||||
664,1
|
||||
665,1
|
||||
666,2
|
||||
667,1
|
||||
668,1
|
||||
669,2
|
||||
670,1
|
||||
671,1
|
||||
672,1
|
||||
673,2
|
||||
674,2
|
||||
675,1
|
||||
676,2
|
||||
677,2
|
||||
678,2
|
||||
679,2
|
||||
680,2
|
||||
681,2
|
||||
682,2
|
||||
683,2
|
||||
684,2
|
||||
685,2
|
||||
686,1
|
|
|
@ -0,0 +1,185 @@
|
|||
#region Copyright Syncfusion Inc. 2001-2018.
|
||||
// Copyright Syncfusion Inc. 2001-2018. All rights reserved.
|
||||
// Use of this code is subject to the terms of our license.
|
||||
// A copy of the current license can be obtained at any time by e-mailing
|
||||
// licensing@syncfusion.com. Any infringement will be prosecuted under
|
||||
// applicable laws.
|
||||
#endregion
|
||||
using Syncfusion.PMML;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
namespace BreastCancerKMeans
|
||||
{
|
||||
/// <summary>
|
||||
/// Console program to demonstrate PMML execution engine
|
||||
/// </summary>
|
||||
public class Program
|
||||
{
|
||||
//Create Table instance for input, output and R Result
|
||||
public Table inputTable = null;
|
||||
private Table outputTable = null;
|
||||
private Table rResults = null;
|
||||
|
||||
#if CONSOLE
|
||||
|
||||
private static void Main(string[] args)
|
||||
{
|
||||
//Create instance
|
||||
Program program = new Program();
|
||||
//Load input csv
|
||||
program.inputTable = new Table("../../Model/BreastCancer.csv", true, ',');
|
||||
//Invoke PredictResult
|
||||
program.outputTable = program.PredictResult(program.inputTable,
|
||||
"../../Model/BreastCancer.pmml");
|
||||
//Dispose the inputTable values
|
||||
program.inputTable.Dispose();
|
||||
//Compare predicted results of PMML execution engine with R Results
|
||||
program.ComparePredictedResultsWithR("../../Model/ROutput.csv");
|
||||
//Write the Result as CSV File
|
||||
program.outputTable.WriteToCSV("../../Model/PredictedOutput.csv", true, ',');
|
||||
//Dispose the output Table
|
||||
program.outputTable.Dispose();
|
||||
//Display the result saved location
|
||||
Console.WriteLine("\nResult saved in : " + Path.GetFullPath("../../Model/PredictedOutput.csv"));
|
||||
Console.ReadKey();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#region PredictResult
|
||||
|
||||
/// <summary>
|
||||
/// Predicts the results for given PMML and CSV file and serialize the results in a CSV file
|
||||
/// </summary>
|
||||
public Table PredictResult(Table inputTable, string pmmlPath)
|
||||
{
|
||||
//Get PMML Evaluator instance
|
||||
PMMLEvaluator evaluator = new PMMLEvaluatorFactory().
|
||||
GetPMMLEvaluatorInstance(pmmlPath);
|
||||
|
||||
string[] predictedCategories = null;
|
||||
|
||||
//Predict the value for each record using the PMML Evaluator instance
|
||||
for (int i = 0; i < inputTable.RowCount; i++)
|
||||
{
|
||||
var breastCancer = GetDataObject(inputTable, i);
|
||||
|
||||
//Get result
|
||||
PredictedResult predictedResult = evaluator.GetResult(breastCancer, null);
|
||||
|
||||
if (i == 0)
|
||||
{
|
||||
//Get the predicted propability fields
|
||||
predictedCategories = predictedResult.GetPredictedCategories();
|
||||
//Initialize the output table
|
||||
InitializeTable(inputTable.RowCount, predictedCategories);
|
||||
}
|
||||
|
||||
//Add predicted value
|
||||
outputTable[i, 0] = predictedResult.PredictedValue;
|
||||
}
|
||||
|
||||
return outputTable;
|
||||
}
|
||||
|
||||
#endregion PredictResult
|
||||
|
||||
#region Compare Predicted Results With R
|
||||
|
||||
/// <summary>
|
||||
/// Compare predicted results of PMML execution engine with R results
|
||||
/// </summary>
|
||||
|
||||
public void ComparePredictedResultsWithR(string rOutputDataCSVPath)
|
||||
{
|
||||
//Create instance to hold results of R
|
||||
rResults = new Table(rOutputDataCSVPath, true, ',');
|
||||
string differentIndices = string.Empty;
|
||||
//Pass the Table to the compare method of resultTable
|
||||
bool isDifferent = Compare(rResults, 1, 0, ref differentIndices);
|
||||
#if CONSOLE
|
||||
//Display mismatched index
|
||||
if (isDifferent)
|
||||
{
|
||||
Console.WriteLine("\nDifference in predicted results by R and PMML execution engine");
|
||||
Console.WriteLine("\nDifferent indices are " + differentIndices);
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("\nBoth predicted results by R and PMML execution engine are equal");
|
||||
}
|
||||
#endif
|
||||
//Dispose the R results Table
|
||||
rResults.Dispose();
|
||||
}
|
||||
|
||||
#endregion Compare Predicted Results With R
|
||||
|
||||
#region Initialize OutputTable
|
||||
|
||||
/// <summary>
|
||||
/// Initialize the outputTable
|
||||
/// </summary>
|
||||
/// <param name="rowCount">rowCount of output table</param>
|
||||
/// <param name="predictedfield">predictedfield name</param>
|
||||
/// <param name="predictedCategories">probableFields</param>
|
||||
private void InitializeTable(int rowCount, string[] predictedCategories)
|
||||
{
|
||||
//Create instance to hold evaluated results
|
||||
outputTable = new Table(rowCount, predictedCategories.Length + 1);
|
||||
//Add predicted column names
|
||||
outputTable.ColumnNames[0] = "Predicted_Cluster";
|
||||
}
|
||||
|
||||
#endregion Initialize OutputTable
|
||||
|
||||
#region GetDataObject
|
||||
|
||||
/// <summary>
|
||||
/// Returns the row as anonymous object
|
||||
/// </summary>
|
||||
/// <param name="inputTable"> input Table values</param>
|
||||
/// <param name="row">input row</param>
|
||||
/// <returns>Anonymous object</returns>
|
||||
public Dictionary<string, object> GetDataObject(Table inputTable, int row)
|
||||
{
|
||||
Dictionary<string, object> breastCancer = new Dictionary<string, object>();
|
||||
for (int i = 0; i < inputTable.ColumnCount; i++)
|
||||
{
|
||||
breastCancer.Add(inputTable.ColumnNames[i], inputTable[row, inputTable.ColumnNames[i]]);
|
||||
}
|
||||
return breastCancer;
|
||||
}
|
||||
|
||||
#endregion GetDataObject
|
||||
|
||||
#region Compare
|
||||
|
||||
/// <summary>
|
||||
/// Compares the result of 2 Tables based on column index.
|
||||
/// </summary>
|
||||
/// <param name="rOutput">R output table</param>
|
||||
/// <param name="rColumnIndex">R's Column to be compared</param>
|
||||
/// <param name="predictedColumnIndex">predicted result's column index</param>
|
||||
/// <param name="differentIndices"> different indices</param>
|
||||
public bool Compare(Table table, int rColumnIndex, int predictedColumnIndex, ref string differentIndices)
|
||||
{
|
||||
bool isDifferent = false;
|
||||
//Compare predicted values
|
||||
for (int i = 0; i < table.RowCount; i++)
|
||||
{
|
||||
//Compare Results based on column index
|
||||
if (outputTable[i, predictedColumnIndex].ToString() != table[i, rColumnIndex].ToString())
|
||||
{
|
||||
differentIndices += ", " + i;
|
||||
isDifferent = true;
|
||||
}
|
||||
}
|
||||
return isDifferent;
|
||||
}
|
||||
|
||||
#endregion Compare
|
||||
}
|
||||
}
|
|
@ -0,0 +1,75 @@
|
|||
# Copyright Syncfusion Inc. 2001 - 2016. All rights reserved.
|
||||
# Use of this code is subject to the terms of our license.
|
||||
# A copy of the current license can be obtained at any time by e-mailing
|
||||
# licensing@syncfusion.com. Any infringement will be prosecuted under
|
||||
# applicable laws.
|
||||
|
||||
|
||||
# If you are not familiar with R you can obtain a quick introduction by downloading
|
||||
# R Succinctly for free from Syncfusion - http://www.syncfusion.com/resources/techportal/ebooks/rsuccinctly
|
||||
# R Succinctly is also included with this installation and is available here
|
||||
# Installed Drive :\Program Files (x86)\Syncfusion\Essential Studio\XX.X.X.XX\Infrastructure\EBooks\R_Succintly.pdf OF R Succinctly
|
||||
# Uncomment below lines to install necessary packages if not installed already
|
||||
# install.packages("rattle")
|
||||
# install.packages("pmml")
|
||||
# install.packages("MASS")
|
||||
|
||||
# Load below packages
|
||||
library(rattle)
|
||||
library(pmml)
|
||||
library(MASS) # This package is specifically loaded for fgl dataset shipped within it.
|
||||
|
||||
# Here we directly load the fgl dataset installed with the "MASS" package.
|
||||
data(fgl)
|
||||
|
||||
# rename column names for fgl dataset from MASS package
|
||||
glassOriginal <- setNames(fgl, c("Refractive_Index", "Sodium", "Magnesium", "Aluminium", "Silicon", "Potassium", "Calcium", "Barium", "Iron", "Type"))
|
||||
|
||||
# Omit rows with missing values
|
||||
glassOriginal <- na.omit(glassOriginal)
|
||||
|
||||
# Code below demonstrates loading the same dataset from a CSV file shipped with our installer.
|
||||
# Please check installed samples (Data) location to set actual working directory
|
||||
# Uncomment below lines and comment out the code to read data from CSV file.
|
||||
# setwd("C:/actual_data_location")
|
||||
# glass<- read.csv("Glass.csv")
|
||||
|
||||
# Get numeric fields data of glass
|
||||
numericGlassData <- glassOriginal[,c("Refractive_Index", "Sodium", "Magnesium", "Aluminium", "Silicon", "Potassium", "Calcium", "Barium", "Iron")]
|
||||
|
||||
# Randomizing data
|
||||
glass<- numericGlassData[sample(nrow(numericGlassData)),]
|
||||
|
||||
# Divide dataset for training and test
|
||||
trainData<-glass[1:171,]
|
||||
testData<-glass[172:214,]
|
||||
|
||||
# Applying KMeans Clustering algorithm with centroids "6"
|
||||
glass_KMeans <- kmeans(trainData,6)
|
||||
glass_KMeans
|
||||
|
||||
# Predict "Type" column for test data set
|
||||
glassTestPrediction<-predict(glass_KMeans,testData)
|
||||
# Display predicted values
|
||||
glassTestPrediction
|
||||
|
||||
|
||||
# PMML generation
|
||||
pmmlFile<-pmml(glass_KMeans,data=trainData)
|
||||
write(toString(pmmlFile),file="Glass.pmml")
|
||||
saveXML(pmmlFile,file="Glass.pmml")
|
||||
|
||||
# The code below is used for evaluation purpose.
|
||||
# The model is applied for original fgl data set and predicted results are saved in "ROuput.csv"
|
||||
# "ROuput.csv" file used for comparing the R results with PMML Evaluation engine results
|
||||
|
||||
# Applying KMeans Clustering algorithm to entire dataset and save the results in a CSV file
|
||||
glassEntirePrediction<-predict(glass_KMeans,numericGlassData)
|
||||
glassEntirePrediction
|
||||
|
||||
# Save predicted value in a data frame
|
||||
result <- data.frame(glassEntirePrediction)
|
||||
names(result) <- c("Predicted_Type")
|
||||
|
||||
# Write the results in a CSV file
|
||||
write.csv(result,"ROutput.csv",quote=F)
|
|
@ -0,0 +1,215 @@
|
|||
Refractive_Index,Sodium,Magnesium,Aluminium,Silicon,Potassium,Calcium,Barium,Iron,Type
|
||||
3.01,13.64,4.49,1.1,71.78,0.06,8.75,0,0,WinF
|
||||
-0.39,13.89,3.6,1.36,72.73,0.48,7.83,0,0,WinF
|
||||
-1.82,13.53,3.55,1.54,72.99,0.39,7.78,0,0,WinF
|
||||
-0.34,13.21,3.69,1.29,72.61,0.57,8.22,0,0,WinF
|
||||
-0.58,13.27,3.62,1.24,73.08,0.55,8.07,0,0,WinF
|
||||
-2.04,12.79,3.61,1.62,72.97,0.64,8.07,0,0.26,WinF
|
||||
-0.57,13.3,3.6,1.14,73.09,0.58,8.17,0,0,WinF
|
||||
-0.44,13.15,3.61,1.05,73.24,0.57,8.24,0,0,WinF
|
||||
1.18,14.04,3.58,1.37,72.08,0.56,8.3,0,0,WinF
|
||||
-0.45,13,3.6,1.36,72.99,0.57,8.4,0,0.11,WinF
|
||||
-2.29,12.72,3.46,1.56,73.2,0.67,8.09,0,0.24,WinF
|
||||
-0.37,12.8,3.66,1.27,73.01,0.6,8.56,0,0,WinF
|
||||
-2.11,12.88,3.43,1.4,73.28,0.69,8.05,0,0.24,WinF
|
||||
-0.52,12.86,3.56,1.27,73.21,0.54,8.38,0,0.17,WinF
|
||||
-0.37,12.61,3.59,1.31,73.29,0.58,8.5,0,0,WinF
|
||||
-0.39,12.81,3.54,1.23,73.24,0.58,8.39,0,0,WinF
|
||||
-0.16,12.68,3.67,1.16,73.11,0.61,8.7,0,0,WinF
|
||||
3.96,14.36,3.85,0.89,71.36,0.15,9.15,0,0,WinF
|
||||
1.11,13.9,3.73,1.18,72.12,0.06,8.89,0,0,WinF
|
||||
-0.65,13.02,3.54,1.69,72.73,0.54,8.44,0,0.07,WinF
|
||||
-0.5,12.82,3.55,1.49,72.75,0.54,8.52,0,0.19,WinF
|
||||
1.66,14.77,3.75,0.29,72.02,0.03,9,0,0,WinF
|
||||
-0.64,12.78,3.62,1.29,72.79,0.59,8.7,0,0,WinF
|
||||
-0.49,12.81,3.57,1.35,73.02,0.62,8.59,0,0,WinF
|
||||
-0.8,13.38,3.5,1.15,72.85,0.5,8.43,0,0,WinF
|
||||
-0.36,12.98,3.54,1.21,73,0.65,8.53,0,0,WinF
|
||||
-0.07,13.21,3.48,1.41,72.64,0.59,8.43,0,0,WinF
|
||||
-0.79,12.87,3.48,1.33,73.04,0.56,8.43,0,0,WinF
|
||||
-0.32,12.56,3.52,1.43,73.15,0.57,8.54,0,0,WinF
|
||||
-0.16,13.08,3.49,1.28,72.86,0.6,8.49,0,0,WinF
|
||||
-0.32,12.65,3.56,1.3,73.08,0.61,8.69,0,0.14,WinF
|
||||
-0.53,12.84,3.5,1.14,73.27,0.56,8.55,0,0,WinF
|
||||
-0.25,12.85,3.48,1.23,72.97,0.61,8.56,0.09,0.22,WinF
|
||||
-0.47,12.57,3.47,1.38,73.39,0.6,8.55,0,0.06,WinF
|
||||
-0.17,12.69,3.54,1.34,72.95,0.57,8.75,0,0,WinF
|
||||
-2.33,13.29,3.45,1.21,72.74,0.56,8.57,0,0,WinF
|
||||
1.09,13.89,3.53,1.32,71.81,0.51,8.78,0.11,0,WinF
|
||||
-0.03,12.74,3.48,1.35,72.96,0.64,8.68,0,0,WinF
|
||||
4.13,14.21,3.82,0.47,71.77,0.11,9.57,0,0,WinF
|
||||
4.13,14.21,3.82,0.47,71.77,0.11,9.57,0,0,WinF
|
||||
-0.07,12.79,3.5,1.12,73.03,0.64,8.77,0,0,WinF
|
||||
-0.45,12.71,3.42,1.2,73.2,0.59,8.64,0,0,WinF
|
||||
-0.21,13.21,3.39,1.33,72.76,0.59,8.59,0,0,WinF
|
||||
4.1,13.73,3.84,0.72,71.76,0.17,9.74,0,0,WinF
|
||||
-0.14,12.73,3.43,1.19,72.95,0.62,8.76,0,0.3,WinF
|
||||
1,13.49,3.48,1.35,71.95,0.55,9,0,0,WinF
|
||||
0.69,13.19,3.37,1.18,72.72,0.57,8.83,0,0.16,WinF
|
||||
8.67,13.99,3.7,0.71,71.57,0.02,9.82,0,0.1,WinF
|
||||
4.23,13.21,3.77,0.79,71.99,0.13,10.02,0,0,WinF
|
||||
0.98,13.58,3.35,1.23,72.08,0.59,8.91,0,0,WinF
|
||||
5.2,13.72,3.72,0.51,71.75,0.09,10.06,0,0.16,WinF
|
||||
1.26,13.2,3.33,1.28,72.36,0.6,9.14,0,0.11,WinF
|
||||
0.08,13.43,2.87,1.19,72.84,0.55,9.03,0,0,WinF
|
||||
0.37,13.14,2.84,1.28,72.85,0.55,9.07,0,0,WinF
|
||||
-0.22,13.21,2.81,1.29,72.98,0.51,9.02,0,0.09,WinF
|
||||
-0.31,12.45,2.71,1.29,73.7,0.56,9.06,0,0.24,WinF
|
||||
-5.85,12.99,3.47,1.12,72.98,0.62,8.35,0,0.31,WinF
|
||||
0.24,12.87,3.48,1.29,72.95,0.6,8.43,0,0,WinF
|
||||
-0.46,13.48,3.74,1.17,72.99,0.59,8.03,0,0,WinF
|
||||
-0.46,13.39,3.66,1.19,72.79,0.57,8.27,0,0.11,WinF
|
||||
1.05,13.6,3.62,1.11,72.64,0.14,8.76,0,0,WinF
|
||||
1.77,13.81,3.58,1.32,71.72,0.12,8.67,0.69,0,WinF
|
||||
3.72,13.51,3.86,0.88,71.79,0.23,9.54,0,0.11,WinF
|
||||
4.27,14.17,3.81,0.78,71.35,0,9.69,0,0,WinF
|
||||
3.72,13.48,3.74,0.9,72.01,0.18,9.61,0,0.07,WinF
|
||||
2.99,13.69,3.59,1.12,71.96,0.09,9.4,0,0,WinF
|
||||
3.52,13.05,3.65,0.87,72.22,0.19,9.85,0,0.17,WinF
|
||||
3.52,13.05,3.65,0.87,72.32,0.19,9.85,0,0.17,WinF
|
||||
3.52,13.12,3.58,0.9,72.2,0.23,9.82,0,0.16,WinF
|
||||
5,13.31,3.58,0.82,71.99,0.12,10.17,0,0.03,WinF
|
||||
-2.26,14.86,3.67,1.74,71.87,0.16,7.36,0,0.12,WinNF
|
||||
0.48,13.64,3.87,1.27,71.96,0.54,8.32,0,0.32,WinNF
|
||||
-2.07,13.09,3.59,1.52,73.1,0.67,7.83,0,0,WinNF
|
||||
-1.69,13.34,3.57,1.57,72.87,0.61,7.89,0,0,WinNF
|
||||
-2.04,13.02,3.56,1.54,73.11,0.72,7.9,0,0,WinNF
|
||||
-2.1,13.02,3.58,1.51,73.12,0.69,7.96,0,0,WinNF
|
||||
-1.55,13.44,3.61,1.54,72.39,0.66,8.03,0,0,WinNF
|
||||
-1.73,13,3.58,1.54,72.83,0.61,8.04,0,0,WinNF
|
||||
-1.87,13.92,3.52,1.25,72.88,0.37,7.94,0,0.14,WinNF
|
||||
-2.1,12.82,3.52,1.9,72.86,0.69,7.97,0,0,WinNF
|
||||
-2.08,12.86,3.52,2.12,72.66,0.69,7.97,0,0,WinNF
|
||||
-2.07,13.25,3.45,1.43,73.17,0.61,7.86,0,0,WinNF
|
||||
-1.54,13.41,3.55,1.25,72.81,0.68,8.1,0,0,WinNF
|
||||
-2.06,13.09,3.52,1.55,72.87,0.68,8.05,0,0.09,WinNF
|
||||
-3.91,14.25,3.09,2.08,72.28,1.1,7.08,0,0,WinNF
|
||||
-1.75,13.36,3.58,1.49,72.72,0.45,8.21,0,0,WinNF
|
||||
-2.31,13.24,3.49,1.47,73.25,0.38,8.03,0,0,WinNF
|
||||
-1.55,13.4,3.49,1.52,72.65,0.67,8.08,0,0.1,WinNF
|
||||
-1.82,13.01,3.5,1.48,72.89,0.6,8.12,0,0,WinNF
|
||||
-1.6,12.55,3.48,1.87,73.23,0.63,8.08,0,0.09,WinNF
|
||||
0.41,12.93,3.74,1.11,72.28,0.64,8.96,0,0.22,WinNF
|
||||
-1.95,12.9,3.44,1.45,73.06,0.44,8.27,0,0,WinNF
|
||||
-2.12,13.12,3.41,1.58,73.26,0.07,8.39,0,0.19,WinNF
|
||||
-2.1,13.24,3.34,1.47,73.1,0.39,8.22,0,0,WinNF
|
||||
-1.71,12.71,3.33,1.49,73.28,0.67,8.24,0,0,WinNF
|
||||
0.6,13.36,3.43,1.43,72.26,0.51,8.6,0,0,WinNF
|
||||
0.41,13.02,3.62,1.06,72.34,0.64,9.13,0,0.15,WinNF
|
||||
-0.57,12.2,3.25,1.16,73.55,0.62,8.9,0,0.24,WinNF
|
||||
-1.11,12.67,2.88,1.71,73.21,0.73,8.54,0,0,WinNF
|
||||
0.11,12.96,2.96,1.43,72.92,0.6,8.79,0.14,0,WinNF
|
||||
-1.45,12.75,2.85,1.44,73.27,0.57,8.79,0.11,0.22,WinNF
|
||||
-0.7,12.35,2.72,1.63,72.87,0.7,9.23,0,0,WinNF
|
||||
0.2,12.62,2.76,0.83,73.81,0.35,9.42,0,0.2,WinNF
|
||||
9.25,13.8,3.15,0.66,70.57,0.08,11.64,0,0,WinNF
|
||||
6.1,13.83,2.9,1.17,71.15,0.08,10.79,0,0,WinNF
|
||||
6.75,11.45,0,1.88,72.19,0.81,13.24,0,0.34,WinNF
|
||||
13.25,10.73,0,2.1,69.81,0.58,13.3,3.15,0.28,WinNF
|
||||
15.93,12.3,0,1,70.16,0.12,16.19,0,0.24,WinNF
|
||||
4.22,14.43,0,1,72.67,0.1,11.52,0,0.08,WinNF
|
||||
0.18,13.72,0,0.56,74.45,0,10.99,0,0,WinNF
|
||||
8.64,11.23,0,0.77,73.21,0,14.68,0,0,WinNF
|
||||
9.39,11.02,0,0.75,73.08,0,14.96,0,0,WinNF
|
||||
9.77,12.64,0,0.67,72.02,0.06,14.4,0,0,WinNF
|
||||
0.92,13.46,3.83,1.26,72.55,0.57,8.21,0,0.14,WinNF
|
||||
0.47,13.1,3.97,1.19,72.44,0.6,8.43,0,0,WinNF
|
||||
0.46,13.41,3.89,1.33,72.38,0.51,8.28,0,0,WinNF
|
||||
0.29,13.24,3.9,1.41,72.33,0.55,8.31,0,0.1,WinNF
|
||||
-0.92,13.72,3.68,1.81,72.06,0.64,7.88,0,0,WinNF
|
||||
-1.27,13.3,3.64,1.53,72.53,0.65,8.03,0,0.29,WinNF
|
||||
-1.48,13.56,3.57,1.47,72.45,0.64,7.96,0,0,WinNF
|
||||
0.44,13.25,3.76,1.32,72.4,0.58,8.42,0,0,WinNF
|
||||
-1.37,12.93,3.54,1.62,72.96,0.64,8.03,0,0.21,WinNF
|
||||
-1.13,13.23,3.54,1.48,72.84,0.56,8.1,0,0,WinNF
|
||||
-0.93,13.48,3.48,1.71,72.52,0.62,7.99,0,0,WinNF
|
||||
3.77,13.2,3.68,1.15,72.75,0.54,8.52,0,0,WinNF
|
||||
0.72,12.93,3.66,1.56,72.51,0.58,8.55,0,0.12,WinNF
|
||||
-1.33,12.94,3.61,1.26,72.75,0.56,8.6,0,0,WinNF
|
||||
2.81,13.78,2.28,1.43,71.99,0.49,9.85,0,0.17,WinNF
|
||||
2.68,13.55,2.09,1.67,72.18,0.53,9.57,0.27,0.17,WinNF
|
||||
2.2,13.98,1.35,1.63,71.76,0.39,10.56,0,0.18,WinNF
|
||||
3.77,13.75,1.01,1.36,72.19,0.33,11.14,0,0,WinNF
|
||||
8.14,13.7,0,1.36,71.24,0.19,13.44,0,0.1,WinNF
|
||||
0.13,13.43,3.98,1.18,72.49,0.58,8.15,0,0,WinNF
|
||||
0,13.71,3.93,1.54,71.81,0.54,8.21,0,0.15,WinNF
|
||||
0.11,13.33,3.85,1.25,72.78,0.52,8.12,0,0,WinNF
|
||||
-0.11,13.19,3.9,1.3,72.33,0.55,8.44,0,0.28,WinNF
|
||||
0.06,13,3.8,1.08,73.07,0.56,8.38,0,0.12,WinNF
|
||||
-0.89,12.89,3.62,1.57,72.96,0.61,8.11,0,0,WinNF
|
||||
-1.26,12.79,3.52,1.54,73.36,0.66,7.9,0,0,WinNF
|
||||
-1.26,12.87,3.56,1.64,73.14,0.65,7.99,0,0,WinNF
|
||||
-1.1,13.33,3.54,1.61,72.54,0.68,8.11,0,0,WinNF
|
||||
0.51,13.2,3.63,1.07,72.83,0.57,8.41,0.09,0.17,WinNF
|
||||
-1.38,12.85,3.51,1.44,73.01,0.68,8.23,0.06,0.25,WinNF
|
||||
-0.91,13,3.47,1.79,72.72,0.66,8.18,0,0,WinNF
|
||||
-1.4,12.99,3.18,1.23,72.97,0.58,8.81,0,0.24,WinNF
|
||||
0.39,12.85,3.67,1.24,72.57,0.62,8.68,0,0.35,WinNF
|
||||
-0.31,13.65,3.66,1.11,72.77,0.11,8.6,0,0,Veh
|
||||
-1.9,13.33,3.53,1.34,72.67,0.56,8.33,0,0,Veh
|
||||
-1.3,13.24,3.57,1.38,72.7,0.56,8.44,0,0.1,Veh
|
||||
-1.57,12.16,3.52,1.35,72.89,0.57,8.53,0,0,Veh
|
||||
-1.35,13.14,3.45,1.76,72.48,0.6,8.38,0,0.17,Veh
|
||||
3.27,14.32,3.9,0.83,71.5,0,9.49,0,0,Veh
|
||||
-0.21,13.64,3.65,0.65,73,0.06,8.93,0,0,Veh
|
||||
-1.9,13.42,3.4,1.22,72.69,0.59,8.32,0,0,Veh
|
||||
-1.06,12.86,3.58,1.31,72.61,0.61,8.79,0,0,Veh
|
||||
-1.54,13.04,3.4,1.26,73.01,0.52,8.58,0,0,Veh
|
||||
-1.45,13.41,3.39,1.28,72.64,0.52,8.65,0,0,Veh
|
||||
3.21,14.03,3.76,0.58,71.79,0.11,9.65,0,0,Veh
|
||||
-0.24,13.53,3.41,1.52,72.04,0.58,8.79,0,0,Veh
|
||||
-0.04,13.5,3.36,1.63,71.94,0.57,8.81,0,0.09,Veh
|
||||
0.32,13.33,3.34,1.54,72.14,0.56,8.99,0,0,Veh
|
||||
1.34,13.64,3.54,0.75,72.65,0.16,8.89,0.15,0.24,Veh
|
||||
4.11,14.19,3.78,0.91,71.36,0.23,9.14,0,0.37,Veh
|
||||
-2.86,14.01,2.68,3.5,69.89,1.68,5.87,2.2,0,Con
|
||||
1.15,12.73,1.85,1.86,72.69,0.6,10.09,0,0,Con
|
||||
3.71,11.56,1.88,1.56,72.86,0.47,11.41,0,0,Con
|
||||
3.51,11.03,1.71,1.56,73.44,0.58,11.62,0,0,Con
|
||||
1.69,12.64,0,1.65,73.75,0.38,11.53,0,0,Con
|
||||
-1.34,12.86,0,1.83,73.88,0.97,10.17,0,0,Con
|
||||
1.94,13.27,0,1.76,73.03,0.47,11.32,0,0,Con
|
||||
5.69,13.44,0,1.58,72.22,0.32,12.24,0,0,Con
|
||||
-4.84,13.02,0,3.04,70.48,6.21,6.96,0,0,Con
|
||||
-4.79,13,0,3.02,70.7,6.21,6.93,0,0,Con
|
||||
2.43,13.38,0,1.4,72.25,0.33,12.5,0,0,Con
|
||||
2.58,12.85,1.61,2.17,72.18,0.76,9.7,0.24,0.51,Con
|
||||
3.19,12.97,0.33,1.51,73.39,0.13,11.27,0,0.28,Con
|
||||
1.05,14,2.39,1.56,72.37,0,9.57,0,0,Tabl
|
||||
1.37,13.79,2.41,1.19,72.76,0,9.77,0,0,Tabl
|
||||
0.29,14.46,2.24,1.62,72.38,0,9.26,0,0,Tabl
|
||||
0.52,14.09,2.19,1.66,72.67,0,9.32,0,0,Tabl
|
||||
-5.01,14.4,1.74,1.54,74.55,0,7.59,0,0,Tabl
|
||||
0.88,14.99,0.78,1.74,72.5,0,9.95,0,0,Tabl
|
||||
1.16,14.15,0,2.09,72.74,0,10.88,0,0,Tabl
|
||||
1.69,14.56,0,0.56,73.48,0,11.22,0,0,Tabl
|
||||
-6.85,17.38,0,0.34,75.41,0,6.65,0,0,Tabl
|
||||
-6.69,13.69,3.2,1.81,72.81,1.76,5.43,1.19,0,Head
|
||||
0.38,14.32,3.26,2.22,71.25,1.46,5.79,1.63,0,Head
|
||||
5.15,13.44,3.34,1.23,72.38,0.6,8.83,0,0,Head
|
||||
4.47,14.86,2.2,2.06,70.26,0.76,9.76,0,0,Head
|
||||
5.65,15.79,1.83,1.31,70.43,0.31,8.61,1.68,0,Head
|
||||
-1.87,13.88,1.78,1.79,73.1,0,8.67,0.76,0,Head
|
||||
-1.98,14.85,0,2.38,73.28,0,8.76,0.64,0.09,Head
|
||||
-1.77,14.2,0,2.79,73.46,0.04,9.04,0.4,0.09,Head
|
||||
-0.81,14.75,0,2,73.02,0,8.53,1.59,0.08,Head
|
||||
-1.17,14.56,0,1.98,73.29,0,8.52,1.57,0.07,Head
|
||||
-2.55,14.14,0,2.68,73.39,0.08,9.07,0.61,0.05,Head
|
||||
-2.44,13.87,0,2.54,73.23,0.14,9.41,0.81,0.01,Head
|
||||
-0.73,14.7,0,2.34,73.28,0,8.95,0.66,0,Head
|
||||
-2.69,14.38,0,2.66,73.1,0.04,9.08,0.64,0,Head
|
||||
-1.91,15.01,0,2.51,73.05,0.05,8.83,0.53,0,Head
|
||||
-2.92,15.15,0,2.25,73.5,0,8.34,0.63,0,Head
|
||||
-1.47,11.95,0,1.19,75.18,2.7,8.93,0,0,Head
|
||||
-2.86,14.85,0,2.42,73.72,0,8.39,0.56,0,Head
|
||||
-1.42,14.8,0,1.99,73.11,0,8.28,1.71,0,Head
|
||||
-1.83,14.95,0,2.27,73.3,0,8.71,0.67,0,Head
|
||||
-0.68,14.95,0,1.8,72.99,0,8.61,1.55,0,Head
|
||||
-1.55,14.94,0,1.87,73.11,0,8.67,1.38,0,Head
|
||||
0.31,14.39,0,1.82,72.86,1.41,6.47,2.88,0,Head
|
||||
-1.6,14.37,0,2.74,72.85,0,9.45,0.54,0,Head
|
||||
-1.77,14.14,0,2.88,72.61,0.08,9.18,1.06,0,Head
|
||||
-1.15,14.92,0,1.99,73.06,0,8.4,1.59,0,Head
|
||||
2.65,14.36,0,2.02,73.42,0,8.44,1.64,0,Head
|
||||
-1.49,14.38,0,1.94,73.61,0,8.48,1.57,0,Head
|
||||
-0.89,14.23,0,2.08,73.36,0,8.62,1.67,0,Head
|
|
|
@ -0,0 +1,71 @@
|
|||
<?xml version="1.0"?>
|
||||
<PMML version="4.3" xmlns="http://www.dmg.org/PMML-4_3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.dmg.org/PMML-4_3 http://www.dmg.org/pmml/v4-3/pmml-4-3.xsd">
|
||||
<Header copyright="Copyright (c) 2017 Syncfusion" description="KMeans cluster model">
|
||||
<Extension name="user" value="Syncfusion" extender="Rattle/PMML"/>
|
||||
<Application name="Rattle/PMML" version="1.4"/>
|
||||
<Timestamp>2017-11-06 14:20:06</Timestamp>
|
||||
</Header>
|
||||
<DataDictionary numberOfFields="9">
|
||||
<DataField name="Refractive_Index" optype="continuous" dataType="double"/>
|
||||
<DataField name="Sodium" optype="continuous" dataType="double"/>
|
||||
<DataField name="Magnesium" optype="continuous" dataType="double"/>
|
||||
<DataField name="Aluminium" optype="continuous" dataType="double"/>
|
||||
<DataField name="Silicon" optype="continuous" dataType="double"/>
|
||||
<DataField name="Potassium" optype="continuous" dataType="double"/>
|
||||
<DataField name="Calcium" optype="continuous" dataType="double"/>
|
||||
<DataField name="Barium" optype="continuous" dataType="double"/>
|
||||
<DataField name="Iron" optype="continuous" dataType="double"/>
|
||||
</DataDictionary>
|
||||
<ClusteringModel modelName="KMeans_Model" functionName="clustering" algorithmName="KMeans: Hartigan and Wong" modelClass="centerBased" numberOfClusters="6">
|
||||
<MiningSchema>
|
||||
<MiningField name="Refractive_Index"/>
|
||||
<MiningField name="Sodium"/>
|
||||
<MiningField name="Magnesium"/>
|
||||
<MiningField name="Aluminium"/>
|
||||
<MiningField name="Silicon"/>
|
||||
<MiningField name="Potassium"/>
|
||||
<MiningField name="Calcium"/>
|
||||
<MiningField name="Barium"/>
|
||||
<MiningField name="Iron"/>
|
||||
</MiningSchema>
|
||||
<Output>
|
||||
<OutputField name="predictedValue" feature="predictedValue"/>
|
||||
<OutputField name="clusterAffinity_1" feature="clusterAffinity" value="1"/>
|
||||
<OutputField name="clusterAffinity_2" feature="clusterAffinity" value="2"/>
|
||||
<OutputField name="clusterAffinity_3" feature="clusterAffinity" value="3"/>
|
||||
<OutputField name="clusterAffinity_4" feature="clusterAffinity" value="4"/>
|
||||
<OutputField name="clusterAffinity_5" feature="clusterAffinity" value="5"/>
|
||||
<OutputField name="clusterAffinity_6" feature="clusterAffinity" value="6"/>
|
||||
</Output>
|
||||
<ComparisonMeasure kind="distance">
|
||||
<squaredEuclidean/>
|
||||
</ComparisonMeasure>
|
||||
<ClusteringField field="Refractive_Index" compareFunction="absDiff"/>
|
||||
<ClusteringField field="Sodium" compareFunction="absDiff"/>
|
||||
<ClusteringField field="Magnesium" compareFunction="absDiff"/>
|
||||
<ClusteringField field="Aluminium" compareFunction="absDiff"/>
|
||||
<ClusteringField field="Silicon" compareFunction="absDiff"/>
|
||||
<ClusteringField field="Potassium" compareFunction="absDiff"/>
|
||||
<ClusteringField field="Calcium" compareFunction="absDiff"/>
|
||||
<ClusteringField field="Barium" compareFunction="absDiff"/>
|
||||
<ClusteringField field="Iron" compareFunction="absDiff"/>
|
||||
<Cluster name="1" size="6" id="1">
|
||||
<Array n="9" type="real">10.535 11.755 0.525 1.19333333333333 71.5033333333333 0.265 14.0016666666667 0.525 0.143333333333333</Array>
|
||||
</Cluster>
|
||||
<Cluster name="2" size="28" id="2">
|
||||
<Array n="9" type="real">0.667857142857153 13.5353571428571 3.2725 1.38892857142857 72.2946428571428 0.486071428571429 8.75321428571429 0.09 0.0653571428571429</Array>
|
||||
</Cluster>
|
||||
<Cluster name="3" size="41" id="3">
|
||||
<Array n="9" type="real">-2.02414634146344 13.1992682926829 3.47829268292683 1.57536585365854 72.7768292682927 0.660487804878049 7.98658536585366 0.0841463414634146 0.0595121951219512</Array>
|
||||
</Cluster>
|
||||
<Cluster name="4" size="40" id="4">
|
||||
<Array n="9" type="real">-0.463499999999988 12.9455 3.44075 1.2825 72.99425 0.556 8.5715 0.005 0.0545</Array>
|
||||
</Cluster>
|
||||
<Cluster name="5" size="32" id="5">
|
||||
<Array n="9" type="real">3.6121875 13.7346875 2.399375 1.178125 72.16875 0.2375 9.9875 0.1196875 0.0690625</Array>
|
||||
</Cluster>
|
||||
<Cluster name="6" size="24" id="6">
|
||||
<Array n="9" type="real">-2.30458333333335 14.34875 0.146666666666667 2.10666666666667 73.2966666666667 0.686666666666667 8.65583333333334 0.657083333333333 0.00916666666666667</Array>
|
||||
</Cluster>
|
||||
</ClusteringModel>
|
||||
</PMML>
|
|
@ -0,0 +1,215 @@
|
|||
,Predicted_Type
|
||||
1,2
|
||||
2,5
|
||||
3,6
|
||||
4,5
|
||||
5,5
|
||||
6,6
|
||||
7,5
|
||||
8,5
|
||||
9,5
|
||||
10,5
|
||||
11,6
|
||||
12,5
|
||||
13,6
|
||||
14,5
|
||||
15,5
|
||||
16,5
|
||||
17,5
|
||||
18,2
|
||||
19,5
|
||||
20,5
|
||||
21,5
|
||||
22,5
|
||||
23,5
|
||||
24,5
|
||||
25,6
|
||||
26,5
|
||||
27,5
|
||||
28,6
|
||||
29,5
|
||||
30,5
|
||||
31,5
|
||||
32,5
|
||||
33,5
|
||||
34,5
|
||||
35,5
|
||||
36,6
|
||||
37,5
|
||||
38,5
|
||||
39,2
|
||||
40,2
|
||||
41,5
|
||||
42,5
|
||||
43,5
|
||||
44,2
|
||||
45,5
|
||||
46,5
|
||||
47,5
|
||||
48,2
|
||||
49,2
|
||||
50,5
|
||||
51,2
|
||||
52,5
|
||||
53,5
|
||||
54,5
|
||||
55,5
|
||||
56,5
|
||||
57,3
|
||||
58,5
|
||||
59,5
|
||||
60,5
|
||||
61,5
|
||||
62,5
|
||||
63,2
|
||||
64,2
|
||||
65,2
|
||||
66,2
|
||||
67,2
|
||||
68,2
|
||||
69,2
|
||||
70,2
|
||||
71,6
|
||||
72,5
|
||||
73,6
|
||||
74,6
|
||||
75,6
|
||||
76,6
|
||||
77,6
|
||||
78,6
|
||||
79,6
|
||||
80,6
|
||||
81,6
|
||||
82,6
|
||||
83,6
|
||||
84,6
|
||||
85,3
|
||||
86,6
|
||||
87,6
|
||||
88,6
|
||||
89,6
|
||||
90,6
|
||||
91,5
|
||||
92,6
|
||||
93,6
|
||||
94,6
|
||||
95,6
|
||||
96,5
|
||||
97,5
|
||||
98,5
|
||||
99,6
|
||||
100,5
|
||||
101,6
|
||||
102,5
|
||||
103,5
|
||||
104,4
|
||||
105,2
|
||||
106,4
|
||||
107,4
|
||||
108,4
|
||||
109,2
|
||||
110,1
|
||||
111,4
|
||||
112,4
|
||||
113,4
|
||||
114,5
|
||||
115,5
|
||||
116,5
|
||||
117,5
|
||||
118,6
|
||||
119,6
|
||||
120,6
|
||||
121,5
|
||||
122,6
|
||||
123,6
|
||||
124,6
|
||||
125,2
|
||||
126,5
|
||||
127,6
|
||||
128,2
|
||||
129,2
|
||||
130,2
|
||||
131,2
|
||||
132,4
|
||||
133,5
|
||||
134,5
|
||||
135,5
|
||||
136,5
|
||||
137,5
|
||||
138,6
|
||||
139,6
|
||||
140,6
|
||||
141,6
|
||||
142,5
|
||||
143,6
|
||||
144,6
|
||||
145,6
|
||||
146,5
|
||||
147,5
|
||||
148,6
|
||||
149,6
|
||||
150,6
|
||||
151,6
|
||||
152,2
|
||||
153,5
|
||||
154,6
|
||||
155,6
|
||||
156,6
|
||||
157,6
|
||||
158,2
|
||||
159,5
|
||||
160,5
|
||||
161,5
|
||||
162,5
|
||||
163,2
|
||||
164,3
|
||||
165,5
|
||||
166,2
|
||||
167,2
|
||||
168,2
|
||||
169,1
|
||||
170,2
|
||||
171,2
|
||||
172,3
|
||||
173,3
|
||||
174,2
|
||||
175,2
|
||||
176,2
|
||||
177,5
|
||||
178,5
|
||||
179,5
|
||||
180,5
|
||||
181,3
|
||||
182,1
|
||||
183,1
|
||||
184,2
|
||||
185,3
|
||||
186,3
|
||||
187,5
|
||||
188,2
|
||||
189,2
|
||||
190,2
|
||||
191,1
|
||||
192,1
|
||||
193,1
|
||||
194,1
|
||||
195,1
|
||||
196,1
|
||||
197,1
|
||||
198,1
|
||||
199,1
|
||||
200,1
|
||||
201,1
|
||||
202,1
|
||||
203,1
|
||||
204,1
|
||||
205,1
|
||||
206,1
|
||||
207,1
|
||||
208,1
|
||||
209,1
|
||||
210,1
|
||||
211,1
|
||||
212,2
|
||||
213,1
|
||||
214,1
|
|
|
@ -0,0 +1,185 @@
|
|||
#region Copyright Syncfusion Inc. 2001-2018.
|
||||
// Copyright Syncfusion Inc. 2001-2018. All rights reserved.
|
||||
// Use of this code is subject to the terms of our license.
|
||||
// A copy of the current license can be obtained at any time by e-mailing
|
||||
// licensing@syncfusion.com. Any infringement will be prosecuted under
|
||||
// applicable laws.
|
||||
#endregion
|
||||
using Syncfusion.PMML;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
namespace GlassKMeans
|
||||
{
|
||||
/// <summary>
|
||||
/// Console program to demonstrate PMML execution engine
|
||||
/// </summary>
|
||||
public class Program
|
||||
{
|
||||
//Create Table instance for input, output and R Result
|
||||
public Table inputTable = null;
|
||||
private Table outputTable = null;
|
||||
private Table rResults = null;
|
||||
|
||||
#if CONSOLE
|
||||
|
||||
private static void Main(string[] args)
|
||||
{
|
||||
//Create instance
|
||||
Program program = new Program();
|
||||
//Load input csv
|
||||
program.inputTable = new Table("../../Model/Glass.csv", true, ',');
|
||||
//Invoke PredictResult
|
||||
program.outputTable = program.PredictResult(program.inputTable,
|
||||
"../../Model/Glass.pmml");
|
||||
//Dispose the inputTable values
|
||||
program.inputTable.Dispose();
|
||||
//Compare predicted results of PMML execution engine with R Results
|
||||
program.ComparePredictedResultsWithR("../../Model/ROutput.csv");
|
||||
//Write the Result as CSV File
|
||||
program.outputTable.WriteToCSV("../../Model/PredictedOutput.csv", true, ',');
|
||||
//Dispose the output Table
|
||||
program.outputTable.Dispose();
|
||||
//Display the result saved location
|
||||
Console.WriteLine("\nResult saved in : " + Path.GetFullPath("../../Model/PredictedOutput.csv"));
|
||||
Console.ReadKey();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#region PredictResult
|
||||
|
||||
/// <summary>
|
||||
/// Predicts the results for given PMML and CSV file and serialize the results in a CSV file
|
||||
/// </summary>
|
||||
public Table PredictResult(Table inputTable, string pmmlPath)
|
||||
{
|
||||
//Get PMML Evaluator instance
|
||||
PMMLEvaluator evaluator = new PMMLEvaluatorFactory().
|
||||
GetPMMLEvaluatorInstance(pmmlPath);
|
||||
|
||||
string[] predictedCategories = null;
|
||||
|
||||
//Predict the value for each record using the PMML Evaluator instance
|
||||
for (int i = 0; i < inputTable.RowCount; i++)
|
||||
{
|
||||
var glass = GetDataObject(inputTable, i);
|
||||
|
||||
//Get result
|
||||
PredictedResult predictedResult = evaluator.GetResult(glass, null);
|
||||
|
||||
if (i == 0)
|
||||
{
|
||||
//Get the predicted propability fields
|
||||
predictedCategories = predictedResult.GetPredictedCategories();
|
||||
//Initialize the output table
|
||||
InitializeTable(inputTable.RowCount, predictedCategories);
|
||||
}
|
||||
|
||||
//Add predicted value
|
||||
outputTable[i, 0] = predictedResult.PredictedValue;
|
||||
}
|
||||
|
||||
return outputTable;
|
||||
}
|
||||
|
||||
#endregion PredictResult
|
||||
|
||||
#region Compare Predicted Results With R
|
||||
|
||||
/// <summary>
|
||||
/// Compare predicted results of PMML execution engine with R results
|
||||
/// </summary>
|
||||
|
||||
public void ComparePredictedResultsWithR(string rOutputDataCSVPath)
|
||||
{
|
||||
//Create instance to hold results of R
|
||||
rResults = new Table(rOutputDataCSVPath, true, ',');
|
||||
string differentIndices = string.Empty;
|
||||
//Pass the Table to the compare method of resultTable
|
||||
bool isDifferent = Compare(rResults, 1, 0, ref differentIndices);
|
||||
#if CONSOLE
|
||||
//Display mismatched index
|
||||
if (isDifferent)
|
||||
{
|
||||
Console.WriteLine("\nDifference in predicted results by R and PMML execution engine");
|
||||
Console.WriteLine("\nDifferent indices are " + differentIndices);
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("\nBoth predicted results by R and PMML execution engine are equal");
|
||||
}
|
||||
#endif
|
||||
//Dispose the R results Table
|
||||
rResults.Dispose();
|
||||
}
|
||||
|
||||
#endregion Compare Predicted Results With R
|
||||
|
||||
#region Initialize OutputTable
|
||||
|
||||
/// <summary>
|
||||
/// Initialize the outputTable
|
||||
/// </summary>
|
||||
/// <param name="rowCount">rowCount of output table</param>
|
||||
/// <param name="predictedfield">predictedfield name</param>
|
||||
/// <param name="predictedCategories">probableFields</param>
|
||||
private void InitializeTable(int rowCount, string[] predictedCategories)
|
||||
{
|
||||
//Create instance to hold evaluated results
|
||||
outputTable = new Table(rowCount, predictedCategories.Length + 1);
|
||||
//Add predicted column names
|
||||
outputTable.ColumnNames[0] = "Predicted_Cluster";
|
||||
}
|
||||
|
||||
#endregion Initialize OutputTable
|
||||
|
||||
#region GetDataObject
|
||||
|
||||
/// <summary>
|
||||
/// Returns the row as anonymous object
|
||||
/// </summary>
|
||||
/// <param name="inputTable"> input Table values</param>
|
||||
/// <param name="row">input row</param>
|
||||
/// <returns>Anonymous object</returns>
|
||||
public Dictionary<string, object> GetDataObject(Table inputTable, int row)
|
||||
{
|
||||
Dictionary<string, object> glass = new Dictionary<string, object>();
|
||||
for (int i = 0; i < inputTable.ColumnCount; i++)
|
||||
{
|
||||
glass.Add(inputTable.ColumnNames[i], inputTable[row, inputTable.ColumnNames[i]]);
|
||||
}
|
||||
return glass;
|
||||
}
|
||||
|
||||
#endregion GetDataObject
|
||||
|
||||
#region Compare
|
||||
|
||||
/// <summary>
|
||||
/// Compares the result of 2 Tables based on column index.
|
||||
/// </summary>
|
||||
/// <param name="rOutput">R output table</param>
|
||||
/// <param name="rColumnIndex">R's Column to be compared</param>
|
||||
/// <param name="predictedColumnIndex">predicted result's column index</param>
|
||||
/// <param name="differentIndices"> different indices</param>
|
||||
public bool Compare(Table table, int rColumnIndex, int predictedColumnIndex, ref string differentIndices)
|
||||
{
|
||||
bool isDifferent = false;
|
||||
//Compare predicted values
|
||||
for (int i = 0; i < table.RowCount; i++)
|
||||
{
|
||||
//Compare Results based on column index
|
||||
if (outputTable[i, predictedColumnIndex].ToString() != table[i, rColumnIndex].ToString())
|
||||
{
|
||||
differentIndices += ", " + i;
|
||||
isDifferent = true;
|
||||
}
|
||||
}
|
||||
return isDifferent;
|
||||
}
|
||||
|
||||
#endregion Compare
|
||||
}
|
||||
}
|
|
@ -0,0 +1,76 @@
|
|||
# Copyright Syncfusion Inc. 2001 - 2016. All rights reserved.
|
||||
# Use of this code is subject to the terms of our license.
|
||||
# A copy of the current license can be obtained at any time by e-mailing
|
||||
# licensing@syncfusion.com. Any infringement will be prosecuted under
|
||||
# applicable laws.
|
||||
|
||||
|
||||
# If you are not familiar with R you can obtain a quick introduction by downloading
|
||||
# R Succinctly for free from Syncfusion - http://www.syncfusion.com/resources/techportal/ebooks/rsuccinctly
|
||||
# R Succinctly is also included with this installation and is available here
|
||||
# Installed Drive :\Program Files (x86)\Syncfusion\Essential Studio\XX.X.X.XX\Infrastructure\EBooks\R_Succintly.pdf OF R Succinctly
|
||||
# Uncomment below lines to install necessary packages if not installed already
|
||||
# install.packages("rattle")
|
||||
# install.packages("pmml")
|
||||
# install.packages("datasets")
|
||||
|
||||
# Load below packages
|
||||
library(rattle)
|
||||
library(pmml)
|
||||
library(datasets) # This package is specifically loaded for iris dataset shipped within it.
|
||||
|
||||
# Here we directly load the iris dataset installed with the "datasets" package.
|
||||
data(iris)
|
||||
|
||||
# rename column names for iris dataset from datasets package
|
||||
irisOriginal <- setNames(iris, c("Sepal_Length","Sepal_Width","Petal_Length","Petal_Width","Species"))
|
||||
|
||||
# Omit rows with missing values
|
||||
irisOriginal <- na.omit(irisOriginal)
|
||||
|
||||
# Code below demonstrates loading the same dataset from a CSV file shipped with our installer.
|
||||
# Please check installed samples (Data) location to set actual working directory
|
||||
# Uncomment below lines and comment out the code to read data from CSV file.
|
||||
# setwd("C:/actual_data_location")
|
||||
# iris<- read.csv("Iris.csv")
|
||||
|
||||
# Get numeric fields data of glass
|
||||
numericIrisData<- irisOriginal[,c("Sepal_Length","Sepal_Width","Petal_Length","Petal_Width")]
|
||||
|
||||
# Randomizing data
|
||||
iris<- numericIrisData[sample(nrow(numericIrisData)),]
|
||||
|
||||
# Divide dataset for training and test
|
||||
trainData<-iris[1:120,]
|
||||
testData<-iris[121:150,]
|
||||
|
||||
# Applying KMeans Clustering algorithm with centroids "3"
|
||||
iris_KMeans <- kmeans(trainData,3)
|
||||
iris_KMeans
|
||||
|
||||
# Predict "Species" column for test data set
|
||||
irisTestPrediction<-predict(iris_KMeans,testData)
|
||||
# Display predicted values
|
||||
irisTestPrediction
|
||||
|
||||
|
||||
# PMML generation
|
||||
pmmlFile<-pmml(iris_KMeans,data=trainData)
|
||||
write(toString(pmmlFile),file="Iris.pmml")
|
||||
saveXML(pmmlFile,file="Iris.pmml")
|
||||
|
||||
# The code below is used for evaluation purpose.
|
||||
# The model is applied for original Iris data set and predicted results are saved in "ROuput.csv"
|
||||
# "ROuput.csv" file used for comparing the R results with PMML Evaluation engine results
|
||||
|
||||
# Applying KMeans clustering algorithm to entire dataset and save the results in a CSV file
|
||||
irisEntirePrediction<-predict(iris_KMeans,numericIrisData)
|
||||
irisEntirePrediction
|
||||
|
||||
# Save predicted value in a data frame
|
||||
result <- data.frame(irisEntirePrediction)
|
||||
names(result) <- c("Predicted_Species")
|
||||
|
||||
# Write the results in a CSV file
|
||||
write.csv(result,"ROutput.csv",quote=F)
|
||||
|
|
@ -0,0 +1,151 @@
|
|||
Sepal_Length,Sepal_Width,Petal_Length,Petal_Width,Species
|
||||
5.1,3.5,1.4,0.2,setosa
|
||||
4.9,3,1.4,0.2,setosa
|
||||
4.7,3.2,1.3,0.2,setosa
|
||||
4.6,3.1,1.5,0.2,setosa
|
||||
5,3.6,1.4,0.2,setosa
|
||||
5.4,3.9,1.7,0.4,setosa
|
||||
4.6,3.4,1.4,0.3,setosa
|
||||
5,3.4,1.5,0.2,setosa
|
||||
4.4,2.9,1.4,0.2,setosa
|
||||
4.9,3.1,1.5,0.1,setosa
|
||||
5.4,3.7,1.5,0.2,setosa
|
||||
4.8,3.4,1.6,0.2,setosa
|
||||
4.8,3,1.4,0.1,setosa
|
||||
4.3,3,1.1,0.1,setosa
|
||||
5.8,4,1.2,0.2,setosa
|
||||
5.7,4.4,1.5,0.4,setosa
|
||||
5.4,3.9,1.3,0.4,setosa
|
||||
5.1,3.5,1.4,0.3,setosa
|
||||
5.7,3.8,1.7,0.3,setosa
|
||||
5.1,3.8,1.5,0.3,setosa
|
||||
5.4,3.4,1.7,0.2,setosa
|
||||
5.1,3.7,1.5,0.4,setosa
|
||||
4.6,3.6,1,0.2,setosa
|
||||
5.1,3.3,1.7,0.5,setosa
|
||||
4.8,3.4,1.9,0.2,setosa
|
||||
5,3,1.6,0.2,setosa
|
||||
5,3.4,1.6,0.4,setosa
|
||||
5.2,3.5,1.5,0.2,setosa
|
||||
5.2,3.4,1.4,0.2,setosa
|
||||
4.7,3.2,1.6,0.2,setosa
|
||||
4.8,3.1,1.6,0.2,setosa
|
||||
5.4,3.4,1.5,0.4,setosa
|
||||
5.2,4.1,1.5,0.1,setosa
|
||||
5.5,4.2,1.4,0.2,setosa
|
||||
4.9,3.1,1.5,0.2,setosa
|
||||
5,3.2,1.2,0.2,setosa
|
||||
5.5,3.5,1.3,0.2,setosa
|
||||
4.9,3.6,1.4,0.1,setosa
|
||||
4.4,3,1.3,0.2,setosa
|
||||
5.1,3.4,1.5,0.2,setosa
|
||||
5,3.5,1.3,0.3,setosa
|
||||
4.5,2.3,1.3,0.3,setosa
|
||||
4.4,3.2,1.3,0.2,setosa
|
||||
5,3.5,1.6,0.6,setosa
|
||||
5.1,3.8,1.9,0.4,setosa
|
||||
4.8,3,1.4,0.3,setosa
|
||||
5.1,3.8,1.6,0.2,setosa
|
||||
4.6,3.2,1.4,0.2,setosa
|
||||
5.3,3.7,1.5,0.2,setosa
|
||||
5,3.3,1.4,0.2,setosa
|
||||
7,3.2,4.7,1.4,versicolor
|
||||
6.4,3.2,4.5,1.5,versicolor
|
||||
6.9,3.1,4.9,1.5,versicolor
|
||||
5.5,2.3,4,1.3,versicolor
|
||||
6.5,2.8,4.6,1.5,versicolor
|
||||
5.7,2.8,4.5,1.3,versicolor
|
||||
6.3,3.3,4.7,1.6,versicolor
|
||||
4.9,2.4,3.3,1,versicolor
|
||||
6.6,2.9,4.6,1.3,versicolor
|
||||
5.2,2.7,3.9,1.4,versicolor
|
||||
5,2,3.5,1,versicolor
|
||||
5.9,3,4.2,1.5,versicolor
|
||||
6,2.2,4,1,versicolor
|
||||
6.1,2.9,4.7,1.4,versicolor
|
||||
5.6,2.9,3.6,1.3,versicolor
|
||||
6.7,3.1,4.4,1.4,versicolor
|
||||
5.6,3,4.5,1.5,versicolor
|
||||
5.8,2.7,4.1,1,versicolor
|
||||
6.2,2.2,4.5,1.5,versicolor
|
||||
5.6,2.5,3.9,1.1,versicolor
|
||||
5.9,3.2,4.8,1.8,versicolor
|
||||
6.1,2.8,4,1.3,versicolor
|
||||
6.3,2.5,4.9,1.5,versicolor
|
||||
6.1,2.8,4.7,1.2,versicolor
|
||||
6.4,2.9,4.3,1.3,versicolor
|
||||
6.6,3,4.4,1.4,versicolor
|
||||
6.8,2.8,4.8,1.4,versicolor
|
||||
6.7,3,5,1.7,versicolor
|
||||
6,2.9,4.5,1.5,versicolor
|
||||
5.7,2.6,3.5,1,versicolor
|
||||
5.5,2.4,3.8,1.1,versicolor
|
||||
5.5,2.4,3.7,1,versicolor
|
||||
5.8,2.7,3.9,1.2,versicolor
|
||||
6,2.7,5.1,1.6,versicolor
|
||||
5.4,3,4.5,1.5,versicolor
|
||||
6,3.4,4.5,1.6,versicolor
|
||||
6.7,3.1,4.7,1.5,versicolor
|
||||
6.3,2.3,4.4,1.3,versicolor
|
||||
5.6,3,4.1,1.3,versicolor
|
||||
5.5,2.5,4,1.3,versicolor
|
||||
5.5,2.6,4.4,1.2,versicolor
|
||||
6.1,3,4.6,1.4,versicolor
|
||||
5.8,2.6,4,1.2,versicolor
|
||||
5,2.3,3.3,1,versicolor
|
||||
5.6,2.7,4.2,1.3,versicolor
|
||||
5.7,3,4.2,1.2,versicolor
|
||||
5.7,2.9,4.2,1.3,versicolor
|
||||
6.2,2.9,4.3,1.3,versicolor
|
||||
5.1,2.5,3,1.1,versicolor
|
||||
5.7,2.8,4.1,1.3,versicolor
|
||||
6.3,3.3,6,2.5,virginica
|
||||
5.8,2.7,5.1,1.9,virginica
|
||||
7.1,3,5.9,2.1,virginica
|
||||
6.3,2.9,5.6,1.8,virginica
|
||||
6.5,3,5.8,2.2,virginica
|
||||
7.6,3,6.6,2.1,virginica
|
||||
4.9,2.5,4.5,1.7,virginica
|
||||
7.3,2.9,6.3,1.8,virginica
|
||||
6.7,2.5,5.8,1.8,virginica
|
||||
7.2,3.6,6.1,2.5,virginica
|
||||
6.5,3.2,5.1,2,virginica
|
||||
6.4,2.7,5.3,1.9,virginica
|
||||
6.8,3,5.5,2.1,virginica
|
||||
5.7,2.5,5,2,virginica
|
||||
5.8,2.8,5.1,2.4,virginica
|
||||
6.4,3.2,5.3,2.3,virginica
|
||||
6.5,3,5.5,1.8,virginica
|
||||
7.7,3.8,6.7,2.2,virginica
|
||||
7.7,2.6,6.9,2.3,virginica
|
||||
6,2.2,5,1.5,virginica
|
||||
6.9,3.2,5.7,2.3,virginica
|
||||
5.6,2.8,4.9,2,virginica
|
||||
7.7,2.8,6.7,2,virginica
|
||||
6.3,2.7,4.9,1.8,virginica
|
||||
6.7,3.3,5.7,2.1,virginica
|
||||
7.2,3.2,6,1.8,virginica
|
||||
6.2,2.8,4.8,1.8,virginica
|
||||
6.1,3,4.9,1.8,virginica
|
||||
6.4,2.8,5.6,2.1,virginica
|
||||
7.2,3,5.8,1.6,virginica
|
||||
7.4,2.8,6.1,1.9,virginica
|
||||
7.9,3.8,6.4,2,virginica
|
||||
6.4,2.8,5.6,2.2,virginica
|
||||
6.3,2.8,5.1,1.5,virginica
|
||||
6.1,2.6,5.6,1.4,virginica
|
||||
7.7,3,6.1,2.3,virginica
|
||||
6.3,3.4,5.6,2.4,virginica
|
||||
6.4,3.1,5.5,1.8,virginica
|
||||
6,3,4.8,1.8,virginica
|
||||
6.9,3.1,5.4,2.1,virginica
|
||||
6.7,3.1,5.6,2.4,virginica
|
||||
6.9,3.1,5.1,2.3,virginica
|
||||
5.8,2.7,5.1,1.9,virginica
|
||||
6.8,3.2,5.9,2.3,virginica
|
||||
6.7,3.3,5.7,2.5,virginica
|
||||
6.7,3,5.2,2.3,virginica
|
||||
6.3,2.5,5,1.9,virginica
|
||||
6.5,3,5.2,2,virginica
|
||||
6.2,3.4,5.4,2.3,virginica
|
||||
5.9,3,5.1,1.8,virginica
|
|
|
@ -0,0 +1,44 @@
|
|||
<?xml version="1.0"?>
|
||||
<PMML version="4.3" xmlns="http://www.dmg.org/PMML-4_3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.dmg.org/PMML-4_3 http://www.dmg.org/pmml/v4-3/pmml-4-3.xsd">
|
||||
<Header copyright="Copyright (c) 2017 Syncfusion" description="KMeans cluster model">
|
||||
<Extension name="user" value="Syncfusion" extender="Rattle/PMML"/>
|
||||
<Application name="Rattle/PMML" version="1.4"/>
|
||||
<Timestamp>2017-11-06 14:20:06</Timestamp>
|
||||
</Header>
|
||||
<DataDictionary numberOfFields="4">
|
||||
<DataField name="Sepal_Length" optype="continuous" dataType="double"/>
|
||||
<DataField name="Sepal_Width" optype="continuous" dataType="double"/>
|
||||
<DataField name="Petal_Length" optype="continuous" dataType="double"/>
|
||||
<DataField name="Petal_Width" optype="continuous" dataType="double"/>
|
||||
</DataDictionary>
|
||||
<ClusteringModel modelName="KMeans_Model" functionName="clustering" algorithmName="KMeans: Hartigan and Wong" modelClass="centerBased" numberOfClusters="3">
|
||||
<MiningSchema>
|
||||
<MiningField name="Sepal_Length"/>
|
||||
<MiningField name="Sepal_Width"/>
|
||||
<MiningField name="Petal_Length"/>
|
||||
<MiningField name="Petal_Width"/>
|
||||
</MiningSchema>
|
||||
<Output>
|
||||
<OutputField name="predictedValue" feature="predictedValue"/>
|
||||
<OutputField name="clusterAffinity_1" feature="clusterAffinity" value="1"/>
|
||||
<OutputField name="clusterAffinity_2" feature="clusterAffinity" value="2"/>
|
||||
<OutputField name="clusterAffinity_3" feature="clusterAffinity" value="3"/>
|
||||
</Output>
|
||||
<ComparisonMeasure kind="distance">
|
||||
<squaredEuclidean/>
|
||||
</ComparisonMeasure>
|
||||
<ClusteringField field="Sepal_Length" compareFunction="absDiff"/>
|
||||
<ClusteringField field="Sepal_Width" compareFunction="absDiff"/>
|
||||
<ClusteringField field="Petal_Length" compareFunction="absDiff"/>
|
||||
<ClusteringField field="Petal_Width" compareFunction="absDiff"/>
|
||||
<Cluster name="1" size="22" id="1">
|
||||
<Array n="4" type="real">5.27727272727273 3.71363636363636 1.49545454545455 0.281818181818182</Array>
|
||||
</Cluster>
|
||||
<Cluster name="2" size="23" id="2">
|
||||
<Array n="4" type="real">4.78260869565217 3.1 1.60434782608696 0.3</Array>
|
||||
</Cluster>
|
||||
<Cluster name="3" size="75" id="3">
|
||||
<Array n="4" type="real">6.25733333333333 2.868 4.93733333333333 1.72133333333333</Array>
|
||||
</Cluster>
|
||||
</ClusteringModel>
|
||||
</PMML>
|
|
@ -0,0 +1,151 @@
|
|||
,Predicted_Species
|
||||
1,2
|
||||
2,2
|
||||
3,2
|
||||
4,2
|
||||
5,2
|
||||
6,2
|
||||
7,2
|
||||
8,2
|
||||
9,2
|
||||
10,2
|
||||
11,2
|
||||
12,2
|
||||
13,2
|
||||
14,2
|
||||
15,2
|
||||
16,2
|
||||
17,2
|
||||
18,2
|
||||
19,2
|
||||
20,2
|
||||
21,2
|
||||
22,2
|
||||
23,2
|
||||
24,2
|
||||
25,2
|
||||
26,2
|
||||
27,2
|
||||
28,2
|
||||
29,2
|
||||
30,2
|
||||
31,2
|
||||
32,2
|
||||
33,2
|
||||
34,2
|
||||
35,2
|
||||
36,2
|
||||
37,2
|
||||
38,2
|
||||
39,2
|
||||
40,2
|
||||
41,2
|
||||
42,2
|
||||
43,2
|
||||
44,2
|
||||
45,2
|
||||
46,2
|
||||
47,2
|
||||
48,2
|
||||
49,2
|
||||
50,2
|
||||
51,3
|
||||
52,1
|
||||
53,3
|
||||
54,1
|
||||
55,1
|
||||
56,1
|
||||
57,1
|
||||
58,1
|
||||
59,1
|
||||
60,1
|
||||
61,1
|
||||
62,1
|
||||
63,1
|
||||
64,1
|
||||
65,1
|
||||
66,1
|
||||
67,1
|
||||
68,1
|
||||
69,1
|
||||
70,1
|
||||
71,1
|
||||
72,1
|
||||
73,1
|
||||
74,1
|
||||
75,1
|
||||
76,1
|
||||
77,1
|
||||
78,3
|
||||
79,1
|
||||
80,1
|
||||
81,1
|
||||
82,1
|
||||
83,1
|
||||
84,1
|
||||
85,1
|
||||
86,1
|
||||
87,1
|
||||
88,1
|
||||
89,1
|
||||
90,1
|
||||
91,1
|
||||
92,1
|
||||
93,1
|
||||
94,1
|
||||
95,1
|
||||
96,1
|
||||
97,1
|
||||
98,1
|
||||
99,1
|
||||
100,1
|
||||
101,3
|
||||
102,1
|
||||
103,3
|
||||
104,3
|
||||
105,3
|
||||
106,3
|
||||
107,1
|
||||
108,3
|
||||
109,3
|
||||
110,3
|
||||
111,3
|
||||
112,3
|
||||
113,3
|
||||
114,1
|
||||
115,3
|
||||
116,3
|
||||
117,3
|
||||
118,3
|
||||
119,3
|
||||
120,1
|
||||
121,3
|
||||
122,1
|
||||
123,3
|
||||
124,1
|
||||
125,3
|
||||
126,3
|
||||
127,1
|
||||
128,1
|
||||
129,3
|
||||
130,3
|
||||
131,3
|
||||
132,3
|
||||
133,3
|
||||
134,1
|
||||
135,3
|
||||
136,3
|
||||
137,3
|
||||
138,3
|
||||
139,1
|
||||
140,3
|
||||
141,3
|
||||
142,3
|
||||
143,1
|
||||
144,3
|
||||
145,3
|
||||
146,3
|
||||
147,1
|
||||
148,3
|
||||
149,3
|
||||
150,1
|
|
|
@ -0,0 +1,184 @@
|
|||
#region Copyright Syncfusion Inc. 2001-2018.
|
||||
// Copyright Syncfusion Inc. 2001-2018. All rights reserved.
|
||||
// Use of this code is subject to the terms of our license.
|
||||
// A copy of the current license can be obtained at any time by e-mailing
|
||||
// licensing@syncfusion.com. Any infringement will be prosecuted under
|
||||
// applicable laws.
|
||||
#endregion
|
||||
using Syncfusion.PMML;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
namespace IrisKMeans
|
||||
{
|
||||
/// <summary>
|
||||
/// Console program to demonstrate PMML execution engine
|
||||
/// </summary>
|
||||
public class Program
|
||||
{
|
||||
//Create Table instance for input, output and R Result
|
||||
public Table inputTable = null;
|
||||
private Table outputTable = null;
|
||||
private Table rResults = null;
|
||||
|
||||
#if CONSOLE
|
||||
|
||||
private static void Main(string[] args)
|
||||
{
|
||||
//Create instance
|
||||
Program program = new Program();
|
||||
//Load input csv
|
||||
program.inputTable = new Table("../../Model/Iris.csv", true, ',');
|
||||
//Invoke PredictResult
|
||||
program.outputTable = program.PredictResult(program.inputTable,
|
||||
"../../Model/Iris.pmml");
|
||||
//Dispose the inputTable values
|
||||
program.inputTable.Dispose();
|
||||
//Compare predicted results of PMML execution engine with R Results
|
||||
program.ComparePredictedResultsWithR("../../Model/ROutput.csv");
|
||||
//Write the Result as CSV File
|
||||
program.outputTable.WriteToCSV("../../Model/PredictedOutput.csv", true, ',');
|
||||
//Dispose the output Table
|
||||
program.outputTable.Dispose();
|
||||
//Display the result saved location
|
||||
Console.WriteLine("\nResult saved in : " + Path.GetFullPath("../../Model/PredictedOutput.csv"));
|
||||
Console.ReadKey();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#region PredictResult
|
||||
|
||||
/// <summary>
|
||||
/// Predicts the results for given PMML and CSV file and serialize the results in a CSV file
|
||||
/// </summary>
|
||||
public Table PredictResult(Table inputTable, string pmmlPath)
|
||||
{
|
||||
//Get PMML Evaluator instance
|
||||
PMMLEvaluator evaluator = new PMMLEvaluatorFactory().
|
||||
GetPMMLEvaluatorInstance(pmmlPath);
|
||||
|
||||
string[] predictedCategories = null;
|
||||
|
||||
//Predict the value for each record using the PMML Evaluator instance
|
||||
for (int i = 0; i < inputTable.RowCount; i++)
|
||||
{
|
||||
var iris = GetDataObject(inputTable, i);
|
||||
|
||||
//Get result
|
||||
PredictedResult predictedResult = evaluator.GetResult(iris, null);
|
||||
|
||||
if (i == 0)
|
||||
{
|
||||
//Get the predicted propability fields
|
||||
predictedCategories = predictedResult.GetPredictedCategories();
|
||||
//Initialize the output table
|
||||
InitializeTable(inputTable.RowCount, predictedCategories);
|
||||
}
|
||||
|
||||
//Add predicted value
|
||||
outputTable[i, 0] = predictedResult.PredictedValue;
|
||||
}
|
||||
return outputTable;
|
||||
}
|
||||
|
||||
#endregion PredictResult
|
||||
|
||||
#region Compare Predicted Results With R
|
||||
|
||||
/// <summary>
|
||||
/// Compare predicted results of PMML execution engine with R results
|
||||
/// </summary>
|
||||
|
||||
public void ComparePredictedResultsWithR(string rOutputDataCSVPath)
|
||||
{
|
||||
//Create instance to hold results of R
|
||||
rResults = new Table(rOutputDataCSVPath, true, ',');
|
||||
string differentIndices = string.Empty;
|
||||
//Pass the Table to the compare method of resultTable
|
||||
bool isDifferent = Compare(rResults, 1, 0, ref differentIndices);
|
||||
#if CONSOLE
|
||||
//Display mismatched index
|
||||
if (isDifferent)
|
||||
{
|
||||
Console.WriteLine("\nDifference in predicted results by R and PMML execution engine");
|
||||
Console.WriteLine("\nDifferent indices are " + differentIndices);
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("\nBoth predicted results by R and PMML execution engine are equal");
|
||||
}
|
||||
#endif
|
||||
//Dispose the R results Table
|
||||
rResults.Dispose();
|
||||
}
|
||||
|
||||
#endregion Compare Predicted Results With R
|
||||
|
||||
#region Initialize OutputTable
|
||||
|
||||
/// <summary>
|
||||
/// Initialize the outputTable
|
||||
/// </summary>
|
||||
/// <param name="rowCount">rowCount of output table</param>
|
||||
/// <param name="predictedfield">predictedfield name</param>
|
||||
/// <param name="predictedCategories">probableFields</param>
|
||||
private void InitializeTable(int rowCount, string[] predictedCategories)
|
||||
{
|
||||
//Create instance to hold evaluated results
|
||||
outputTable = new Table(rowCount, predictedCategories.Length + 1);
|
||||
//Add predicted column names
|
||||
outputTable.ColumnNames[0] = "Predicted_Cluster";
|
||||
}
|
||||
|
||||
#endregion Initialize OutputTable
|
||||
|
||||
#region GetDataObject
|
||||
|
||||
/// <summary>
|
||||
/// Returns the row as anonymous object
|
||||
/// </summary>
|
||||
/// <param name="inputTable"> input Table values</param>
|
||||
/// <param name="row">input row</param>
|
||||
/// <returns>Anonymous object</returns>
|
||||
public Dictionary<string, object> GetDataObject(Table inputTable, int row)
|
||||
{
|
||||
Dictionary<string, object> iris = new Dictionary<string, object>();
|
||||
for (int i = 0; i < inputTable.ColumnCount; i++)
|
||||
{
|
||||
iris.Add(inputTable.ColumnNames[i], inputTable[row, inputTable.ColumnNames[i]]);
|
||||
}
|
||||
return iris;
|
||||
}
|
||||
|
||||
#endregion GetDataObject
|
||||
|
||||
#region Compare
|
||||
|
||||
/// <summary>
|
||||
/// Compares the result of 2 Tables based on column index.
|
||||
/// </summary>
|
||||
/// <param name="rOutput">R output table</param>
|
||||
/// <param name="rColumnIndex">R's Column to be compared</param>
|
||||
/// <param name="predictedColumnIndex">predicted result's column index</param>
|
||||
/// <param name="differentIndices"> different indices</param>
|
||||
public bool Compare(Table table, int rColumnIndex, int predictedColumnIndex, ref string differentIndices)
|
||||
{
|
||||
bool isDifferent = false;
|
||||
//Compare predicted values
|
||||
for (int i = 0; i < table.RowCount; i++)
|
||||
{
|
||||
//Compare Results based on column index
|
||||
if (outputTable[i, predictedColumnIndex].ToString() != table[i, rColumnIndex].ToString())
|
||||
{
|
||||
differentIndices += ", " + i;
|
||||
isDifferent = true;
|
||||
}
|
||||
}
|
||||
return isDifferent;
|
||||
}
|
||||
|
||||
#endregion Compare
|
||||
}
|
||||
}
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -0,0 +1,75 @@
|
|||
# Copyright Syncfusion Inc. 2001 - 2016. All rights reserved.
|
||||
# Use of this code is subject to the terms of our license.
|
||||
# A copy of the current license can be obtained at any time by e-mailing
|
||||
# licensing@syncfusion.com. Any infringement will be prosecuted under
|
||||
# applicable laws.
|
||||
|
||||
|
||||
# If you are not familiar with R you can obtain a quick introduction by downloading
|
||||
# R Succinctly for free from Syncfusion - http://www.syncfusion.com/resources/techportal/ebooks/rsuccinctly
|
||||
# R Succinctly is also included with this installation and is available here
|
||||
# Installed Drive :\Program Files (x86)\Syncfusion\Essential Studio\XX.X.X.XX\Infrastructure\EBooks\R_Succintly.pdf OF R Succinctly
|
||||
# Uncomment below lines to install necessary packages if not installed already
|
||||
# install.packages("rattle")
|
||||
# install.packages("pmml")
|
||||
# install.packages("rpart.plot")
|
||||
|
||||
# Load below packages
|
||||
library(rattle)
|
||||
library(pmml)
|
||||
library(rpart.plot) # This package is specifically loaded for ptitanic dataset shipped within it.
|
||||
|
||||
# Here we directly load the ptitanic dataset installed with the "rpart.plot" package.
|
||||
data(ptitanic)
|
||||
|
||||
# rename column names for ptitanic dataset from rpart.plot package
|
||||
titanicOriginal <- setNames(ptitanic, c("Class", "Survived", "Sex", "Age", "Siblings", "Children"))
|
||||
|
||||
# Omit rows with missing values
|
||||
titanicOriginal <- na.omit(titanicOriginal)
|
||||
|
||||
# Code below demonstrates loading the same dataset from a CSV file shipped with our installer.
|
||||
# Please check installed samples (Data) location to set actual working directory
|
||||
# Uncomment below lines and comment out the code to read data from CSV file.
|
||||
# setwd("C:/actual_data_location")
|
||||
# titanic<- read.csv("Titanic.csv")
|
||||
|
||||
# Get numeric fields data of titanic
|
||||
numericTitanicData <- titanicOriginal[,c("Age","Siblings","Children")]
|
||||
|
||||
# Randomizing data
|
||||
titanic<- numericTitanicData[sample(nrow(numericTitanicData)),]
|
||||
|
||||
# Divide dataset for training and test
|
||||
trainData<-titanic[1:836,]
|
||||
testData<-titanic[837:1046,]
|
||||
|
||||
# Applying KMeans Clustering algorithm with centroids "2"
|
||||
titanic_KMeans <- kmeans(trainData,2)
|
||||
titanic_KMeans
|
||||
|
||||
# Predict "Survived" column for test data set
|
||||
titanicTestPrediction<-predict(titanic_KMeans,testData)
|
||||
# Display predicted values
|
||||
titanicTestPrediction
|
||||
|
||||
|
||||
# PMML generation
|
||||
pmmlFile<-pmml(titanic_KMeans,data=trainData)
|
||||
write(toString(pmmlFile),file="Titanic.pmml")
|
||||
saveXML(pmmlFile,file="Titanic.pmml")
|
||||
|
||||
# The code below is used for evaluation purpose.
|
||||
# The model is applied for original ptitanic data set and predicted results are saved in "ROuput.csv"
|
||||
# "ROuput.csv" file used for comparing the R results with PMML Evaluation engine results
|
||||
|
||||
# Applying KMeans Clustering algorithm to entire dataset and save the results in a CSV file
|
||||
titanicEntirePrediction<-predict(titanic_KMeans,numericTitanicData)
|
||||
titanicEntirePrediction
|
||||
|
||||
# Save predicted value in a data frame
|
||||
result <- data.frame(titanicEntirePrediction)
|
||||
names(result) <- c("Predicted_Survived")
|
||||
|
||||
# Write the results in a CSV file
|
||||
write.csv(result,"ROutput.csv",quote=F)
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -0,0 +1,37 @@
|
|||
<?xml version="1.0"?>
|
||||
<PMML version="4.3" xmlns="http://www.dmg.org/PMML-4_3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.dmg.org/PMML-4_3 http://www.dmg.org/pmml/v4-3/pmml-4-3.xsd">
|
||||
<Header copyright="Copyright (c) 2017 Syncfusion" description="KMeans cluster model">
|
||||
<Extension name="user" value="Syncfusion" extender="Rattle/PMML"/>
|
||||
<Application name="Rattle/PMML" version="1.4"/>
|
||||
<Timestamp>2017-11-06 14:20:07</Timestamp>
|
||||
</Header>
|
||||
<DataDictionary numberOfFields="3">
|
||||
<DataField name="Age" optype="continuous" dataType="double"/>
|
||||
<DataField name="Siblings" optype="continuous" dataType="double"/>
|
||||
<DataField name="Children" optype="continuous" dataType="double"/>
|
||||
</DataDictionary>
|
||||
<ClusteringModel modelName="KMeans_Model" functionName="clustering" algorithmName="KMeans: Hartigan and Wong" modelClass="centerBased" numberOfClusters="2">
|
||||
<MiningSchema>
|
||||
<MiningField name="Age"/>
|
||||
<MiningField name="Siblings"/>
|
||||
<MiningField name="Children"/>
|
||||
</MiningSchema>
|
||||
<Output>
|
||||
<OutputField name="predictedValue" feature="predictedValue"/>
|
||||
<OutputField name="clusterAffinity_1" feature="clusterAffinity" value="1"/>
|
||||
<OutputField name="clusterAffinity_2" feature="clusterAffinity" value="2"/>
|
||||
</Output>
|
||||
<ComparisonMeasure kind="distance">
|
||||
<squaredEuclidean/>
|
||||
</ComparisonMeasure>
|
||||
<ClusteringField field="Age" compareFunction="absDiff"/>
|
||||
<ClusteringField field="Siblings" compareFunction="absDiff"/>
|
||||
<ClusteringField field="Children" compareFunction="absDiff"/>
|
||||
<Cluster name="1" size="304" id="1">
|
||||
<Array n="3" type="real">45.0427631578947 0.391447368421053 0.434210526315789</Array>
|
||||
</Cluster>
|
||||
<Cluster name="2" size="532" id="2">
|
||||
<Array n="3" type="real">20.7901003759624 0.582706766917293 0.43609022556391</Array>
|
||||
</Cluster>
|
||||
</ClusteringModel>
|
||||
</PMML>
|
|
@ -0,0 +1,185 @@
|
|||
#region Copyright Syncfusion Inc. 2001-2018.
|
||||
// Copyright Syncfusion Inc. 2001-2018. All rights reserved.
|
||||
// Use of this code is subject to the terms of our license.
|
||||
// A copy of the current license can be obtained at any time by e-mailing
|
||||
// licensing@syncfusion.com. Any infringement will be prosecuted under
|
||||
// applicable laws.
|
||||
#endregion
|
||||
using Syncfusion.PMML;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
namespace TitanicKMeans
|
||||
{
|
||||
/// <summary>
|
||||
/// Console program to demonstrate PMML execution engine
|
||||
/// </summary>
|
||||
public class Program
|
||||
{
|
||||
//Create Table instance for input, output and R Result
|
||||
public Table inputTable = null;
|
||||
private Table outputTable = null;
|
||||
private Table rResults = null;
|
||||
|
||||
#if CONSOLE
|
||||
|
||||
private static void Main(string[] args)
|
||||
{
|
||||
//Create instance
|
||||
Program program = new Program();
|
||||
//Load input csv
|
||||
program.inputTable = new Table("../../Model/Titanic.csv", true, ',');
|
||||
//Invoke PredictResult
|
||||
program.outputTable = program.PredictResult(program.inputTable,
|
||||
"../../Model/Titanic.pmml");
|
||||
//Dispose the inputTable values
|
||||
program.inputTable.Dispose();
|
||||
//Compare predicted results of PMML execution engine with R Results
|
||||
program.ComparePredictedResultsWithR("../../Model/ROutput.csv");
|
||||
//Write the Result as CSV File
|
||||
program.outputTable.WriteToCSV("../../Model/PredictedOutput.csv", true, ',');
|
||||
//Dispose the output Table
|
||||
program.outputTable.Dispose();
|
||||
//Display the result saved location
|
||||
Console.WriteLine("\nResult saved in : " + Path.GetFullPath("../../Model/PredictedOutput.csv"));
|
||||
Console.ReadKey();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#region PredictResult
|
||||
|
||||
/// <summary>
|
||||
/// Predicts the results for given PMML and CSV file and serialize the results in a CSV file
|
||||
/// </summary>
|
||||
public Table PredictResult(Table inputTable, string pmmlPath)
|
||||
{
|
||||
//Get PMML Evaluator instance
|
||||
PMMLEvaluator evaluator = new PMMLEvaluatorFactory().
|
||||
GetPMMLEvaluatorInstance(pmmlPath);
|
||||
|
||||
string[] predictedCategories = null;
|
||||
|
||||
//Predict the value for each record using the PMML Evaluator instance
|
||||
for (int i = 0; i < inputTable.RowCount; i++)
|
||||
{
|
||||
var titanic = GetDataObject(inputTable, i);
|
||||
|
||||
//Get result
|
||||
PredictedResult predictedResult = evaluator.GetResult(titanic, null);
|
||||
|
||||
if (i == 0)
|
||||
{
|
||||
//Get the predicted propability fields
|
||||
predictedCategories = predictedResult.GetPredictedCategories();
|
||||
//Initialize the output table
|
||||
InitializeTable(inputTable.RowCount, predictedCategories);
|
||||
}
|
||||
|
||||
//Add predicted value
|
||||
outputTable[i, 0] = predictedResult.PredictedValue;
|
||||
}
|
||||
|
||||
return outputTable;
|
||||
}
|
||||
|
||||
#endregion PredictResult
|
||||
|
||||
#region Compare Predicted Results With R
|
||||
|
||||
/// <summary>
|
||||
/// Compare predicted results of PMML execution engine with R results
|
||||
/// </summary>
|
||||
|
||||
public void ComparePredictedResultsWithR(string rOutputDataCSVPath)
|
||||
{
|
||||
//Create instance to hold results of R
|
||||
rResults = new Table(rOutputDataCSVPath, true, ',');
|
||||
string differentIndices = string.Empty;
|
||||
//Pass the Table to the compare method of resultTable
|
||||
bool isDifferent = Compare(rResults, 1, 0, ref differentIndices);
|
||||
#if CONSOLE
|
||||
//Display mismatched index
|
||||
if (isDifferent)
|
||||
{
|
||||
Console.WriteLine("\nDifference in predicted results by R and PMML execution engine");
|
||||
Console.WriteLine("\nDifferent indices are " + differentIndices);
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("\nBoth predicted results by R and PMML execution engine are equal");
|
||||
}
|
||||
#endif
|
||||
//Dispose the R results Table
|
||||
rResults.Dispose();
|
||||
}
|
||||
|
||||
#endregion Compare Predicted Results With R
|
||||
|
||||
#region Initialize OutputTable
|
||||
|
||||
/// <summary>
|
||||
/// Initialize the outputTable
|
||||
/// </summary>
|
||||
/// <param name="rowCount">rowCount of output table</param>
|
||||
/// <param name="predictedfield">predictedfield name</param>
|
||||
/// <param name="predictedCategories">probableFields</param>
|
||||
private void InitializeTable(int rowCount, string[] predictedCategories)
|
||||
{
|
||||
//Create instance to hold evaluated results
|
||||
outputTable = new Table(rowCount, predictedCategories.Length + 1);
|
||||
//Add predicted column names
|
||||
outputTable.ColumnNames[0] = "Predicted_Cluster";
|
||||
}
|
||||
|
||||
#endregion Initialize OutputTable
|
||||
|
||||
#region GetDataObject
|
||||
|
||||
/// <summary>
|
||||
/// Returns the row as anonymous object
|
||||
/// </summary>
|
||||
/// <param name="inputTable"> input Table values</param>
|
||||
/// <param name="row">input row</param>
|
||||
/// <returns>Anonymous object</returns>
|
||||
public Dictionary<string, object> GetDataObject(Table inputTable, int row)
|
||||
{
|
||||
Dictionary<string, object> titanic = new Dictionary<string, object>();
|
||||
for (int i = 0; i < inputTable.ColumnCount; i++)
|
||||
{
|
||||
titanic.Add(inputTable.ColumnNames[i], inputTable[row, inputTable.ColumnNames[i]]);
|
||||
}
|
||||
return titanic;
|
||||
}
|
||||
|
||||
#endregion GetDataObject
|
||||
|
||||
#region Compare
|
||||
|
||||
/// <summary>
|
||||
/// Compares the result of 2 Tables based on column index.
|
||||
/// </summary>
|
||||
/// <param name="rOutput">R output table</param>
|
||||
/// <param name="rColumnIndex">R's Column to be compared</param>
|
||||
/// <param name="predictedColumnIndex">predicted result's column index</param>
|
||||
/// <param name="differentIndices"> different indices</param>
|
||||
public bool Compare(Table table, int rColumnIndex, int predictedColumnIndex, ref string differentIndices)
|
||||
{
|
||||
bool isDifferent = false;
|
||||
//Compare predicted values
|
||||
for (int i = 0; i < table.RowCount; i++)
|
||||
{
|
||||
//Compare Results based on column index
|
||||
if (outputTable[i, predictedColumnIndex].ToString() != table[i, rColumnIndex].ToString())
|
||||
{
|
||||
differentIndices += ", " + i;
|
||||
isDifferent = true;
|
||||
}
|
||||
}
|
||||
return isDifferent;
|
||||
}
|
||||
|
||||
#endregion Compare
|
||||
}
|
||||
}
|
|
@ -0,0 +1,179 @@
|
|||
,Predicted_Type
|
||||
1,1
|
||||
2,1
|
||||
3,3
|
||||
4,3
|
||||
5,1
|
||||
6,3
|
||||
7,3
|
||||
8,3
|
||||
9,1
|
||||
10,1
|
||||
11,3
|
||||
12,3
|
||||
13,3
|
||||
14,3
|
||||
15,3
|
||||
16,3
|
||||
17,3
|
||||
18,3
|
||||
19,3
|
||||
20,1
|
||||
21,1
|
||||
22,1
|
||||
23,1
|
||||
24,1
|
||||
25,1
|
||||
26,1
|
||||
27,3
|
||||
28,3
|
||||
29,1
|
||||
30,1
|
||||
31,3
|
||||
32,3
|
||||
33,1
|
||||
34,3
|
||||
35,1
|
||||
36,1
|
||||
37,1
|
||||
38,1
|
||||
39,1
|
||||
40,1
|
||||
41,1
|
||||
42,1
|
||||
43,1
|
||||
44,2
|
||||
45,1
|
||||
46,1
|
||||
47,1
|
||||
48,1
|
||||
49,1
|
||||
50,3
|
||||
51,3
|
||||
52,3
|
||||
53,3
|
||||
54,3
|
||||
55,1
|
||||
56,3
|
||||
57,1
|
||||
58,3
|
||||
59,3
|
||||
60,2
|
||||
61,2
|
||||
62,2
|
||||
63,2
|
||||
64,2
|
||||
65,2
|
||||
66,2
|
||||
67,2
|
||||
68,2
|
||||
69,1
|
||||
70,2
|
||||
71,1
|
||||
72,2
|
||||
73,2
|
||||
74,1
|
||||
75,1
|
||||
76,2
|
||||
77,2
|
||||
78,2
|
||||
79,1
|
||||
80,2
|
||||
81,2
|
||||
82,2
|
||||
83,2
|
||||
84,2
|
||||
85,2
|
||||
86,2
|
||||
87,2
|
||||
88,2
|
||||
89,2
|
||||
90,2
|
||||
91,2
|
||||
92,2
|
||||
93,2
|
||||
94,2
|
||||
95,2
|
||||
96,1
|
||||
97,2
|
||||
98,2
|
||||
99,2
|
||||
100,2
|
||||
101,2
|
||||
102,2
|
||||
103,2
|
||||
104,2
|
||||
105,2
|
||||
106,2
|
||||
107,2
|
||||
108,2
|
||||
109,2
|
||||
110,2
|
||||
111,2
|
||||
112,2
|
||||
113,2
|
||||
114,2
|
||||
115,2
|
||||
116,2
|
||||
117,2
|
||||
118,2
|
||||
119,2
|
||||
120,2
|
||||
121,2
|
||||
122,2
|
||||
123,2
|
||||
124,2
|
||||
125,2
|
||||
126,2
|
||||
127,2
|
||||
128,2
|
||||
129,2
|
||||
130,2
|
||||
131,2
|
||||
132,2
|
||||
133,2
|
||||
134,2
|
||||
135,2
|
||||
136,2
|
||||
137,2
|
||||
138,2
|
||||
139,2
|
||||
140,2
|
||||
141,2
|
||||
142,1
|
||||
143,2
|
||||
144,2
|
||||
145,1
|
||||
146,1
|
||||
147,2
|
||||
148,2
|
||||
149,2
|
||||
150,2
|
||||
151,2
|
||||
152,2
|
||||
153,2
|
||||
154,2
|
||||
155,2
|
||||
156,2
|
||||
157,2
|
||||
158,1
|
||||
159,2
|
||||
160,2
|
||||
161,2
|
||||
162,2
|
||||
163,2
|
||||
164,2
|
||||
165,2
|
||||
166,2
|
||||
167,2
|
||||
168,2
|
||||
169,1
|
||||
170,2
|
||||
171,2
|
||||
172,2
|
||||
173,2
|
||||
174,1
|
||||
175,1
|
||||
176,1
|
||||
177,1
|
||||
178,2
|
|
|
@ -0,0 +1,76 @@
|
|||
# Copyright Syncfusion Inc. 2001 - 2016. All rights reserved.
|
||||
# Use of this code is subject to the terms of our license.
|
||||
# A copy of the current license can be obtained at any time by e-mailing
|
||||
# licensing@syncfusion.com. Any infringement will be prosecuted under
|
||||
# applicable laws.
|
||||
|
||||
|
||||
# If you are not familiar with R you can obtain a quick introduction by downloading
|
||||
# R Succinctly for free from Syncfusion - http://www.syncfusion.com/resources/techportal/ebooks/rsuccinctly
|
||||
# R Succinctly is also included with this installation and is available here
|
||||
# Installed Drive :\Program Files (x86)\Syncfusion\Essential Studio\XX.X.X.XX\Infrastructure\EBooks\R_Succintly.pdf OF R Succinctly
|
||||
# Uncomment below lines to install necessary packages if not installed already
|
||||
# install.packages("pmml")
|
||||
# install.packages("rattle")
|
||||
|
||||
# Load below packages
|
||||
library(pmml)
|
||||
library(rattle.data) # This package is specifically loaded for wine dataset shipped within it.
|
||||
|
||||
# Here we directly load the wine dataset installed with the "rattle.data" package.
|
||||
data(wine)
|
||||
|
||||
# rename column names for wine dataset from rattle.data
|
||||
wineOriginal <- setNames(wine, c("Type", "Alcohol", "Malic_Acid","Ash","Alcalinity","Magnesium","Phenols","Flavanoids","Non_Flavanoids","Proanthocyanins","Color_Intensity","Hue","Dilution","Proline"))
|
||||
|
||||
# Omit rows with missing values
|
||||
wineOriginal <- na.omit(wineOriginal)
|
||||
|
||||
# Code below demonstrates loading the same dataset from a CSV file shipped with our installer.
|
||||
# Please check installed samples (Data) location to set actual working directory
|
||||
# Uncomment below lines and comment out the code to read data from CSV file.
|
||||
# setwd("C:/actual_data_location")
|
||||
# wine <- read.csv("Wine.csv")
|
||||
|
||||
# Get numeric fields data of titanic
|
||||
numericWineData <- wineOriginal[,c("Alcohol","Malic_Acid","Ash","Alcalinity","Magnesium","Phenols","Flavanoids","Non_Flavanoids","Proanthocyanins","Color_Intensity","Hue","Dilution","Proline")]
|
||||
|
||||
# Randomizing data
|
||||
wine<- numericWineData[sample(nrow(numericWineData)),]
|
||||
|
||||
# Divide dataset for training and test
|
||||
trainData<-wine[1:148,]
|
||||
testData<-wine[149:178,]
|
||||
|
||||
# Applying KMeans Clustering algorithm with centroids "3"
|
||||
wine_KMeans <- kmeans(trainData,3)
|
||||
wine_KMeans
|
||||
|
||||
# Predict "Type" column for test data set
|
||||
wineTestPrediction<-predict(wine_KMeans,testData)
|
||||
# Display predicted values
|
||||
wineTestPrediction
|
||||
|
||||
# PMML generation
|
||||
pmmlFile<-pmml(wine_KMeans,data=trainData)
|
||||
write(toString(pmmlFile),file="Wine.pmml")
|
||||
saveXML(pmmlFile,file="Wine.pmml")
|
||||
|
||||
# The code below is used for evaluation purpose.
|
||||
# The model is applied for original Wine data set and predicted results are saved in "ROuput.csv"
|
||||
# "ROuput.csv" file used for comparing the R results with PMML Evaluation engine results
|
||||
|
||||
# The below code is used for evaluation purpose.
|
||||
# The model is applied for original Wine data set and predicted results are saved in "ROuput.csv"
|
||||
# "ROuput.csv" file used for comparing the R results with PMML Evaluation engine results
|
||||
|
||||
# Applying Support vector Machine model to entire dataset and save the results in a CSV file
|
||||
wineEntirePrediction<-predict(wine_KMeans,numericWineData)
|
||||
wineEntirePrediction
|
||||
|
||||
# Save predicted value in a data frame
|
||||
result <- data.frame(wineEntirePrediction)
|
||||
names(result) <- c("Predicted_Type")
|
||||
|
||||
# Write the results in a CSV file
|
||||
write.csv(result,"ROutput.csv",quote=F)
|
|
@ -0,0 +1,179 @@
|
|||
Type,Alcohol,Malic_Acid,Ash,Alcalinity,Magnesium,Phenols,Flavanoids,Non_Flavanoids,Proanthocyanins,Color_Intensity,Hue,Dilution,Proline
|
||||
1,14.23,1.71,2.43,15.6,127,2.8,3.06,0.28,2.29,5.64,1.04,3.92,1065
|
||||
1,13.2,1.78,2.14,11.2,100,2.65,2.76,0.26,1.28,4.38,1.05,3.4,1050
|
||||
1,13.16,2.36,2.67,18.6,101,2.8,3.24,0.3,2.81,5.68,1.03,3.17,1185
|
||||
1,14.37,1.95,2.5,16.8,113,3.85,3.49,0.24,2.18,7.8,0.86,3.45,1480
|
||||
1,13.24,2.59,2.87,21,118,2.8,2.69,0.39,1.82,4.32,1.04,2.93,735
|
||||
1,14.2,1.76,2.45,15.2,112,3.27,3.39,0.34,1.97,6.75,1.05,2.85,1450
|
||||
1,14.39,1.87,2.45,14.6,96,2.5,2.52,0.3,1.98,5.25,1.02,3.58,1290
|
||||
1,14.06,2.15,2.61,17.6,121,2.6,2.51,0.31,1.25,5.05,1.06,3.58,1295
|
||||
1,14.83,1.64,2.17,14,97,2.8,2.98,0.29,1.98,5.2,1.08,2.85,1045
|
||||
1,13.86,1.35,2.27,16,98,2.98,3.15,0.22,1.85,7.22,1.01,3.55,1045
|
||||
1,14.1,2.16,2.3,18,105,2.95,3.32,0.22,2.38,5.75,1.25,3.17,1510
|
||||
1,14.12,1.48,2.32,16.8,95,2.2,2.43,0.26,1.57,5,1.17,2.82,1280
|
||||
1,13.75,1.73,2.41,16,89,2.6,2.76,0.29,1.81,5.6,1.15,2.9,1320
|
||||
1,14.75,1.73,2.39,11.4,91,3.1,3.69,0.43,2.81,5.4,1.25,2.73,1150
|
||||
1,14.38,1.87,2.38,12,102,3.3,3.64,0.29,2.96,7.5,1.2,3,1547
|
||||
1,13.63,1.81,2.7,17.2,112,2.85,2.91,0.3,1.46,7.3,1.28,2.88,1310
|
||||
1,14.3,1.92,2.72,20,120,2.8,3.14,0.33,1.97,6.2,1.07,2.65,1280
|
||||
1,13.83,1.57,2.62,20,115,2.95,3.4,0.4,1.72,6.6,1.13,2.57,1130
|
||||
1,14.19,1.59,2.48,16.5,108,3.3,3.93,0.32,1.86,8.7,1.23,2.82,1680
|
||||
1,13.64,3.1,2.56,15.2,116,2.7,3.03,0.17,1.66,5.1,0.96,3.36,845
|
||||
1,14.06,1.63,2.28,16,126,3,3.17,0.24,2.1,5.65,1.09,3.71,780
|
||||
1,12.93,3.8,2.65,18.6,102,2.41,2.41,0.25,1.98,4.5,1.03,3.52,770
|
||||
1,13.71,1.86,2.36,16.6,101,2.61,2.88,0.27,1.69,3.8,1.11,4,1035
|
||||
1,12.85,1.6,2.52,17.8,95,2.48,2.37,0.26,1.46,3.93,1.09,3.63,1015
|
||||
1,13.5,1.81,2.61,20,96,2.53,2.61,0.28,1.66,3.52,1.12,3.82,845
|
||||
1,13.05,2.05,3.22,25,124,2.63,2.68,0.47,1.92,3.58,1.13,3.2,830
|
||||
1,13.39,1.77,2.62,16.1,93,2.85,2.94,0.34,1.45,4.8,0.92,3.22,1195
|
||||
1,13.3,1.72,2.14,17,94,2.4,2.19,0.27,1.35,3.95,1.02,2.77,1285
|
||||
1,13.87,1.9,2.8,19.4,107,2.95,2.97,0.37,1.76,4.5,1.25,3.4,915
|
||||
1,14.02,1.68,2.21,16,96,2.65,2.33,0.26,1.98,4.7,1.04,3.59,1035
|
||||
1,13.73,1.5,2.7,22.5,101,3,3.25,0.29,2.38,5.7,1.19,2.71,1285
|
||||
1,13.58,1.66,2.36,19.1,106,2.86,3.19,0.22,1.95,6.9,1.09,2.88,1515
|
||||
1,13.68,1.83,2.36,17.2,104,2.42,2.69,0.42,1.97,3.84,1.23,2.87,990
|
||||
1,13.76,1.53,2.7,19.5,132,2.95,2.74,0.5,1.35,5.4,1.25,3,1235
|
||||
1,13.51,1.8,2.65,19,110,2.35,2.53,0.29,1.54,4.2,1.1,2.87,1095
|
||||
1,13.48,1.81,2.41,20.5,100,2.7,2.98,0.26,1.86,5.1,1.04,3.47,920
|
||||
1,13.28,1.64,2.84,15.5,110,2.6,2.68,0.34,1.36,4.6,1.09,2.78,880
|
||||
1,13.05,1.65,2.55,18,98,2.45,2.43,0.29,1.44,4.25,1.12,2.51,1105
|
||||
1,13.07,1.5,2.1,15.5,98,2.4,2.64,0.28,1.37,3.7,1.18,2.69,1020
|
||||
1,14.22,3.99,2.51,13.2,128,3,3.04,0.2,2.08,5.1,0.89,3.53,760
|
||||
1,13.56,1.71,2.31,16.2,117,3.15,3.29,0.34,2.34,6.13,0.95,3.38,795
|
||||
1,13.41,3.84,2.12,18.8,90,2.45,2.68,0.27,1.48,4.28,0.91,3,1035
|
||||
1,13.88,1.89,2.59,15,101,3.25,3.56,0.17,1.7,5.43,0.88,3.56,1095
|
||||
1,13.24,3.98,2.29,17.5,103,2.64,2.63,0.32,1.66,4.36,0.82,3,680
|
||||
1,13.05,1.77,2.1,17,107,3,3,0.28,2.03,5.04,0.88,3.35,885
|
||||
1,14.21,4.04,2.44,18.9,111,2.85,2.65,0.3,1.25,5.24,0.87,3.33,1080
|
||||
1,14.38,3.59,2.28,16,102,3.25,3.17,0.27,2.19,4.9,1.04,3.44,1065
|
||||
1,13.9,1.68,2.12,16,101,3.1,3.39,0.21,2.14,6.1,0.91,3.33,985
|
||||
1,14.1,2.02,2.4,18.8,103,2.75,2.92,0.32,2.38,6.2,1.07,2.75,1060
|
||||
1,13.94,1.73,2.27,17.4,108,2.88,3.54,0.32,2.08,8.9,1.12,3.1,1260
|
||||
1,13.05,1.73,2.04,12.4,92,2.72,3.27,0.17,2.91,7.2,1.12,2.91,1150
|
||||
1,13.83,1.65,2.6,17.2,94,2.45,2.99,0.22,2.29,5.6,1.24,3.37,1265
|
||||
1,13.82,1.75,2.42,14,111,3.88,3.74,0.32,1.87,7.05,1.01,3.26,1190
|
||||
1,13.77,1.9,2.68,17.1,115,3,2.79,0.39,1.68,6.3,1.13,2.93,1375
|
||||
1,13.74,1.67,2.25,16.4,118,2.6,2.9,0.21,1.62,5.85,0.92,3.2,1060
|
||||
1,13.56,1.73,2.46,20.5,116,2.96,2.78,0.2,2.45,6.25,0.98,3.03,1120
|
||||
1,14.22,1.7,2.3,16.3,118,3.2,3,0.26,2.03,6.38,0.94,3.31,970
|
||||
1,13.29,1.97,2.68,16.8,102,3,3.23,0.31,1.66,6,1.07,2.84,1270
|
||||
1,13.72,1.43,2.5,16.7,108,3.4,3.67,0.19,2.04,6.8,0.89,2.87,1285
|
||||
2,12.37,0.94,1.36,10.6,88,1.98,0.57,0.28,0.42,1.95,1.05,1.82,520
|
||||
2,12.33,1.1,2.28,16,101,2.05,1.09,0.63,0.41,3.27,1.25,1.67,680
|
||||
2,12.64,1.36,2.02,16.8,100,2.02,1.41,0.53,0.62,5.75,0.98,1.59,450
|
||||
2,13.67,1.25,1.92,18,94,2.1,1.79,0.32,0.73,3.8,1.23,2.46,630
|
||||
2,12.37,1.13,2.16,19,87,3.5,3.1,0.19,1.87,4.45,1.22,2.87,420
|
||||
2,12.17,1.45,2.53,19,104,1.89,1.75,0.45,1.03,2.95,1.45,2.23,355
|
||||
2,12.37,1.21,2.56,18.1,98,2.42,2.65,0.37,2.08,4.6,1.19,2.3,678
|
||||
2,13.11,1.01,1.7,15,78,2.98,3.18,0.26,2.28,5.3,1.12,3.18,502
|
||||
2,12.37,1.17,1.92,19.6,78,2.11,2,0.27,1.04,4.68,1.12,3.48,510
|
||||
2,13.34,0.94,2.36,17,110,2.53,1.3,0.55,0.42,3.17,1.02,1.93,750
|
||||
2,12.21,1.19,1.75,16.8,151,1.85,1.28,0.14,2.5,2.85,1.28,3.07,718
|
||||
2,12.29,1.61,2.21,20.4,103,1.1,1.02,0.37,1.46,3.05,0.906,1.82,870
|
||||
2,13.86,1.51,2.67,25,86,2.95,2.86,0.21,1.87,3.38,1.36,3.16,410
|
||||
2,13.49,1.66,2.24,24,87,1.88,1.84,0.27,1.03,3.74,0.98,2.78,472
|
||||
2,12.99,1.67,2.6,30,139,3.3,2.89,0.21,1.96,3.35,1.31,3.5,985
|
||||
2,11.96,1.09,2.3,21,101,3.38,2.14,0.13,1.65,3.21,0.99,3.13,886
|
||||
2,11.66,1.88,1.92,16,97,1.61,1.57,0.34,1.15,3.8,1.23,2.14,428
|
||||
2,13.03,0.9,1.71,16,86,1.95,2.03,0.24,1.46,4.6,1.19,2.48,392
|
||||
2,11.84,2.89,2.23,18,112,1.72,1.32,0.43,0.95,2.65,0.96,2.52,500
|
||||
2,12.33,0.99,1.95,14.8,136,1.9,1.85,0.35,2.76,3.4,1.06,2.31,750
|
||||
2,12.7,3.87,2.4,23,101,2.83,2.55,0.43,1.95,2.57,1.19,3.13,463
|
||||
2,12,0.92,2,19,86,2.42,2.26,0.3,1.43,2.5,1.38,3.12,278
|
||||
2,12.72,1.81,2.2,18.8,86,2.2,2.53,0.26,1.77,3.9,1.16,3.14,714
|
||||
2,12.08,1.13,2.51,24,78,2,1.58,0.4,1.4,2.2,1.31,2.72,630
|
||||
2,13.05,3.86,2.32,22.5,85,1.65,1.59,0.61,1.62,4.8,0.84,2.01,515
|
||||
2,11.84,0.89,2.58,18,94,2.2,2.21,0.22,2.35,3.05,0.79,3.08,520
|
||||
2,12.67,0.98,2.24,18,99,2.2,1.94,0.3,1.46,2.62,1.23,3.16,450
|
||||
2,12.16,1.61,2.31,22.8,90,1.78,1.69,0.43,1.56,2.45,1.33,2.26,495
|
||||
2,11.65,1.67,2.62,26,88,1.92,1.61,0.4,1.34,2.6,1.36,3.21,562
|
||||
2,11.64,2.06,2.46,21.6,84,1.95,1.69,0.48,1.35,2.8,1,2.75,680
|
||||
2,12.08,1.33,2.3,23.6,70,2.2,1.59,0.42,1.38,1.74,1.07,3.21,625
|
||||
2,12.08,1.83,2.32,18.5,81,1.6,1.5,0.52,1.64,2.4,1.08,2.27,480
|
||||
2,12,1.51,2.42,22,86,1.45,1.25,0.5,1.63,3.6,1.05,2.65,450
|
||||
2,12.69,1.53,2.26,20.7,80,1.38,1.46,0.58,1.62,3.05,0.96,2.06,495
|
||||
2,12.29,2.83,2.22,18,88,2.45,2.25,0.25,1.99,2.15,1.15,3.3,290
|
||||
2,11.62,1.99,2.28,18,98,3.02,2.26,0.17,1.35,3.25,1.16,2.96,345
|
||||
2,12.47,1.52,2.2,19,162,2.5,2.27,0.32,3.28,2.6,1.16,2.63,937
|
||||
2,11.81,2.12,2.74,21.5,134,1.6,0.99,0.14,1.56,2.5,0.95,2.26,625
|
||||
2,12.29,1.41,1.98,16,85,2.55,2.5,0.29,1.77,2.9,1.23,2.74,428
|
||||
2,12.37,1.07,2.1,18.5,88,3.52,3.75,0.24,1.95,4.5,1.04,2.77,660
|
||||
2,12.29,3.17,2.21,18,88,2.85,2.99,0.45,2.81,2.3,1.42,2.83,406
|
||||
2,12.08,2.08,1.7,17.5,97,2.23,2.17,0.26,1.4,3.3,1.27,2.96,710
|
||||
2,12.6,1.34,1.9,18.5,88,1.45,1.36,0.29,1.35,2.45,1.04,2.77,562
|
||||
2,12.34,2.45,2.46,21,98,2.56,2.11,0.34,1.31,2.8,0.8,3.38,438
|
||||
2,11.82,1.72,1.88,19.5,86,2.5,1.64,0.37,1.42,2.06,0.94,2.44,415
|
||||
2,12.51,1.73,1.98,20.5,85,2.2,1.92,0.32,1.48,2.94,1.04,3.57,672
|
||||
2,12.42,2.55,2.27,22,90,1.68,1.84,0.66,1.42,2.7,0.86,3.3,315
|
||||
2,12.25,1.73,2.12,19,80,1.65,2.03,0.37,1.63,3.4,1,3.17,510
|
||||
2,12.72,1.75,2.28,22.5,84,1.38,1.76,0.48,1.63,3.3,0.88,2.42,488
|
||||
2,12.22,1.29,1.94,19,92,2.36,2.04,0.39,2.08,2.7,0.86,3.02,312
|
||||
2,11.61,1.35,2.7,20,94,2.74,2.92,0.29,2.49,2.65,0.96,3.26,680
|
||||
2,11.46,3.74,1.82,19.5,107,3.18,2.58,0.24,3.58,2.9,0.75,2.81,562
|
||||
2,12.52,2.43,2.17,21,88,2.55,2.27,0.26,1.22,2,0.9,2.78,325
|
||||
2,11.76,2.68,2.92,20,103,1.75,2.03,0.6,1.05,3.8,1.23,2.5,607
|
||||
2,11.41,0.74,2.5,21,88,2.48,2.01,0.42,1.44,3.08,1.1,2.31,434
|
||||
2,12.08,1.39,2.5,22.5,84,2.56,2.29,0.43,1.04,2.9,0.93,3.19,385
|
||||
2,11.03,1.51,2.2,21.5,85,2.46,2.17,0.52,2.01,1.9,1.71,2.87,407
|
||||
2,11.82,1.47,1.99,20.8,86,1.98,1.6,0.3,1.53,1.95,0.95,3.33,495
|
||||
2,12.42,1.61,2.19,22.5,108,2,2.09,0.34,1.61,2.06,1.06,2.96,345
|
||||
2,12.77,3.43,1.98,16,80,1.63,1.25,0.43,0.83,3.4,0.7,2.12,372
|
||||
2,12,3.43,2,19,87,2,1.64,0.37,1.87,1.28,0.93,3.05,564
|
||||
2,11.45,2.4,2.42,20,96,2.9,2.79,0.32,1.83,3.25,0.8,3.39,625
|
||||
2,11.56,2.05,3.23,28.5,119,3.18,5.08,0.47,1.87,6,0.93,3.69,465
|
||||
2,12.42,4.43,2.73,26.5,102,2.2,2.13,0.43,1.71,2.08,0.92,3.12,365
|
||||
2,13.05,5.8,2.13,21.5,86,2.62,2.65,0.3,2.01,2.6,0.73,3.1,380
|
||||
2,11.87,4.31,2.39,21,82,2.86,3.03,0.21,2.91,2.8,0.75,3.64,380
|
||||
2,12.07,2.16,2.17,21,85,2.6,2.65,0.37,1.35,2.76,0.86,3.28,378
|
||||
2,12.43,1.53,2.29,21.5,86,2.74,3.15,0.39,1.77,3.94,0.69,2.84,352
|
||||
2,11.79,2.13,2.78,28.5,92,2.13,2.24,0.58,1.76,3,0.97,2.44,466
|
||||
2,12.37,1.63,2.3,24.5,88,2.22,2.45,0.4,1.9,2.12,0.89,2.78,342
|
||||
2,12.04,4.3,2.38,22,80,2.1,1.75,0.42,1.35,2.6,0.79,2.57,580
|
||||
3,12.86,1.35,2.32,18,122,1.51,1.25,0.21,0.94,4.1,0.76,1.29,630
|
||||
3,12.88,2.99,2.4,20,104,1.3,1.22,0.24,0.83,5.4,0.74,1.42,530
|
||||
3,12.81,2.31,2.4,24,98,1.15,1.09,0.27,0.83,5.7,0.66,1.36,560
|
||||
3,12.7,3.55,2.36,21.5,106,1.7,1.2,0.17,0.84,5,0.78,1.29,600
|
||||
3,12.51,1.24,2.25,17.5,85,2,0.58,0.6,1.25,5.45,0.75,1.51,650
|
||||
3,12.6,2.46,2.2,18.5,94,1.62,0.66,0.63,0.94,7.1,0.73,1.58,695
|
||||
3,12.25,4.72,2.54,21,89,1.38,0.47,0.53,0.8,3.85,0.75,1.27,720
|
||||
3,12.53,5.51,2.64,25,96,1.79,0.6,0.63,1.1,5,0.82,1.69,515
|
||||
3,13.49,3.59,2.19,19.5,88,1.62,0.48,0.58,0.88,5.7,0.81,1.82,580
|
||||
3,12.84,2.96,2.61,24,101,2.32,0.6,0.53,0.81,4.92,0.89,2.15,590
|
||||
3,12.93,2.81,2.7,21,96,1.54,0.5,0.53,0.75,4.6,0.77,2.31,600
|
||||
3,13.36,2.56,2.35,20,89,1.4,0.5,0.37,0.64,5.6,0.7,2.47,780
|
||||
3,13.52,3.17,2.72,23.5,97,1.55,0.52,0.5,0.55,4.35,0.89,2.06,520
|
||||
3,13.62,4.95,2.35,20,92,2,0.8,0.47,1.02,4.4,0.91,2.05,550
|
||||
3,12.25,3.88,2.2,18.5,112,1.38,0.78,0.29,1.14,8.21,0.65,2,855
|
||||
3,13.16,3.57,2.15,21,102,1.5,0.55,0.43,1.3,4,0.6,1.68,830
|
||||
3,13.88,5.04,2.23,20,80,0.98,0.34,0.4,0.68,4.9,0.58,1.33,415
|
||||
3,12.87,4.61,2.48,21.5,86,1.7,0.65,0.47,0.86,7.65,0.54,1.86,625
|
||||
3,13.32,3.24,2.38,21.5,92,1.93,0.76,0.45,1.25,8.42,0.55,1.62,650
|
||||
3,13.08,3.9,2.36,21.5,113,1.41,1.39,0.34,1.14,9.4,0.57,1.33,550
|
||||
3,13.5,3.12,2.62,24,123,1.4,1.57,0.22,1.25,8.6,0.59,1.3,500
|
||||
3,12.79,2.67,2.48,22,112,1.48,1.36,0.24,1.26,10.8,0.48,1.47,480
|
||||
3,13.11,1.9,2.75,25.5,116,2.2,1.28,0.26,1.56,7.1,0.61,1.33,425
|
||||
3,13.23,3.3,2.28,18.5,98,1.8,0.83,0.61,1.87,10.52,0.56,1.51,675
|
||||
3,12.58,1.29,2.1,20,103,1.48,0.58,0.53,1.4,7.6,0.58,1.55,640
|
||||
3,13.17,5.19,2.32,22,93,1.74,0.63,0.61,1.55,7.9,0.6,1.48,725
|
||||
3,13.84,4.12,2.38,19.5,89,1.8,0.83,0.48,1.56,9.01,0.57,1.64,480
|
||||
3,12.45,3.03,2.64,27,97,1.9,0.58,0.63,1.14,7.5,0.67,1.73,880
|
||||
3,14.34,1.68,2.7,25,98,2.8,1.31,0.53,2.7,13,0.57,1.96,660
|
||||
3,13.48,1.67,2.64,22.5,89,2.6,1.1,0.52,2.29,11.75,0.57,1.78,620
|
||||
3,12.36,3.83,2.38,21,88,2.3,0.92,0.5,1.04,7.65,0.56,1.58,520
|
||||
3,13.69,3.26,2.54,20,107,1.83,0.56,0.5,0.8,5.88,0.96,1.82,680
|
||||
3,12.85,3.27,2.58,22,106,1.65,0.6,0.6,0.96,5.58,0.87,2.11,570
|
||||
3,12.96,3.45,2.35,18.5,106,1.39,0.7,0.4,0.94,5.28,0.68,1.75,675
|
||||
3,13.78,2.76,2.3,22,90,1.35,0.68,0.41,1.03,9.58,0.7,1.68,615
|
||||
3,13.73,4.36,2.26,22.5,88,1.28,0.47,0.52,1.15,6.62,0.78,1.75,520
|
||||
3,13.45,3.7,2.6,23,111,1.7,0.92,0.43,1.46,10.68,0.85,1.56,695
|
||||
3,12.82,3.37,2.3,19.5,88,1.48,0.66,0.4,0.97,10.26,0.72,1.75,685
|
||||
3,13.58,2.58,2.69,24.5,105,1.55,0.84,0.39,1.54,8.66,0.74,1.8,750
|
||||
3,13.4,4.6,2.86,25,112,1.98,0.96,0.27,1.11,8.5,0.67,1.92,630
|
||||
3,12.2,3.03,2.32,19,96,1.25,0.49,0.4,0.73,5.5,0.66,1.83,510
|
||||
3,12.77,2.39,2.28,19.5,86,1.39,0.51,0.48,0.64,9.899999,0.57,1.63,470
|
||||
3,14.16,2.51,2.48,20,91,1.68,0.7,0.44,1.24,9.7,0.62,1.71,660
|
||||
3,13.71,5.65,2.45,20.5,95,1.68,0.61,0.52,1.06,7.7,0.64,1.74,740
|
||||
3,13.4,3.91,2.48,23,102,1.8,0.75,0.43,1.41,7.3,0.7,1.56,750
|
||||
3,13.27,4.28,2.26,20,120,1.59,0.69,0.43,1.35,10.2,0.59,1.56,835
|
||||
3,13.17,2.59,2.37,20,120,1.65,0.68,0.53,1.46,9.3,0.6,1.62,840
|
||||
3,14.13,4.1,2.74,24.5,96,2.05,0.76,0.56,1.35,9.2,0.61,1.6,560
|
|
|
@ -0,0 +1,71 @@
|
|||
<?xml version="1.0"?>
|
||||
<PMML version="4.3" xmlns="http://www.dmg.org/PMML-4_3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.dmg.org/PMML-4_3 http://www.dmg.org/pmml/v4-3/pmml-4-3.xsd">
|
||||
<Header copyright="Copyright (c) 2017 Syncfusion" description="KMeans cluster model">
|
||||
<Extension name="user" value="Syncfusion" extender="Rattle/PMML"/>
|
||||
<Application name="Rattle/PMML" version="1.4"/>
|
||||
<Timestamp>2017-11-06 14:20:06</Timestamp>
|
||||
</Header>
|
||||
<DataDictionary numberOfFields="13">
|
||||
<DataField name="Alcohol" optype="continuous" dataType="double"/>
|
||||
<DataField name="Malic_Acid" optype="continuous" dataType="double"/>
|
||||
<DataField name="Ash" optype="continuous" dataType="double"/>
|
||||
<DataField name="Alcalinity" optype="continuous" dataType="double"/>
|
||||
<DataField name="Magnesium" optype="continuous" dataType="double"/>
|
||||
<DataField name="Phenols" optype="continuous" dataType="double"/>
|
||||
<DataField name="Flavanoids" optype="continuous" dataType="double"/>
|
||||
<DataField name="Non_Flavanoids" optype="continuous" dataType="double"/>
|
||||
<DataField name="Proanthocyanins" optype="continuous" dataType="double"/>
|
||||
<DataField name="Color_Intensity" optype="continuous" dataType="double"/>
|
||||
<DataField name="Hue" optype="continuous" dataType="double"/>
|
||||
<DataField name="Dilution" optype="continuous" dataType="double"/>
|
||||
<DataField name="Proline" optype="continuous" dataType="double"/>
|
||||
</DataDictionary>
|
||||
<ClusteringModel modelName="KMeans_Model" functionName="clustering" algorithmName="KMeans: Hartigan and Wong" modelClass="centerBased" numberOfClusters="3">
|
||||
<MiningSchema>
|
||||
<MiningField name="Alcohol"/>
|
||||
<MiningField name="Malic_Acid"/>
|
||||
<MiningField name="Ash"/>
|
||||
<MiningField name="Alcalinity"/>
|
||||
<MiningField name="Magnesium"/>
|
||||
<MiningField name="Phenols"/>
|
||||
<MiningField name="Flavanoids"/>
|
||||
<MiningField name="Non_Flavanoids"/>
|
||||
<MiningField name="Proanthocyanins"/>
|
||||
<MiningField name="Color_Intensity"/>
|
||||
<MiningField name="Hue"/>
|
||||
<MiningField name="Dilution"/>
|
||||
<MiningField name="Proline"/>
|
||||
</MiningSchema>
|
||||
<Output>
|
||||
<OutputField name="predictedValue" feature="predictedValue"/>
|
||||
<OutputField name="clusterAffinity_1" feature="clusterAffinity" value="1"/>
|
||||
<OutputField name="clusterAffinity_2" feature="clusterAffinity" value="2"/>
|
||||
<OutputField name="clusterAffinity_3" feature="clusterAffinity" value="3"/>
|
||||
</Output>
|
||||
<ComparisonMeasure kind="distance">
|
||||
<squaredEuclidean/>
|
||||
</ComparisonMeasure>
|
||||
<ClusteringField field="Alcohol" compareFunction="absDiff"/>
|
||||
<ClusteringField field="Malic_Acid" compareFunction="absDiff"/>
|
||||
<ClusteringField field="Ash" compareFunction="absDiff"/>
|
||||
<ClusteringField field="Alcalinity" compareFunction="absDiff"/>
|
||||
<ClusteringField field="Magnesium" compareFunction="absDiff"/>
|
||||
<ClusteringField field="Phenols" compareFunction="absDiff"/>
|
||||
<ClusteringField field="Flavanoids" compareFunction="absDiff"/>
|
||||
<ClusteringField field="Non_Flavanoids" compareFunction="absDiff"/>
|
||||
<ClusteringField field="Proanthocyanins" compareFunction="absDiff"/>
|
||||
<ClusteringField field="Color_Intensity" compareFunction="absDiff"/>
|
||||
<ClusteringField field="Hue" compareFunction="absDiff"/>
|
||||
<ClusteringField field="Dilution" compareFunction="absDiff"/>
|
||||
<ClusteringField field="Proline" compareFunction="absDiff"/>
|
||||
<Cluster name="1" size="56" id="1">
|
||||
<Array n="13" type="real">12.4998214285714 2.32678571428571 2.28017857142857 20.7732142857143 93.3035714285714 2.08107142857143 1.81017857142857 0.385178571428571 1.48678571428571 3.88660714285714 0.966071428571429 2.54696428571429 455.089285714286</Array>
|
||||
</Cluster>
|
||||
<Cluster name="2" size="40" id="2">
|
||||
<Array n="13" type="real">13.79075 1.916 2.4055 16.9975 103.825 2.82025 2.981 0.2815 1.94 5.49675 1.078 3.13025 1168.675</Array>
|
||||
</Cluster>
|
||||
<Cluster name="3" size="52" id="3">
|
||||
<Array n="13" type="real">12.9101923076923 2.54730769230769 2.41211538461538 20.0480769230769 103.980769230769 2.12403846153846 1.59326923076923 0.393269230769231 1.54576923076923 5.69288461538461 0.893769230769231 2.36673076923077 727.692307692308</Array>
|
||||
</Cluster>
|
||||
</ClusteringModel>
|
||||
</PMML>
|
|
@ -0,0 +1,187 @@
|
|||
#region Copyright Syncfusion Inc. 2001-2018.
|
||||
// Copyright Syncfusion Inc. 2001-2018. All rights reserved.
|
||||
// Use of this code is subject to the terms of our license.
|
||||
// A copy of the current license can be obtained at any time by e-mailing
|
||||
// licensing@syncfusion.com. Any infringement will be prosecuted under
|
||||
// applicable laws.
|
||||
#endregion
|
||||
using Syncfusion.PMML;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
namespace WineKMeans
|
||||
{
|
||||
/// <summary>
|
||||
/// Console program to demonstrate PMML execution engine
|
||||
/// </summary>
|
||||
public class Program
|
||||
{
|
||||
//Create Table instance for input, output and R Result
|
||||
public Table inputTable = null;
|
||||
private Table outputTable = null;
|
||||
private Table rResults = null;
|
||||
|
||||
#if CONSOLE
|
||||
|
||||
private static void Main(string[] args)
|
||||
{
|
||||
//Create instance
|
||||
Program program = new Program();
|
||||
//Load input csv
|
||||
program.inputTable = new Table("../../Model/Wine.csv", true, ',');
|
||||
//Invoke PredictResult
|
||||
program.outputTable = program.PredictResult(program.inputTable,
|
||||
"../../Model/Wine.pmml");
|
||||
//Dispose the inputTable values
|
||||
program.inputTable.Dispose();
|
||||
//Compare predicted results of PMML execution engine with R Results
|
||||
program.ComparePredictedResultsWithR("../../Model/ROutput.csv");
|
||||
//Write the Result as CSV File
|
||||
program.outputTable.WriteToCSV("../../Model/PredictedOutput.csv", true, ',');
|
||||
//Dispose the output Table
|
||||
program.outputTable.Dispose();
|
||||
//Display the result saved location
|
||||
Console.WriteLine("\nResult saved in : " + Path.GetFullPath("../../Model/PredictedOutput.csv"));
|
||||
Console.ReadKey();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#region PredictResult
|
||||
|
||||
/// <summary>
|
||||
/// Predicts the results for given PMML and CSV file and serialize the results in a CSV file
|
||||
/// </summary>
|
||||
public Table PredictResult(Table inputTable, string pmmlPath)
|
||||
{
|
||||
//Get PMML Evaluator instance
|
||||
PMMLEvaluator evaluator = new PMMLEvaluatorFactory().
|
||||
GetPMMLEvaluatorInstance(pmmlPath);
|
||||
|
||||
string[] predictedCategories = null;
|
||||
|
||||
//Predict the value for each record using the PMML Evaluator instance
|
||||
for (int i = 0; i < inputTable.RowCount; i++)
|
||||
{
|
||||
var wine = GetDataObject(inputTable, i);
|
||||
|
||||
//Get result
|
||||
PredictedResult predictedResult = evaluator.GetResult(wine, null);
|
||||
|
||||
if (i == 0)
|
||||
{
|
||||
//Get the predicted propability fields
|
||||
predictedCategories = predictedResult.GetPredictedCategories();
|
||||
//Initialize the output table
|
||||
InitializeTable(inputTable.RowCount, predictedCategories);
|
||||
}
|
||||
|
||||
//Add predicted value
|
||||
outputTable[i, 0] = predictedResult.PredictedValue;
|
||||
}
|
||||
|
||||
return outputTable;
|
||||
}
|
||||
|
||||
#endregion PredictResult
|
||||
|
||||
#region Compare Predicted Results With R
|
||||
|
||||
/// <summary>
|
||||
/// Compare predicted results of PMML execution engine with R results
|
||||
/// </summary>
|
||||
|
||||
public void ComparePredictedResultsWithR(string rOutputDataCSVPath)
|
||||
{
|
||||
//Create instance to hold results of R
|
||||
rResults = new Table(rOutputDataCSVPath, true, ',');
|
||||
string differentIndices = string.Empty;
|
||||
//Pass the Table to the compare method of resultTable
|
||||
bool isDifferent = Compare(rResults, 1, 0, ref differentIndices);
|
||||
#if CONSOLE
|
||||
//Display mismatched index
|
||||
if (isDifferent)
|
||||
{
|
||||
Console.WriteLine("\nDifference in predicted results by R and PMML execution engine");
|
||||
Console.WriteLine("\nDifferent indices are " + differentIndices);
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("\nBoth predicted results by R and PMML execution engine are equal");
|
||||
}
|
||||
#endif
|
||||
//Dispose the R results Table
|
||||
rResults.Dispose();
|
||||
}
|
||||
|
||||
#endregion Compare Predicted Results With R
|
||||
|
||||
#region Initialize OutputTable
|
||||
|
||||
/// <summary>
|
||||
/// Initialize the outputTable
|
||||
/// </summary>
|
||||
/// <param name="rowCount">rowCount of output table</param>
|
||||
/// <param name="predictedfield">predictedfield name</param>
|
||||
/// <param name="predictedCategories">probableFields</param>
|
||||
private void InitializeTable(int rowCount, string[] predictedCategories)
|
||||
{
|
||||
//Create instance to hold evaluated results
|
||||
outputTable = new Table(rowCount, predictedCategories.Length + 1);
|
||||
//Add predicted column names
|
||||
outputTable.ColumnNames[0] = "Predicted_Cluster";
|
||||
}
|
||||
|
||||
#endregion Initialize OutputTable
|
||||
|
||||
#region GetDataObject
|
||||
|
||||
/// <summary>
|
||||
/// Returns the row as anonymous object
|
||||
/// </summary>
|
||||
/// <param name="inputTable"> input Table values</param>
|
||||
/// <param name="row">input row</param>
|
||||
/// <returns>Anonymous object</returns>
|
||||
public Dictionary<string, object> GetDataObject(Table inputTable, int row)
|
||||
{
|
||||
Dictionary<string, object> wine = new Dictionary<string, object>();
|
||||
for (int i = 0; i < inputTable.ColumnCount; i++)
|
||||
{
|
||||
wine.Add(inputTable.ColumnNames[i], inputTable[row, inputTable.ColumnNames[i]]);
|
||||
}
|
||||
return wine;
|
||||
}
|
||||
|
||||
#endregion GetDataObject
|
||||
|
||||
#region Compare
|
||||
|
||||
/// <summary>
|
||||
/// Compares the result of 2 Tables based on column index.
|
||||
/// </summary>
|
||||
/// <param name="rOutput">R output table</param>
|
||||
/// <param name="rColumnIndex">R's Column to be compared</param>
|
||||
/// <param name="predictedColumnIndex">predicted result's column index</param>
|
||||
/// <param name="differentIndices"> different indices</param>
|
||||
public bool Compare(Table table, int rColumnIndex, int predictedColumnIndex, ref string differentIndices)
|
||||
{
|
||||
bool isDifferent = false;
|
||||
//Compare predicted values
|
||||
for (int i = 0; i < table.RowCount; i++)
|
||||
{
|
||||
//Compare Results based on column index
|
||||
if (outputTable[i, predictedColumnIndex].ToString() != table[i, rColumnIndex].ToString())
|
||||
{
|
||||
differentIndices += ", " + i;
|
||||
isDifferent = true;
|
||||
}
|
||||
}
|
||||
return isDifferent;
|
||||
}
|
||||
|
||||
#endregion Compare
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,64 @@
|
|||
# Copyright Syncfusion Inc. 2001 - 2016. All rights reserved.
|
||||
# Use of this code is subject to the terms of our license.
|
||||
# A copy of the current license can be obtained at any time by e-mailing
|
||||
# licensing@syncfusion.com. Any infringement will be prosecuted under
|
||||
# applicable laws.
|
||||
|
||||
|
||||
# If you are not familiar with R you can obtain a quick introduction by downloading
|
||||
# R Succinctly for free from Syncfusion - http://www.syncfusion.com/resources/techportal/ebooks/rsuccinctly
|
||||
# R Succinctly is also included with this installation and is available here
|
||||
# Installed Drive :\Program Files (x86)\Syncfusion\Essential Studio\XX.X.X.XX\Infrastructure\EBooks\R_Succintly.pdf OF R Succinctly
|
||||
# Uncomment below lines to install necessary packages if not installed already
|
||||
# install.packages("pmml")
|
||||
# install.packages("survival")
|
||||
|
||||
# Load below packages
|
||||
library(pmml)
|
||||
library(survival)
|
||||
|
||||
# Here we directly load the aml dataset installed with the "survival" package
|
||||
aml
|
||||
|
||||
# rename column names for aml dataset from survival package
|
||||
amlOriginal <- setNames(aml, c("Survival_Time", "Censoring_Status", "Maintenance_Status"))
|
||||
|
||||
# Code below demonstrates loading the same dataset from a CSV file shipped with our installer.
|
||||
# Please check installed samples (Data) location to set actual working directory
|
||||
# Uncomment below lines and comment out the code to read data from package.
|
||||
# setwd("C:/actual_data_location")
|
||||
# aml= read.csv("Aml.csv")
|
||||
|
||||
# Applying Cox Regression Model to predict Survival
|
||||
aml_Cox = coxph(Surv(Survival_Time,Censoring_Status)~Maintenance_Status, amlOriginal)
|
||||
summary(aml_Cox)
|
||||
|
||||
# Calculate Survival fit of the model
|
||||
survfit(aml_Cox, amlOriginal)
|
||||
plot(survfit(aml_Cox))
|
||||
|
||||
# Display the predicted results
|
||||
# Predict "Survival" column for test data set
|
||||
amlTestPrediction = predict(aml_Cox, type = "expected",amlOriginal)
|
||||
# Display predicted values
|
||||
amlTestPrediction
|
||||
|
||||
# PMML generation
|
||||
pmmlFile<-pmml(aml_Cox, data=trainData)
|
||||
write(toString(pmmlFile), file="Aml.pmml")
|
||||
saveXML(pmmlFile, file="Aml.pmml")
|
||||
|
||||
# The code below is used for evaluation purpose.
|
||||
# The model is applied for original aml data set and predicted results are saved in "ROutput.csv"
|
||||
# "ROutput.csv" file used for comparing the R results with PMML Evaluation engine results
|
||||
|
||||
# Applying Cox Regression model to entire dataset and save the results in a CSV file
|
||||
amlEntirePrediction = predict(aml_Cox, type = "expected", amlOriginal)
|
||||
|
||||
# Save predicted value in a data frame
|
||||
result = data.frame(amlEntirePrediction)
|
||||
names(result) = c("Predicted_Survival")
|
||||
|
||||
# Write the results in a CSV file
|
||||
write.csv(result,"ROutput.csv",quote=F)
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
Survival_Time,Censoring_Status,Maintenance_Status
|
||||
9,1,Maintained
|
||||
13,1,Maintained
|
||||
13,0,Maintained
|
||||
18,1,Maintained
|
||||
23,1,Maintained
|
||||
28,0,Maintained
|
||||
31,1,Maintained
|
||||
34,1,Maintained
|
||||
45,0,Maintained
|
||||
48,1,Maintained
|
||||
161,0,Maintained
|
||||
5,1,Nonmaintained
|
||||
5,1,Nonmaintained
|
||||
8,1,Nonmaintained
|
||||
8,1,Nonmaintained
|
||||
12,1,Nonmaintained
|
||||
16,0,Nonmaintained
|
||||
23,1,Nonmaintained
|
||||
27,1,Nonmaintained
|
||||
30,1,Nonmaintained
|
||||
33,1,Nonmaintained
|
||||
43,1,Nonmaintained
|
||||
45,1,Nonmaintained
|
|
|
@ -0,0 +1,66 @@
|
|||
<?xml version="1.0"?>
|
||||
<PMML version="4.3" xmlns="http://www.dmg.org/PMML-4_3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.dmg.org/PMML-4_3 http://www.dmg.org/pmml/v4-3/pmml-4-3.xsd">
|
||||
<Header copyright="Copyright (c) 2017 Syncfusion" description="CoxPH Survival Regression Model">
|
||||
<Extension name="user" value="Syncfusion" extender="Rattle/PMML"/>
|
||||
<Application name="Rattle/PMML" version="1.4"/>
|
||||
<Timestamp>2017-11-06 15:21:45</Timestamp>
|
||||
</Header>
|
||||
<DataDictionary numberOfFields="4">
|
||||
<DataField name="survival" optype="continuous" dataType="double"/>
|
||||
<DataField name="Maintenance_Status" optype="categorical" dataType="string"/>
|
||||
<DataField name="Survival_Time" optype="continuous" dataType="double"/>
|
||||
<DataField name="Censoring_Status" optype="continuous" dataType="double"/>
|
||||
</DataDictionary>
|
||||
<GeneralRegressionModel modelType="CoxRegression" modelName="CoxPH_Survival_Regression_Model" functionName="regression" algorithmName="coxph" endTimeVariable="Survival_Time" statusVariable="Censoring_Status">
|
||||
<MiningSchema>
|
||||
<MiningField name="survival" usageType="predicted"/>
|
||||
<MiningField name="Maintenance_Status" usageType="active"/>
|
||||
<MiningField name="Survival_Time" usageType="active"/>
|
||||
<MiningField name="Censoring_Status" usageType="active"/>
|
||||
</MiningSchema>
|
||||
<Output>
|
||||
<OutputField name="Predicted_hazard" feature="predictedValue"/>
|
||||
<OutputField name="SurvivalProbability" feature="transformedValue">
|
||||
<Apply function="exp">
|
||||
<Apply function="*">
|
||||
<Constant>-1.0</Constant>
|
||||
<FieldRef field="Predicted_hazard"/>
|
||||
</Apply>
|
||||
</Apply>
|
||||
</OutputField>
|
||||
</Output>
|
||||
<ParameterList>
|
||||
<Parameter name="p0" label="Maintenance_StatusNonmaintained" referencePoint="0.521739130434783"/>
|
||||
</ParameterList>
|
||||
<FactorList>
|
||||
<Predictor name="Maintenance_Status"/>
|
||||
</FactorList>
|
||||
<CovariateList/>
|
||||
<PPMatrix>
|
||||
<PPCell value="Nonmaintained" predictorName="Maintenance_Status" parameterName="p0"/>
|
||||
</PPMatrix>
|
||||
<ParamMatrix>
|
||||
<PCell parameterName="p0" df="1" beta="0.915532575014718"/>
|
||||
</ParamMatrix>
|
||||
<BaseCumHazardTables maxTime="161">
|
||||
<BaselineCell time="5" cumHazard="0.0812474179599717"/>
|
||||
<BaselineCell time="8" cumHazard="0.17421067267947"/>
|
||||
<BaselineCell time="9" cumHazard="0.226246179640148"/>
|
||||
<BaselineCell time="12" cumHazard="0.280017080300855"/>
|
||||
<BaselineCell time="13" cumHazard="0.338674896856656"/>
|
||||
<BaselineCell time="16" cumHazard="0.338674896856656"/>
|
||||
<BaselineCell time="18" cumHazard="0.408810083512794"/>
|
||||
<BaselineCell time="23" cumHazard="0.561796220656738"/>
|
||||
<BaselineCell time="27" cumHazard="0.64899287143167"/>
|
||||
<BaselineCell time="28" cumHazard="0.64899287143167"/>
|
||||
<BaselineCell time="30" cumHazard="0.756534672753084"/>
|
||||
<BaselineCell time="31" cumHazard="0.885578311160185"/>
|
||||
<BaselineCell time="33" cumHazard="1.02584868447246"/>
|
||||
<BaselineCell time="34" cumHazard="1.20506992056653"/>
|
||||
<BaselineCell time="43" cumHazard="1.40670442763183"/>
|
||||
<BaselineCell time="45" cumHazard="1.69995308287326"/>
|
||||
<BaselineCell time="48" cumHazard="2.50610907951114"/>
|
||||
<BaselineCell time="161" cumHazard="2.50610907951114"/>
|
||||
</BaseCumHazardTables>
|
||||
</GeneralRegressionModel>
|
||||
</PMML>
|
|
@ -0,0 +1,24 @@
|
|||
,Predicted_Survival
|
||||
1,0.140324069152696
|
||||
2,0.210055434847053
|
||||
3,0.210055434847053
|
||||
4,0.253555196027669
|
||||
5,0.34844138293317
|
||||
6,0.402523130844611
|
||||
7,0.54925989191518
|
||||
8,0.747417327162701
|
||||
9,1.054357401026
|
||||
10,1.554357401026
|
||||
11,1.554357401026
|
||||
12,0.125884201314644
|
||||
13,0.125884201314644
|
||||
14,0.269920841072715
|
||||
15,0.269920841072715
|
||||
16,0.433856575300623
|
||||
17,0.524740600582829
|
||||
18,0.870443274564138
|
||||
19,1.00554517707041
|
||||
20,1.17216971859066
|
||||
21,1.58944303163107
|
||||
22,2.17953835093503
|
||||
23,2.63389583919206
|
|
|
@ -0,0 +1,190 @@
|
|||
#region Copyright Syncfusion Inc. 2001-2018.
|
||||
// Copyright Syncfusion Inc. 2001-2018. All rights reserved.
|
||||
// Use of this code is subject to the terms of our license.
|
||||
// A copy of the current license can be obtained at any time by e-mailing
|
||||
// licensing@syncfusion.com. Any infringement will be prosecuted under
|
||||
// applicable laws.
|
||||
#endregion
|
||||
using Syncfusion.PMML;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
namespace AmlCoxRegression
|
||||
{
|
||||
/// <summary>
|
||||
/// Console program to demonstrate PMML execution engine
|
||||
/// </summary>
|
||||
public class Program
|
||||
{
|
||||
//Create Table instance for input, output and R Result
|
||||
public Table inputTable = null;
|
||||
private Table outputTable = null;
|
||||
private Table rResults = null;
|
||||
|
||||
#if CONSOLE
|
||||
|
||||
private static void Main(string[] args)
|
||||
{
|
||||
//Create instance
|
||||
Program program = new Program();
|
||||
//Load input csv
|
||||
program.inputTable = new Table("../../Model/Aml.csv", true, ',');
|
||||
//Invoke PredictResult
|
||||
program.outputTable = program.PredictResult(program.inputTable,
|
||||
"../../Model/Aml.pmml");
|
||||
//Dispose the inputTable values
|
||||
program.inputTable.Dispose();
|
||||
//Compare predicted results of PMML execution engine with R Results
|
||||
program.ComparePredictedResultsWithR("../../Model/ROutput.csv");
|
||||
//Write the Result as CSV Table
|
||||
program.outputTable.WriteToCSV("../../Model/PredictedOutput.csv", true, ',');
|
||||
//Dispose the output Table
|
||||
program.outputTable.Dispose();
|
||||
//Display the result saved location
|
||||
Console.WriteLine("\nResult saved in : " + Path.GetFullPath("../../Model/PredictedOutput.csv"));
|
||||
Console.ReadKey();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#region PredictResult
|
||||
|
||||
/// <summary>
|
||||
/// Predicts the results for given PMML and CSV file and serialize the results in a CSV file
|
||||
/// </summary>
|
||||
public Table PredictResult(Table inputTable, string pmmlPath)
|
||||
{
|
||||
//Get PMML Evaluator instance
|
||||
PMMLEvaluator evaluator = new PMMLEvaluatorFactory().
|
||||
GetPMMLEvaluatorInstance(pmmlPath);
|
||||
|
||||
string[] predictedCategories = null;
|
||||
|
||||
//Predict the value for each record using the PMML Evaluator instance
|
||||
for (int i = 0; i < inputTable.RowCount; i++)
|
||||
{
|
||||
var aml = GetDataObject(inputTable, i);
|
||||
|
||||
//Get result
|
||||
PredictedResult predictedResult = evaluator.GetResult(aml, null);
|
||||
|
||||
if (i == 0)
|
||||
{
|
||||
//Get the predicted propability fields
|
||||
predictedCategories = predictedResult.GetPredictedCategories();
|
||||
//Initialize the output table
|
||||
InitializeTable(inputTable.RowCount, predictedResult.PredictedField, predictedCategories);
|
||||
}
|
||||
|
||||
//Add predicted value
|
||||
outputTable[i, 0] = predictedResult.PredictedValue;
|
||||
//Add predicted Survival
|
||||
outputTable[i, 1] = predictedResult.GetPredictedProbability("survival");
|
||||
}
|
||||
return outputTable;
|
||||
}
|
||||
|
||||
#endregion PredictResult
|
||||
|
||||
#region Compare Predicted Results With R
|
||||
|
||||
/// <summary>
|
||||
/// Compare predicted results of PMML execution engine with R results
|
||||
/// </summary>
|
||||
|
||||
public void ComparePredictedResultsWithR(string rOutputDataCSVPath)
|
||||
{
|
||||
//Create instance to hold results of R
|
||||
rResults = new Table(rOutputDataCSVPath, true, ',');
|
||||
string differentIndices = string.Empty;
|
||||
//Pass the Table to the compare method of resultTable
|
||||
bool isDifferent = Compare(rResults, 1, 0, ref differentIndices);
|
||||
#if CONSOLE
|
||||
//Display mismatched index
|
||||
if (isDifferent)
|
||||
{
|
||||
Console.WriteLine("\nDifference in predicted results by R and PMML execution engine");
|
||||
Console.WriteLine("\nDifferent indices are " + differentIndices);
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("\nBoth predicted results by R and PMML execution engine are equal");
|
||||
}
|
||||
#endif
|
||||
//Dispose the R results Table
|
||||
rResults.Dispose();
|
||||
}
|
||||
|
||||
#endregion Compare Predicted Results With R
|
||||
|
||||
#region Initialize OutputTable
|
||||
|
||||
/// <summary>
|
||||
/// Initialize the outputTable
|
||||
/// </summary>
|
||||
/// <param name="rowCount">rowCount of output table</param>
|
||||
/// <param name="predictedfield">predictedfield name</param>
|
||||
/// <param name="predictedCategories">probableFields</param>
|
||||
private void InitializeTable(int rowCount, string predictedfield, string[] predictedCategories)
|
||||
{
|
||||
//Create instance to hold evaluated results
|
||||
outputTable = new Table(rowCount, predictedCategories.Length + 1);
|
||||
//Add predicted column names
|
||||
outputTable.ColumnNames[0] = "CumulativeHazard";
|
||||
outputTable.ColumnNames[1] = "Predicted_" + predictedfield;
|
||||
}
|
||||
|
||||
#endregion Initialize OutputTable
|
||||
|
||||
#region GetDataObject
|
||||
|
||||
/// <summary>
|
||||
/// Returns the row as anonymous object
|
||||
/// </summary>
|
||||
/// <param name="inputTable"> input Table values</param>
|
||||
/// <param name="row">input row</param>
|
||||
/// <returns>Anonymous object</returns>
|
||||
public Dictionary<string, object> GetDataObject(Table inputTable, int row)
|
||||
{
|
||||
Dictionary<string, object> aml = new Dictionary<string, object>();
|
||||
for (int i = 0; i < inputTable.ColumnCount; i++)
|
||||
{
|
||||
aml.Add(inputTable.ColumnNames[i], inputTable[row, inputTable.ColumnNames[i]]);
|
||||
}
|
||||
return aml;
|
||||
}
|
||||
|
||||
#endregion GetDataObject
|
||||
|
||||
#region Compare
|
||||
|
||||
/// <summary>
|
||||
/// Compares the result of 2 Tables based on column index.
|
||||
/// </summary>
|
||||
/// <param name="rOutput">R output table</param>
|
||||
/// <param name="rColumnIndex">R's Column to be compared</param>
|
||||
/// <param name="predictedColumnIndex">predicted result's column index</param>
|
||||
/// <param name="differentIndices"> different indices</param>
|
||||
/// <returns>IsDifferent</returns>
|
||||
public bool Compare(Table table, int rColumnIndex, int predictedColumnIndex, ref string differentIndices)
|
||||
{
|
||||
bool isDifferent = false;
|
||||
//Compare predicted values
|
||||
for (int i = 0; i < table.RowCount; i++)
|
||||
{
|
||||
//Compare Results based on column index
|
||||
double predictedC = Math.Round(Convert.ToDouble(outputTable[i, predictedColumnIndex]), 2);
|
||||
double predictedR = Math.Round(Convert.ToDouble(table[i, rColumnIndex]), 2);
|
||||
if (predictedC != predictedR)
|
||||
{
|
||||
differentIndices += ", " + i;
|
||||
isDifferent = true;
|
||||
}
|
||||
}
|
||||
return isDifferent;
|
||||
}
|
||||
|
||||
#endregion Compare
|
||||
}
|
||||
}
|
|
@ -0,0 +1,70 @@
|
|||
# Copyright Syncfusion Inc. 2001 - 2016. All rights reserved.
|
||||
# Use of this code is subject to the terms of our license.
|
||||
# A copy of the current license can be obtained at any time by e-mailing
|
||||
# licensing@syncfusion.com. Any infringement will be prosecuted under
|
||||
# applicable laws.
|
||||
|
||||
|
||||
# If you are not familiar with R you can obtain a quick introduction by downloading
|
||||
# R Succinctly for free from Syncfusion - http://www.syncfusion.com/resources/techportal/ebooks/rsuccinctly
|
||||
# R Succinctly is also included with this installation and is available here
|
||||
# Installed Drive :\Program Files (x86)\Syncfusion\Essential Studio\XX.X.X.XX\Infrastructure\EBooks\R_Succintly.pdf OF R Succinctly
|
||||
# Uncomment below lines to install necessary packages if not installed already
|
||||
# install.packages("pmml")
|
||||
# install.packages("survival")
|
||||
# install.packages("KMsurv")
|
||||
|
||||
# Load below packages
|
||||
library(pmml)
|
||||
library(survival)
|
||||
library(KMsurv) #This package is specifically loaded for bfeed data shipped within it.
|
||||
|
||||
# Here we directly load the larynx dataset installed with the "KMsurv" package.
|
||||
data(bfeed)
|
||||
|
||||
# rename column names for bfeed dataset from KMsurv package
|
||||
bfeedOriginal <- setNames(bfeed, c("Duration", "Bfeed_Indicator", "Race", "Is_Poor", "Smoker", "Alcoholic", "Age", "Year", "Education_Level", "Prenatal_Care"))
|
||||
|
||||
# Code below demonstrates loading the same dataset from a CSV file shipped with our installer.
|
||||
# Please check installed samples (Data) location to set actual working directory
|
||||
# Uncomment below lines and comment out the code to read data from package.
|
||||
# setwd("C:/actual_data_location")
|
||||
# bfeed = read.csv("Bfeed.csv")
|
||||
|
||||
# Divide dataset for training and test
|
||||
trainData=bfeedOriginal[1:741,]
|
||||
testData=bfeedOriginal[742:927,]
|
||||
|
||||
# Applying Cox Regression Model to predict Survival
|
||||
bfeed_Cox = coxph(Surv(Duration,Bfeed_Indicator)~Race+Is_Poor+Smoker+Alcoholic+Age+Year+Education_Level+Prenatal_Care, trainData)
|
||||
summary(bfeed_Cox)
|
||||
|
||||
# Calculate Survival fit of the model
|
||||
survfit(bfeed_Cox, trainData)
|
||||
plot(survfit(bfeed_Cox))
|
||||
|
||||
# Display the predicted results
|
||||
# Predict "Survival" column for test data set
|
||||
bfeedTestPrediction = predict(bfeed_Cox, type = "expected",testData)
|
||||
# Display predicted values
|
||||
bfeedTestPrediction
|
||||
|
||||
# The code below is used for evaluation purpose.
|
||||
# The model is applied for original bfeed data set and predicted results are saved in "ROutput.csv"
|
||||
# "ROutput.csv" file used for comparing the R results with PMML Evaluation engine results
|
||||
|
||||
# Applying Cox Regression model to entire dataset and save the results in a CSV file
|
||||
bfeedEntirePrediction = predict(bfeed_Cox, type = "expected", bfeedOriginal)
|
||||
|
||||
# PMML generation
|
||||
pmmlFile<-pmml(bfeed_Cox, data=bfeedOriginal)
|
||||
write(toString(pmmlFile), file="Bfeed.pmml")
|
||||
saveXML(pmmlFile, file="Bfeed.pmml")
|
||||
|
||||
# Save predicted value in a data frame
|
||||
result = data.frame(bfeedEntirePrediction)
|
||||
names(result) = c("Predicted_Survival")
|
||||
|
||||
# Write the results in a CSV file
|
||||
write.csv(result,"ROutput.csv",quote=F)
|
||||
|
|
@ -0,0 +1,928 @@
|
|||
Duration,Bfeed_Indicator,Race,Is_Poor,Smoker,Alcoholic,Age,Year,Education_Level,Prenatal_Care
|
||||
16,1,1,0,0,1,24,82,14,0
|
||||
1,1,1,0,1,0,26,85,12,0
|
||||
4,0,1,0,0,0,25,85,12,0
|
||||
3,1,1,0,1,1,21,85,9,0
|
||||
36,1,1,0,1,0,22,82,12,0
|
||||
36,1,1,0,0,0,18,82,11,0
|
||||
16,1,1,1,1,0,20,81,9,0
|
||||
8,0,1,0,1,0,24,85,12,0
|
||||
20,1,1,1,0,0,24,85,12,0
|
||||
44,1,1,0,0,0,24,82,14,0
|
||||
20,1,1,0,1,0,26,84,12,0
|
||||
30,1,1,0,1,0,22,84,12,1
|
||||
24,1,1,0,0,0,19,83,12,0
|
||||
13,1,1,0,0,0,22,80,14,0
|
||||
6,1,1,0,0,0,27,84,16,0
|
||||
2,1,1,0,0,0,22,81,12,1
|
||||
5,1,1,0,0,0,26,85,13,0
|
||||
192,1,1,0,0,0,21,78,12,0
|
||||
4,1,1,0,0,0,20,83,12,0
|
||||
12,1,1,0,1,0,22,81,12,0
|
||||
4,1,2,0,0,0,24,86,12,0
|
||||
16,0,2,1,1,1,21,84,12,1
|
||||
24,1,1,0,0,0,27,84,14,0
|
||||
16,1,1,0,1,0,23,81,12,0
|
||||
3,1,1,0,0,0,26,84,14,0
|
||||
16,1,1,0,1,0,24,82,14,0
|
||||
28,1,1,0,0,0,23,81,12,0
|
||||
1,1,1,0,1,0,19,81,12,0
|
||||
13,1,1,0,0,1,23,85,14,0
|
||||
36,1,1,0,0,0,21,83,10,0
|
||||
32,1,1,0,1,0,20,82,12,1
|
||||
16,1,1,0,1,1,21,80,12,0
|
||||
2,1,1,0,0,1,21,83,12,0
|
||||
8,1,1,0,0,1,24,83,14,1
|
||||
1,1,1,0,0,0,22,83,10,0
|
||||
24,1,2,0,0,0,18,79,11,0
|
||||
64,1,1,0,1,0,20,84,12,0
|
||||
8,1,1,0,0,0,23,84,10,1
|
||||
2,1,1,0,0,0,16,80,9,1
|
||||
12,1,1,0,0,0,22,80,13,0
|
||||
18,1,1,0,0,0,24,83,12,0
|
||||
32,1,1,0,0,0,24,85,14,0
|
||||
2,1,1,0,0,0,19,78,12,0
|
||||
7,1,1,0,0,0,26,85,16,0
|
||||
5,1,1,0,0,0,22,81,12,0
|
||||
44,1,1,0,0,0,22,82,16,0
|
||||
2,1,1,1,1,0,21,81,12,1
|
||||
4,1,1,0,1,0,18,81,10,1
|
||||
2,0,1,0,0,0,21,86,12,1
|
||||
6,1,1,0,0,0,25,85,16,0
|
||||
4,1,1,0,0,0,22,81,12,0
|
||||
36,1,1,0,0,0,24,83,12,0
|
||||
12,1,1,0,0,0,22,83,13,1
|
||||
24,1,1,0,0,0,20,85,12,0
|
||||
42,1,1,0,0,0,25,82,16,0
|
||||
16,1,1,0,1,0,21,79,13,0
|
||||
44,1,1,0,0,0,25,84,12,0
|
||||
44,1,1,0,0,0,26,84,16,0
|
||||
10,1,1,0,0,0,22,83,12,0
|
||||
4,1,1,1,0,0,20,81,11,0
|
||||
12,1,1,0,1,0,26,84,12,0
|
||||
28,1,1,0,0,0,22,82,12,0
|
||||
24,1,1,0,0,0,18,82,11,0
|
||||
6,1,1,0,1,0,19,78,11,0
|
||||
28,1,1,0,0,0,21,83,12,0
|
||||
12,1,1,1,1,0,21,81,12,0
|
||||
34,1,1,0,0,0,24,82,12,0
|
||||
2,1,1,0,0,0,21,84,13,0
|
||||
48,1,1,0,0,0,21,84,14,0
|
||||
16,1,1,0,0,0,20,80,12,0
|
||||
26,1,1,0,0,0,26,84,12,1
|
||||
6,1,1,0,1,0,24,84,14,0
|
||||
2,1,3,0,0,0,22,85,12,1
|
||||
24,1,1,0,0,0,24,85,12,0
|
||||
6,1,1,0,0,0,23,83,12,0
|
||||
16,1,1,0,1,0,28,85,16,0
|
||||
16,1,1,1,0,0,20,80,12,0
|
||||
8,1,1,0,1,0,21,84,12,0
|
||||
28,1,1,0,0,0,23,85,14,0
|
||||
7,1,1,0,0,0,24,83,15,0
|
||||
5,1,1,1,1,0,19,82,8,0
|
||||
18,1,1,0,1,0,22,80,12,0
|
||||
4,1,1,0,1,0,19,82,12,1
|
||||
18,1,1,0,0,0,19,83,12,0
|
||||
6,1,2,0,0,0,19,83,12,0
|
||||
1,1,1,1,1,0,20,84,8,1
|
||||
10,1,1,1,1,1,17,78,8,0
|
||||
1,1,1,0,1,0,23,81,13,0
|
||||
1,1,1,0,0,0,17,81,11,0
|
||||
12,1,3,0,0,0,22,81,12,0
|
||||
12,1,3,0,0,0,23,85,14,0
|
||||
40,1,1,0,0,0,25,83,12,0
|
||||
12,1,1,0,1,0,22,83,12,0
|
||||
14,1,1,0,1,0,17,79,11,0
|
||||
52,1,1,0,1,0,21,81,12,0
|
||||
5,1,1,0,1,0,16,78,10,0
|
||||
3,1,1,0,1,0,19,83,12,0
|
||||
28,1,1,0,0,0,19,80,10,0
|
||||
16,1,1,0,1,0,20,82,12,1
|
||||
8,1,1,0,0,0,25,86,16,0
|
||||
4,1,1,1,1,0,20,85,10,0
|
||||
13,1,1,0,0,0,25,84,12,0
|
||||
20,1,1,0,1,0,18,78,10,0
|
||||
12,1,1,0,0,0,21,79,12,0
|
||||
4,1,1,0,0,0,22,84,12,0
|
||||
52,1,1,0,1,0,20,80,12,1
|
||||
23,0,1,0,0,0,27,84,12,0
|
||||
16,1,3,1,0,0,17,79,9,1
|
||||
4,0,1,0,1,0,23,85,13,0
|
||||
6,1,1,0,0,1,26,85,12,0
|
||||
4,1,1,0,0,0,22,85,12,0
|
||||
1,1,1,0,0,0,25,84,13,0
|
||||
16,1,1,0,0,0,18,81,12,0
|
||||
18,1,2,0,1,0,20,81,14,0
|
||||
3,1,1,0,0,0,23,85,12,0
|
||||
16,1,1,0,0,0,24,85,14,1
|
||||
96,1,1,0,0,0,21,80,13,0
|
||||
24,1,3,0,0,0,19,83,9,0
|
||||
48,1,2,0,1,0,18,79,12,0
|
||||
4,1,1,0,0,0,19,83,11,0
|
||||
2,1,3,0,0,0,18,82,12,1
|
||||
16,1,1,0,1,1,19,79,11,0
|
||||
28,1,1,0,0,0,19,82,12,0
|
||||
1,1,1,0,0,0,23,85,12,0
|
||||
52,1,1,0,0,0,23,82,14,0
|
||||
32,1,2,1,0,0,20,82,14,0
|
||||
20,1,3,0,0,0,20,82,12,0
|
||||
12,1,3,0,0,0,20,85,12,0
|
||||
8,1,3,0,0,0,17,78,11,0
|
||||
36,1,1,0,0,0,24,81,16,0
|
||||
8,1,1,0,0,0,24,85,12,1
|
||||
24,1,1,0,0,0,20,83,11,1
|
||||
36,1,1,0,0,0,24,83,16,0
|
||||
16,1,1,0,0,0,24,84,12,0
|
||||
3,1,1,0,1,0,22,80,12,0
|
||||
32,1,1,0,0,0,22,80,15,0
|
||||
16,1,1,0,0,0,22,84,12,0
|
||||
48,1,1,0,0,0,23,85,16,0
|
||||
1,1,1,0,0,0,21,80,12,0
|
||||
36,1,1,0,1,0,25,84,12,1
|
||||
30,1,1,0,0,0,24,81,12,0
|
||||
2,1,1,0,0,0,19,78,12,0
|
||||
52,1,1,0,0,0,20,79,13,0
|
||||
36,1,1,1,0,1,21,83,13,0
|
||||
28,1,1,0,0,0,23,82,12,1
|
||||
48,1,1,0,0,0,21,80,16,0
|
||||
16,1,3,0,1,0,19,78,7,0
|
||||
4,1,1,0,0,0,25,83,12,0
|
||||
1,1,1,0,0,0,25,85,12,0
|
||||
6,1,1,0,0,0,20,82,12,1
|
||||
12,1,1,0,0,0,20,78,12,0
|
||||
24,1,1,0,1,0,19,80,11,0
|
||||
40,1,1,1,0,0,22,80,10,0
|
||||
8,1,1,1,0,0,26,85,19,0
|
||||
4,1,1,0,1,0,22,82,12,0
|
||||
20,1,2,0,0,0,23,84,12,0
|
||||
6,1,2,0,0,0,19,83,12,0
|
||||
12,1,1,0,0,0,21,82,12,0
|
||||
8,1,1,1,0,0,23,84,16,0
|
||||
3,0,1,0,0,0,28,85,16,0
|
||||
12,1,1,0,0,1,25,85,16,0
|
||||
16,1,1,0,0,0,19,80,12,0
|
||||
20,1,1,0,1,0,19,78,8,0
|
||||
12,1,2,0,1,0,18,79,12,0
|
||||
16,1,3,0,0,0,20,83,12,0
|
||||
17,1,1,0,1,0,25,83,11,0
|
||||
60,1,3,0,0,0,19,80,11,1
|
||||
12,1,3,1,0,0,19,81,10,1
|
||||
4,1,1,1,0,0,17,79,10,1
|
||||
16,1,1,0,0,0,21,81,14,0
|
||||
3,1,1,0,1,0,21,83,12,0
|
||||
3,1,1,0,1,0,25,85,12,0
|
||||
16,1,1,0,0,0,19,82,12,0
|
||||
24,1,1,1,0,1,19,78,12,0
|
||||
21,1,1,0,1,0,19,78,12,0
|
||||
32,1,1,0,0,0,20,81,12,0
|
||||
8,1,1,1,1,0,26,85,11,0
|
||||
6,1,1,0,0,0,23,84,12,0
|
||||
16,1,1,0,1,0,17,82,11,0
|
||||
12,1,1,0,1,0,24,81,12,0
|
||||
16,1,1,1,0,0,18,82,12,0
|
||||
16,1,1,1,1,0,28,85,12,0
|
||||
8,1,1,0,0,0,26,85,16,1
|
||||
20,1,1,0,1,0,21,85,12,0
|
||||
40,1,1,0,0,0,22,83,12,0
|
||||
12,1,1,0,0,0,22,83,12,0
|
||||
36,1,1,0,0,0,25,84,16,0
|
||||
18,1,1,0,0,0,20,82,13,0
|
||||
48,1,1,0,0,0,20,81,12,0
|
||||
7,1,1,1,1,0,18,81,10,1
|
||||
1,1,1,0,0,0,25,85,12,0
|
||||
24,1,1,0,0,0,21,85,12,0
|
||||
12,1,3,1,0,0,17,80,9,0
|
||||
36,1,3,1,0,0,17,82,8,0
|
||||
3,1,3,1,0,0,18,79,10,0
|
||||
1,1,3,0,0,0,23,81,6,0
|
||||
5,1,3,0,0,0,20,83,10,0
|
||||
24,1,3,1,0,0,19,83,11,1
|
||||
21,1,1,1,0,1,19,81,12,1
|
||||
1,1,1,0,1,0,17,78,11,0
|
||||
8,1,1,0,0,0,21,79,12,0
|
||||
24,1,2,0,0,0,24,84,16,0
|
||||
68,1,1,1,0,0,20,80,12,0
|
||||
20,1,1,0,0,0,19,80,14,0
|
||||
2,1,1,0,1,0,16,80,9,0
|
||||
12,1,1,0,0,0,25,84,12,0
|
||||
40,1,1,0,0,1,24,82,14,0
|
||||
4,1,1,0,0,0,26,84,12,0
|
||||
1,1,1,0,0,1,25,85,12,0
|
||||
32,1,1,0,1,0,25,84,11,1
|
||||
1,1,3,0,0,0,19,80,10,0
|
||||
6,1,1,0,0,0,24,81,16,0
|
||||
13,1,1,0,0,1,27,85,16,0
|
||||
2,1,1,1,1,0,22,85,12,0
|
||||
50,1,2,0,0,0,19,83,11,1
|
||||
32,1,1,0,1,0,21,78,12,0
|
||||
12,1,1,0,1,0,16,79,9,0
|
||||
2,1,2,0,0,0,22,79,12,0
|
||||
8,1,2,0,0,0,23,82,12,1
|
||||
20,1,2,0,0,0,21,83,15,0
|
||||
12,1,1,0,0,0,26,85,12,0
|
||||
8,1,1,0,0,0,21,85,12,0
|
||||
1,1,1,0,0,0,24,83,13,0
|
||||
16,1,1,0,1,0,21,83,11,0
|
||||
24,1,1,0,0,0,17,80,11,0
|
||||
4,1,1,0,0,0,24,85,13,0
|
||||
22,1,2,0,0,0,25,83,12,0
|
||||
5,1,2,0,0,0,20,82,12,0
|
||||
36,1,2,1,0,0,23,84,12,0
|
||||
12,1,1,0,0,0,23,80,12,0
|
||||
52,1,1,0,0,0,19,79,13,0
|
||||
9,1,1,0,0,0,25,85,16,0
|
||||
6,1,1,0,0,0,22,85,14,0
|
||||
26,1,1,0,0,0,21,81,13,0
|
||||
8,1,1,0,0,0,26,84,16,0
|
||||
18,0,1,1,0,0,23,84,14,0
|
||||
2,1,3,0,0,0,27,85,19,0
|
||||
20,1,1,0,0,0,23,82,16,0
|
||||
16,1,1,0,0,0,25,85,14,1
|
||||
2,0,1,0,0,0,22,86,12,0
|
||||
48,1,1,0,0,1,20,80,12,1
|
||||
4,1,1,0,1,0,23,83,11,0
|
||||
8,1,1,0,0,0,22,80,12,0
|
||||
40,1,1,0,1,0,19,81,12,1
|
||||
14,0,1,0,0,0,27,85,19,0
|
||||
80,1,1,0,0,0,25,83,16,0
|
||||
13,0,1,0,0,0,24,85,16,0
|
||||
20,1,1,0,1,0,26,84,16,1
|
||||
44,1,1,0,0,0,18,78,12,0
|
||||
12,1,1,0,0,0,20,84,13,0
|
||||
20,1,1,0,0,0,22,79,14,0
|
||||
32,1,1,0,0,0,24,84,12,1
|
||||
2,1,1,0,0,0,23,83,12,0
|
||||
28,1,2,0,0,0,22,85,14,1
|
||||
6,1,2,0,0,0,21,84,12,0
|
||||
6,1,1,0,1,0,26,83,12,0
|
||||
38,1,1,0,0,0,22,81,12,0
|
||||
16,1,1,0,1,0,21,80,14,0
|
||||
1,1,1,0,0,0,26,85,12,0
|
||||
7,1,1,0,0,0,26,84,12,0
|
||||
10,1,1,0,1,0,23,83,12,0
|
||||
3,1,1,0,0,0,23,82,16,0
|
||||
36,1,1,0,0,0,21,83,12,0
|
||||
12,1,1,0,0,0,20,85,12,0
|
||||
8,1,2,1,0,0,19,81,11,1
|
||||
14,1,1,0,0,0,22,81,12,0
|
||||
4,1,1,0,1,1,20,79,11,1
|
||||
1,1,1,0,1,0,22,83,12,0
|
||||
2,1,1,0,0,0,24,85,13,1
|
||||
1,1,1,0,1,1,21,83,12,0
|
||||
4,1,1,0,0,0,24,85,12,0
|
||||
24,1,1,1,0,0,22,79,14,0
|
||||
12,1,1,0,0,0,23,80,15,0
|
||||
12,1,1,0,1,0,21,79,12,0
|
||||
20,1,1,0,0,0,26,84,12,0
|
||||
7,1,1,0,0,0,21,84,12,0
|
||||
12,1,1,0,1,0,17,80,10,0
|
||||
8,1,1,0,1,0,16,78,9,0
|
||||
6,1,1,0,1,0,19,81,11,0
|
||||
16,1,1,0,0,1,23,84,15,0
|
||||
48,1,1,0,0,0,20,79,13,0
|
||||
2,1,1,0,0,0,22,85,12,0
|
||||
1,1,1,0,0,0,22,84,12,0
|
||||
16,1,1,1,1,0,18,80,11,1
|
||||
8,1,1,0,0,0,21,85,14,0
|
||||
24,1,1,0,0,0,23,83,15,0
|
||||
4,1,1,0,0,0,20,80,12,0
|
||||
2,1,2,0,0,0,23,83,12,0
|
||||
5,0,1,0,0,0,27,85,16,0
|
||||
24,1,2,1,0,0,20,79,12,0
|
||||
1,1,2,1,0,0,18,82,11,0
|
||||
12,1,1,0,0,0,21,78,13,0
|
||||
10,1,1,1,0,0,19,81,12,0
|
||||
48,1,1,0,0,0,21,81,11,0
|
||||
24,1,1,0,0,0,21,84,13,0
|
||||
56,1,1,0,0,0,25,83,13,0
|
||||
52,1,1,0,0,0,21,79,12,0
|
||||
6,1,1,0,1,0,19,79,10,0
|
||||
32,1,1,1,0,0,17,81,10,0
|
||||
8,1,1,0,1,0,22,84,12,1
|
||||
6,1,1,0,0,0,17,81,10,0
|
||||
24,1,1,1,1,0,18,81,11,0
|
||||
2,1,3,0,0,0,19,79,12,0
|
||||
20,1,3,0,0,0,23,84,12,0
|
||||
40,1,2,1,1,0,23,80,12,0
|
||||
4,1,2,0,0,0,20,82,12,1
|
||||
3,0,1,0,1,0,24,86,11,1
|
||||
24,1,1,0,1,0,19,78,9,1
|
||||
8,1,1,0,0,0,20,84,12,0
|
||||
24,1,1,0,0,0,21,82,12,0
|
||||
36,1,1,0,0,0,19,83,12,0
|
||||
1,1,1,0,1,0,21,80,12,1
|
||||
8,1,1,0,0,0,19,78,12,0
|
||||
8,1,1,0,1,0,23,81,12,0
|
||||
40,1,1,0,0,0,20,84,12,0
|
||||
5,1,1,0,0,0,16,79,9,1
|
||||
24,1,1,0,0,0,23,85,16,0
|
||||
2,1,3,0,0,0,21,83,12,0
|
||||
6,0,1,0,0,0,26,85,12,0
|
||||
24,1,1,0,0,0,22,80,14,0
|
||||
42,1,1,0,1,0,21,84,11,0
|
||||
12,1,1,0,0,0,16,79,10,0
|
||||
48,1,2,0,0,0,19,80,12,0
|
||||
12,1,1,0,0,1,20,83,10,0
|
||||
7,1,3,0,0,0,23,81,12,1
|
||||
10,1,1,0,1,0,24,84,12,0
|
||||
1,1,1,0,0,0,21,78,12,0
|
||||
2,1,1,0,0,0,23,85,12,1
|
||||
3,1,1,0,0,0,21,85,12,0
|
||||
6,1,1,0,1,0,19,80,11,0
|
||||
40,1,1,0,1,0,20,79,12,0
|
||||
38,1,1,0,0,0,22,80,12,0
|
||||
1,1,1,0,0,0,18,79,11,0
|
||||
2,1,1,0,1,0,19,81,10,1
|
||||
8,1,1,0,1,0,21,85,11,1
|
||||
20,1,1,0,0,0,17,79,10,0
|
||||
2,1,1,0,0,0,20,83,11,0
|
||||
2,1,1,0,0,0,20,84,11,0
|
||||
3,1,1,0,0,0,26,83,12,0
|
||||
13,0,1,1,0,0,27,85,13,1
|
||||
20,1,1,0,0,0,21,78,12,0
|
||||
3,1,3,0,1,0,18,82,11,0
|
||||
10,1,1,0,0,0,23,84,13,0
|
||||
2,1,1,0,1,0,22,85,12,1
|
||||
24,1,1,0,0,0,19,82,12,0
|
||||
2,1,1,1,0,0,23,83,12,1
|
||||
10,1,1,0,1,0,21,81,12,1
|
||||
28,1,1,0,1,0,16,78,9,1
|
||||
7,1,1,0,0,1,21,80,12,0
|
||||
2,1,1,0,0,0,26,83,13,0
|
||||
1,1,1,0,0,0,25,84,12,0
|
||||
40,1,1,0,0,0,21,84,12,0
|
||||
104,1,1,1,1,1,20,83,12,0
|
||||
1,1,1,0,1,0,18,78,11,1
|
||||
16,1,1,0,0,0,18,79,10,0
|
||||
7,0,1,0,0,0,22,85,12,1
|
||||
40,1,1,0,0,0,23,84,12,0
|
||||
8,1,1,1,0,0,20,79,12,0
|
||||
2,1,1,0,1,0,18,78,12,0
|
||||
3,1,1,0,0,0,19,79,12,0
|
||||
1,1,1,0,0,0,26,83,12,0
|
||||
14,1,1,0,1,0,21,79,11,0
|
||||
2,1,1,0,0,0,20,81,12,0
|
||||
15,1,1,0,0,0,24,83,12,1
|
||||
6,1,1,0,0,0,19,81,12,0
|
||||
8,1,1,0,1,0,22,85,12,0
|
||||
1,1,1,0,0,0,21,81,13,0
|
||||
7,1,1,0,0,0,25,84,16,0
|
||||
24,1,1,0,0,0,24,85,14,0
|
||||
3,1,1,0,1,0,21,82,12,0
|
||||
12,1,1,1,0,0,19,82,12,1
|
||||
2,1,1,0,0,0,19,79,11,0
|
||||
10,1,1,0,1,0,23,86,12,0
|
||||
26,1,1,0,1,0,21,85,13,0
|
||||
7,1,1,0,0,0,22,83,12,0
|
||||
1,1,1,1,1,0,20,81,8,0
|
||||
2,1,3,1,0,0,19,82,11,1
|
||||
32,1,3,0,0,1,23,85,15,0
|
||||
20,1,1,0,0,0,25,82,16,0
|
||||
6,1,1,0,0,1,21,80,13,0
|
||||
1,1,1,0,1,0,20,81,9,0
|
||||
4,1,1,0,0,0,25,84,14,0
|
||||
10,1,1,0,0,0,21,85,15,0
|
||||
6,1,1,0,0,0,18,79,9,0
|
||||
24,1,1,0,0,0,21,84,13,1
|
||||
24,1,1,0,0,0,20,82,13,0
|
||||
24,1,1,0,0,0,24,81,16,0
|
||||
6,1,1,0,0,0,19,81,12,0
|
||||
7,1,1,0,0,0,26,84,12,0
|
||||
2,1,1,0,0,0,22,82,12,0
|
||||
32,1,1,0,0,0,21,78,14,0
|
||||
1,1,1,1,0,0,20,83,12,1
|
||||
6,1,1,0,1,0,22,82,12,0
|
||||
2,1,1,0,1,0,21,79,12,0
|
||||
8,1,1,0,0,0,22,81,12,0
|
||||
24,1,1,0,0,0,20,83,12,1
|
||||
12,1,1,0,0,0,25,85,12,1
|
||||
18,0,1,0,1,0,21,84,12,0
|
||||
10,1,1,0,1,0,20,85,12,0
|
||||
12,1,1,0,1,0,22,85,10,0
|
||||
3,1,1,0,1,0,20,82,12,0
|
||||
40,1,1,0,0,0,26,83,12,0
|
||||
72,1,1,1,0,0,23,80,15,0
|
||||
8,1,1,0,1,0,21,79,12,0
|
||||
60,1,1,0,0,0,23,81,13,0
|
||||
48,1,1,1,1,0,19,83,8,1
|
||||
2,1,1,0,0,0,15,78,10,0
|
||||
20,1,1,0,0,0,21,84,12,0
|
||||
60,1,1,0,0,0,19,78,12,0
|
||||
2,1,1,0,0,0,22,83,12,0
|
||||
2,1,1,0,0,0,23,80,12,0
|
||||
44,1,1,1,1,0,25,82,10,1
|
||||
12,1,1,0,1,0,22,81,12,0
|
||||
1,1,1,0,0,0,27,85,12,0
|
||||
6,1,1,0,0,0,26,84,16,0
|
||||
24,1,1,0,0,0,22,80,15,0
|
||||
8,1,1,1,1,0,22,85,12,0
|
||||
10,1,1,0,0,0,22,85,12,1
|
||||
8,1,1,0,0,0,22,84,12,0
|
||||
44,1,1,0,0,0,23,84,14,0
|
||||
8,1,1,1,1,0,21,85,12,0
|
||||
32,1,1,0,1,0,21,79,13,0
|
||||
15,1,1,0,0,0,25,85,12,1
|
||||
5,1,1,0,1,0,24,84,12,0
|
||||
12,1,1,1,1,0,20,83,12,0
|
||||
8,1,1,0,0,0,23,85,16,0
|
||||
40,1,1,0,1,1,24,83,13,1
|
||||
24,1,1,0,0,0,20,82,13,0
|
||||
1,0,1,0,0,1,26,86,16,1
|
||||
6,1,1,1,0,0,21,85,14,0
|
||||
6,1,1,0,0,0,20,85,13,1
|
||||
8,1,1,0,0,0,18,79,12,0
|
||||
16,1,1,0,0,0,24,82,15,0
|
||||
2,1,1,0,0,0,16,79,9,0
|
||||
32,1,1,0,0,0,20,81,12,1
|
||||
1,1,1,0,1,0,24,85,12,0
|
||||
2,1,1,0,0,0,20,80,13,0
|
||||
1,1,2,1,0,0,22,85,13,0
|
||||
6,1,1,0,1,0,17,80,9,0
|
||||
1,1,1,0,0,0,19,79,12,0
|
||||
1,1,1,1,0,0,19,82,9,0
|
||||
8,1,1,0,1,0,23,84,12,0
|
||||
1,1,1,0,1,0,23,82,13,0
|
||||
28,1,3,0,0,0,23,81,16,0
|
||||
1,1,1,0,1,0,24,82,12,0
|
||||
8,1,1,0,0,0,24,84,16,0
|
||||
28,1,1,0,0,0,22,82,14,0
|
||||
12,1,2,0,0,0,16,80,9,0
|
||||
4,1,2,0,0,1,17,80,10,1
|
||||
6,1,2,0,0,0,17,82,11,0
|
||||
52,1,1,0,0,0,20,80,13,0
|
||||
7,0,1,0,1,0,27,85,14,0
|
||||
52,1,1,0,1,0,24,82,12,0
|
||||
28,1,1,0,1,0,17,81,10,1
|
||||
2,1,1,0,0,0,19,81,12,1
|
||||
4,1,1,0,0,0,19,82,11,0
|
||||
52,1,1,0,0,0,26,84,14,0
|
||||
3,1,1,0,0,0,21,81,12,0
|
||||
10,1,1,0,1,1,22,82,12,0
|
||||
4,1,1,1,1,1,21,81,12,1
|
||||
16,1,1,0,1,0,16,80,10,0
|
||||
20,1,3,0,0,0,18,78,11,0
|
||||
9,0,3,0,0,0,27,85,13,0
|
||||
12,1,3,0,0,0,18,79,10,0
|
||||
6,0,1,0,0,0,21,85,12,0
|
||||
2,1,3,0,0,0,22,84,12,0
|
||||
8,1,1,1,1,1,20,80,12,1
|
||||
48,1,3,0,0,0,22,82,13,0
|
||||
12,1,3,0,0,0,23,82,12,0
|
||||
1,1,3,0,0,0,24,82,12,0
|
||||
8,1,3,1,0,0,25,85,15,1
|
||||
8,1,3,0,0,0,26,83,14,0
|
||||
4,1,3,0,1,0,21,80,13,0
|
||||
48,1,3,1,0,0,19,82,12,0
|
||||
3,1,3,0,1,0,20,80,12,0
|
||||
32,1,3,0,1,0,18,79,11,1
|
||||
28,1,3,0,0,0,19,81,12,0
|
||||
24,1,3,0,0,0,20,84,8,0
|
||||
8,1,3,0,0,0,21,83,12,0
|
||||
40,1,2,0,0,0,20,81,12,0
|
||||
4,1,2,1,0,0,19,83,12,1
|
||||
48,1,2,0,0,0,20,84,12,0
|
||||
15,1,2,1,0,0,17,81,10,1
|
||||
48,1,2,0,0,0,17,80,10,0
|
||||
1,1,1,1,0,0,20,81,12,0
|
||||
6,1,2,1,0,0,18,82,11,0
|
||||
8,1,2,0,0,0,21,81,13,0
|
||||
24,1,2,0,0,0,21,78,12,0
|
||||
56,1,2,0,0,0,23,84,12,1
|
||||
6,0,2,0,0,0,26,85,14,0
|
||||
1,1,2,0,0,0,20,84,13,0
|
||||
24,1,2,0,1,0,19,78,12,0
|
||||
4,1,2,0,0,0,24,82,12,0
|
||||
1,1,2,0,0,0,24,82,14,0
|
||||
4,0,2,0,0,0,26,85,13,0
|
||||
16,1,2,1,0,0,19,81,12,1
|
||||
4,1,2,0,0,0,25,86,14,1
|
||||
24,1,2,0,0,0,20,84,13,0
|
||||
3,1,2,1,0,0,19,82,11,0
|
||||
2,1,2,0,0,0,22,84,15,0
|
||||
28,1,2,0,0,0,20,81,13,1
|
||||
10,1,1,0,0,0,25,83,16,0
|
||||
24,1,1,0,0,0,18,80,11,0
|
||||
16,1,1,0,1,1,22,81,16,0
|
||||
36,1,1,0,0,0,24,81,17,0
|
||||
5,1,1,0,0,0,27,84,16,0
|
||||
6,1,1,0,0,0,26,84,17,0
|
||||
48,1,1,0,0,0,25,83,15,0
|
||||
48,1,1,0,1,0,21,83,12,0
|
||||
12,1,1,0,1,0,19,79,12,0
|
||||
4,1,3,1,0,0,18,79,11,1
|
||||
18,1,2,0,0,0,20,80,13,0
|
||||
1,1,2,1,1,1,18,83,12,0
|
||||
50,1,3,1,0,0,19,82,12,1
|
||||
20,1,1,0,0,0,23,83,8,0
|
||||
12,1,1,0,0,0,19,83,11,1
|
||||
12,1,2,1,0,0,23,81,12,0
|
||||
96,1,3,1,0,0,19,79,8,0
|
||||
12,1,3,0,0,0,23,82,13,0
|
||||
12,1,3,0,0,0,24,82,16,0
|
||||
2,1,1,1,1,1,22,83,10,0
|
||||
1,1,1,0,1,0,23,81,12,0
|
||||
1,1,2,0,1,0,21,85,12,0
|
||||
28,1,2,0,0,0,20,79,12,1
|
||||
4,1,1,0,1,1,23,83,12,0
|
||||
22,1,1,1,1,0,20,81,13,0
|
||||
2,1,1,0,0,0,17,78,10,0
|
||||
4,1,1,0,0,0,18,80,11,0
|
||||
1,1,1,1,1,0,21,84,12,1
|
||||
6,0,2,0,0,0,28,85,18,0
|
||||
1,1,2,0,0,0,21,81,14,1
|
||||
8,1,2,0,1,0,20,83,12,1
|
||||
48,1,2,1,0,0,21,81,11,0
|
||||
24,1,2,1,0,0,26,84,15,0
|
||||
8,1,2,0,0,0,22,83,12,0
|
||||
4,1,2,1,1,0,17,78,10,0
|
||||
20,1,2,1,1,1,18,80,11,0
|
||||
4,1,1,1,0,0,20,80,10,0
|
||||
11,1,1,0,0,0,26,85,16,0
|
||||
15,1,1,1,1,0,19,78,10,1
|
||||
16,1,1,0,0,0,23,82,14,0
|
||||
1,1,1,0,0,0,20,79,7,1
|
||||
24,1,2,0,0,0,25,82,12,1
|
||||
15,1,2,0,0,0,20,83,13,0
|
||||
6,1,2,0,0,0,22,81,13,0
|
||||
1,1,1,0,1,0,19,82,12,0
|
||||
32,1,1,0,1,0,24,83,12,0
|
||||
2,1,3,0,0,0,26,85,15,0
|
||||
3,1,2,0,0,0,19,81,12,0
|
||||
16,1,1,0,0,0,20,83,12,0
|
||||
6,1,2,0,0,0,19,81,12,0
|
||||
3,1,1,0,0,0,21,79,13,0
|
||||
42,1,1,0,0,0,23,80,15,0
|
||||
3,1,1,0,1,0,20,83,12,0
|
||||
32,1,1,0,0,0,25,84,16,1
|
||||
8,1,1,1,1,0,15,79,7,1
|
||||
4,1,2,0,0,0,23,84,13,1
|
||||
3,1,2,1,1,0,18,83,10,0
|
||||
7,0,1,0,0,0,26,85,16,0
|
||||
4,1,1,0,1,0,25,83,17,0
|
||||
6,1,1,0,1,0,26,85,16,0
|
||||
20,1,1,0,0,0,27,85,17,0
|
||||
18,1,3,0,1,0,21,82,12,0
|
||||
3,1,1,0,1,0,25,83,14,0
|
||||
16,1,2,0,0,0,24,83,16,0
|
||||
26,1,1,0,0,0,25,84,16,0
|
||||
1,0,1,0,0,0,28,86,16,0
|
||||
20,1,1,0,0,0,27,85,18,0
|
||||
12,1,1,0,1,0,15,79,8,1
|
||||
16,1,3,1,0,0,23,83,6,0
|
||||
32,1,1,0,0,0,22,81,12,0
|
||||
60,1,1,0,0,0,21,79,12,0
|
||||
24,1,1,0,0,0,24,84,16,0
|
||||
7,1,1,1,1,0,17,80,9,1
|
||||
1,1,2,0,0,0,23,86,13,1
|
||||
16,1,1,1,0,0,17,78,10,0
|
||||
48,1,1,0,0,0,20,79,12,1
|
||||
12,1,1,0,0,0,20,79,13,0
|
||||
4,1,3,1,0,0,25,85,13,1
|
||||
8,1,3,1,0,0,18,82,10,0
|
||||
4,1,3,1,0,0,18,82,11,1
|
||||
4,1,3,0,0,0,18,80,12,0
|
||||
18,1,3,0,1,1,20,83,10,0
|
||||
48,1,3,0,0,0,24,82,12,0
|
||||
24,1,2,1,0,0,21,79,14,0
|
||||
8,1,3,0,0,0,22,82,12,0
|
||||
52,1,3,0,0,0,19,82,12,0
|
||||
1,1,1,0,1,0,19,83,10,0
|
||||
12,1,2,0,0,1,23,81,16,0
|
||||
4,1,3,0,0,0,20,79,14,1
|
||||
12,1,3,0,0,0,19,81,12,0
|
||||
8,1,3,0,0,0,17,81,10,1
|
||||
2,1,1,0,0,0,21,83,14,0
|
||||
96,1,1,1,1,0,18,78,10,1
|
||||
8,1,3,0,0,0,19,84,12,0
|
||||
8,1,2,0,0,1,22,83,13,0
|
||||
40,1,1,1,0,0,22,79,12,0
|
||||
10,1,3,0,0,0,21,82,12,0
|
||||
12,1,3,0,0,0,19,78,12,0
|
||||
12,1,3,0,0,0,22,83,14,0
|
||||
9,1,3,1,0,0,27,84,18,1
|
||||
6,1,2,0,0,0,22,82,13,0
|
||||
16,1,1,0,1,0,28,85,12,0
|
||||
1,1,3,0,0,0,25,83,11,0
|
||||
6,1,3,1,0,0,21,84,12,0
|
||||
4,1,3,0,0,0,18,81,10,1
|
||||
2,1,3,0,0,0,19,79,11,0
|
||||
4,1,3,0,0,0,20,80,11,0
|
||||
8,1,1,0,1,0,27,85,11,1
|
||||
6,1,1,0,0,0,25,82,16,0
|
||||
40,1,1,0,0,0,23,81,11,0
|
||||
24,1,3,0,0,0,22,81,16,0
|
||||
1,1,3,0,0,0,24,82,13,0
|
||||
5,1,3,0,0,0,20,79,12,0
|
||||
2,1,3,0,0,0,22,79,13,0
|
||||
8,1,3,0,1,0,24,81,12,0
|
||||
4,1,3,0,0,0,21,85,13,0
|
||||
12,1,3,0,0,0,22,79,3,0
|
||||
12,1,3,1,0,0,18,79,6,0
|
||||
3,1,3,1,1,0,16,78,7,0
|
||||
48,1,1,0,0,0,23,82,14,0
|
||||
8,1,3,1,0,0,16,79,8,0
|
||||
14,1,1,0,1,0,23,83,11,1
|
||||
9,1,3,1,0,0,21,85,12,0
|
||||
4,1,1,0,1,0,24,83,12,0
|
||||
14,1,3,0,0,0,26,85,14,0
|
||||
3,1,3,0,0,0,19,83,10,1
|
||||
3,1,3,0,0,0,20,78,11,0
|
||||
6,1,3,0,0,0,23,85,12,0
|
||||
12,1,1,0,0,1,22,83,12,0
|
||||
8,0,1,0,1,0,25,85,12,0
|
||||
3,1,3,0,0,0,24,81,12,1
|
||||
3,1,3,0,0,0,19,83,12,0
|
||||
10,1,3,0,0,0,22,80,12,0
|
||||
3,1,3,1,1,0,19,81,11,1
|
||||
44,1,3,0,0,0,25,83,16,0
|
||||
2,1,1,0,0,0,22,84,13,0
|
||||
1,1,1,1,0,0,16,80,8,0
|
||||
1,1,2,1,0,0,23,83,12,0
|
||||
12,1,2,0,0,0,23,82,14,0
|
||||
4,1,2,1,0,0,19,82,12,0
|
||||
16,1,2,0,1,0,18,79,11,0
|
||||
5,0,1,0,0,0,22,85,12,0
|
||||
24,1,1,0,0,0,20,81,9,0
|
||||
6,0,1,0,0,0,28,85,14,0
|
||||
52,1,1,1,0,0,20,78,12,0
|
||||
2,1,3,1,0,0,15,80,8,1
|
||||
2,1,1,0,1,1,25,84,13,0
|
||||
10,1,1,0,0,0,24,84,12,0
|
||||
48,1,1,0,0,0,23,81,12,1
|
||||
52,1,1,0,0,0,20,81,12,0
|
||||
2,1,1,0,0,0,25,85,14,1
|
||||
24,1,1,0,1,0,19,80,9,1
|
||||
12,1,1,1,1,0,21,82,10,0
|
||||
8,1,2,0,0,0,16,78,11,0
|
||||
4,1,1,1,0,1,24,84,12,0
|
||||
4,1,1,0,0,0,19,78,12,1
|
||||
4,1,1,1,0,0,16,78,9,0
|
||||
8,1,1,0,0,0,20,80,12,0
|
||||
48,1,2,0,0,1,24,81,14,1
|
||||
24,1,1,0,0,1,27,84,18,1
|
||||
3,1,1,0,1,0,26,84,16,1
|
||||
20,1,1,0,1,0,25,84,15,0
|
||||
52,1,1,0,1,0,25,82,16,0
|
||||
60,1,1,0,1,0,24,84,14,0
|
||||
2,1,1,0,0,0,21,79,13,0
|
||||
2,1,3,0,0,0,22,84,14,0
|
||||
5,1,3,1,0,0,20,81,12,0
|
||||
12,1,3,1,0,0,17,80,8,0
|
||||
24,1,3,0,0,0,27,84,10,0
|
||||
12,1,3,0,0,0,19,81,12,0
|
||||
4,1,3,0,0,0,23,85,13,0
|
||||
2,1,3,0,0,0,16,79,10,0
|
||||
6,1,3,0,0,0,24,85,13,0
|
||||
1,1,1,0,0,0,22,81,15,0
|
||||
4,1,3,0,0,0,17,80,10,0
|
||||
2,1,1,0,1,1,19,82,8,0
|
||||
48,1,2,0,0,0,21,83,12,1
|
||||
8,1,2,1,0,0,20,79,9,1
|
||||
24,1,1,0,0,0,20,81,12,0
|
||||
12,1,2,0,0,0,26,85,14,0
|
||||
2,1,1,1,1,0,22,82,12,1
|
||||
3,1,1,0,1,0,21,84,9,0
|
||||
96,1,1,1,0,0,19,80,8,0
|
||||
3,1,1,1,0,0,19,83,10,0
|
||||
16,1,2,0,1,0,23,82,16,0
|
||||
6,1,1,0,1,1,21,84,12,0
|
||||
4,1,1,1,0,0,19,79,10,0
|
||||
56,1,2,1,0,0,17,80,11,0
|
||||
4,1,2,0,0,0,20,84,12,0
|
||||
6,1,1,1,0,0,19,81,10,1
|
||||
2,1,2,1,0,0,21,81,14,0
|
||||
8,1,1,0,0,0,21,84,14,0
|
||||
14,1,2,0,0,0,22,82,13,0
|
||||
8,1,3,0,0,0,19,83,10,0
|
||||
1,1,3,0,0,0,24,85,9,0
|
||||
2,1,3,0,0,0,19,83,11,1
|
||||
16,0,1,0,0,1,27,84,16,1
|
||||
8,1,1,0,0,0,26,84,16,0
|
||||
48,1,1,1,1,1,18,80,8,0
|
||||
52,1,1,1,1,0,17,81,7,0
|
||||
25,1,1,1,1,0,21,82,11,0
|
||||
20,1,1,1,1,0,22,83,12,0
|
||||
12,1,1,1,1,0,19,81,11,1
|
||||
8,1,3,0,0,0,23,83,14,0
|
||||
5,1,3,1,1,1,20,81,10,1
|
||||
4,1,1,0,1,1,25,84,16,0
|
||||
16,1,1,0,0,0,25,84,16,0
|
||||
1,1,1,0,0,0,22,81,15,0
|
||||
5,1,1,0,1,0,26,85,16,0
|
||||
3,1,1,1,1,0,19,83,11,0
|
||||
46,1,1,1,1,0,20,78,12,0
|
||||
8,1,3,1,0,0,18,78,12,0
|
||||
40,1,1,0,0,0,18,80,10,0
|
||||
1,1,3,1,1,1,22,82,12,0
|
||||
4,1,2,0,0,1,24,86,13,0
|
||||
3,1,1,0,1,0,22,81,12,0
|
||||
2,1,3,0,0,1,25,84,12,0
|
||||
2,1,1,0,0,0,27,85,15,0
|
||||
3,1,1,0,0,0,22,80,16,0
|
||||
46,1,1,0,0,0,25,83,14,0
|
||||
2,1,3,0,0,0,19,81,12,1
|
||||
36,1,1,0,0,0,21,82,12,0
|
||||
6,0,3,0,0,0,22,85,12,0
|
||||
8,1,1,0,0,0,18,81,11,0
|
||||
16,1,1,0,0,0,19,79,12,0
|
||||
16,1,1,1,1,0,19,78,9,0
|
||||
12,1,3,1,0,0,23,80,9,1
|
||||
6,1,2,1,0,0,20,83,13,0
|
||||
5,0,3,0,0,0,21,85,14,0
|
||||
16,1,3,1,1,0,19,84,11,0
|
||||
12,1,3,0,0,0,19,81,12,0
|
||||
1,1,3,0,0,0,26,85,11,0
|
||||
4,1,1,1,1,0,21,78,12,0
|
||||
24,1,1,1,0,0,19,78,11,0
|
||||
1,1,1,0,0,0,22,80,12,0
|
||||
10,1,3,0,1,1,22,81,13,0
|
||||
10,1,1,0,0,0,25,85,13,0
|
||||
2,1,3,1,0,0,20,84,12,1
|
||||
2,1,3,0,1,1,24,84,12,0
|
||||
64,1,3,1,0,0,21,80,11,0
|
||||
8,1,2,1,0,0,21,84,12,0
|
||||
48,1,2,1,1,0,21,81,12,0
|
||||
28,1,3,0,0,0,21,80,11,1
|
||||
24,1,3,0,0,0,18,79,10,0
|
||||
18,1,2,1,0,0,23,82,11,0
|
||||
6,1,3,0,0,0,21,85,12,0
|
||||
3,1,2,1,1,0,19,82,11,1
|
||||
56,1,3,0,0,0,26,84,15,1
|
||||
18,1,1,0,0,0,24,83,13,0
|
||||
2,1,3,0,0,0,21,81,9,0
|
||||
6,1,3,0,0,0,20,79,6,1
|
||||
12,1,3,0,0,0,24,82,14,0
|
||||
32,1,1,0,1,0,19,82,9,0
|
||||
3,1,3,0,0,0,21,83,12,1
|
||||
72,1,1,0,0,0,19,83,11,0
|
||||
5,1,1,1,1,0,19,84,7,0
|
||||
12,1,2,0,0,0,20,80,13,1
|
||||
8,1,3,0,0,0,23,82,12,0
|
||||
8,1,1,0,1,0,23,81,13,0
|
||||
16,1,1,0,1,0,21,78,14,0
|
||||
2,0,1,0,0,0,26,85,13,0
|
||||
3,0,1,0,0,0,27,85,16,0
|
||||
12,1,2,1,0,0,17,79,10,0
|
||||
40,1,2,1,0,0,18,81,12,0
|
||||
96,1,1,0,0,0,25,83,14,0
|
||||
4,1,1,0,1,1,22,81,12,0
|
||||
3,1,1,0,1,0,20,84,12,1
|
||||
12,1,1,0,0,0,25,83,16,0
|
||||
28,1,1,0,1,0,25,83,16,0
|
||||
7,1,1,1,1,1,22,84,11,0
|
||||
1,1,2,1,0,0,22,85,15,0
|
||||
1,1,1,0,1,0,23,83,14,0
|
||||
4,1,3,0,0,0,26,83,9,0
|
||||
3,1,3,0,0,0,25,84,14,1
|
||||
12,1,3,1,0,0,24,84,12,0
|
||||
1,1,2,0,0,0,19,83,12,0
|
||||
14,1,1,0,0,1,26,84,15,0
|
||||
12,1,1,0,0,0,20,79,12,0
|
||||
8,1,2,1,0,0,19,81,12,0
|
||||
12,1,3,0,0,0,25,82,12,0
|
||||
1,1,3,0,0,0,22,85,11,0
|
||||
8,1,1,1,0,0,17,81,10,0
|
||||
8,1,1,1,1,0,24,85,9,1
|
||||
8,1,1,1,1,0,15,80,9,0
|
||||
7,1,3,0,1,0,23,84,13,0
|
||||
12,1,3,0,0,0,21,82,12,0
|
||||
6,1,3,0,0,0,24,84,12,0
|
||||
2,1,2,0,0,0,23,85,14,0
|
||||
16,1,3,1,0,0,20,81,11,1
|
||||
24,1,1,0,0,0,18,80,9,1
|
||||
24,1,3,0,0,0,20,79,10,0
|
||||
12,1,3,0,1,1,24,83,9,0
|
||||
72,1,1,1,0,0,16,81,9,1
|
||||
6,1,1,0,1,0,23,83,12,0
|
||||
1,1,2,0,0,0,25,82,13,0
|
||||
48,1,1,0,0,0,20,80,12,0
|
||||
3,1,1,0,1,0,22,83,12,0
|
||||
24,1,1,0,0,0,23,81,12,0
|
||||
12,1,1,0,0,0,23,82,12,0
|
||||
26,1,1,0,0,0,22,80,12,0
|
||||
3,1,1,0,1,0,23,83,12,0
|
||||
24,1,1,0,0,0,20,80,12,0
|
||||
1,1,1,0,0,1,20,78,12,0
|
||||
5,1,1,0,1,0,24,83,12,0
|
||||
2,1,1,0,1,0,21,79,12,0
|
||||
12,1,1,0,0,0,19,80,12,0
|
||||
48,1,1,0,0,0,23,81,12,0
|
||||
3,1,2,0,1,1,23,81,13,0
|
||||
4,1,1,0,1,0,22,81,12,0
|
||||
6,1,1,0,1,0,22,81,12,0
|
||||
4,1,1,0,1,1,24,82,13,0
|
||||
52,1,1,1,0,0,22,81,12,0
|
||||
8,1,2,1,0,0,23,81,12,0
|
||||
20,1,1,1,0,0,21,81,12,0
|
||||
20,1,1,0,0,0,23,82,12,0
|
||||
28,1,1,0,0,0,22,83,12,0
|
||||
4,1,1,0,0,0,24,82,12,1
|
||||
16,1,1,1,0,0,19,78,12,0
|
||||
8,1,2,0,0,0,19,79,12,0
|
||||
5,1,1,0,0,0,21,80,12,0
|
||||
11,1,1,0,1,0,24,83,12,0
|
||||
4,1,2,0,0,0,24,83,12,0
|
||||
3,1,1,0,0,0,22,81,12,0
|
||||
2,1,1,0,0,0,23,81,12,0
|
||||
2,1,1,0,0,0,21,80,12,0
|
||||
6,1,1,0,0,0,21,80,13,0
|
||||
8,1,1,1,1,0,21,79,12,0
|
||||
1,1,1,0,1,1,18,79,12,1
|
||||
48,1,1,0,1,0,19,79,12,0
|
||||
32,1,1,0,0,0,20,79,13,0
|
||||
32,1,1,0,0,1,20,79,12,0
|
||||
6,1,1,0,1,0,22,81,12,0
|
||||
6,1,1,0,0,0,25,82,12,0
|
||||
24,1,1,0,0,1,20,79,12,0
|
||||
4,1,3,0,0,0,20,79,14,0
|
||||
16,1,1,0,0,0,22,82,12,0
|
||||
12,1,1,0,0,0,21,80,12,0
|
||||
2,1,1,0,1,0,24,83,12,0
|
||||
1,1,1,0,0,0,21,81,12,0
|
||||
3,1,1,0,1,0,22,82,12,0
|
||||
7,1,1,1,1,1,25,83,12,0
|
||||
56,1,1,0,0,0,24,81,12,0
|
||||
1,1,1,0,0,0,22,80,12,0
|
||||
24,1,1,0,0,0,21,81,12,0
|
||||
16,1,1,0,1,0,19,78,12,0
|
||||
20,1,1,0,1,0,22,82,12,0
|
||||
1,1,1,0,0,0,22,81,13,0
|
||||
120,1,3,0,0,0,22,80,12,0
|
||||
44,1,1,0,0,0,22,81,14,0
|
||||
3,1,1,0,0,0,25,83,12,0
|
||||
32,1,1,0,0,0,20,80,12,0
|
||||
6,1,1,0,0,0,22,82,12,0
|
||||
52,1,1,0,0,0,22,79,12,0
|
||||
24,1,2,0,0,1,23,81,12,0
|
||||
72,1,1,0,0,0,21,81,12,0
|
||||
24,1,2,0,0,0,21,81,12,0
|
||||
3,1,1,0,1,0,22,82,10,0
|
||||
6,1,1,0,1,0,21,79,12,0
|
||||
24,1,1,0,1,0,24,82,12,0
|
||||
16,1,2,0,0,0,23,83,12,0
|
||||
5,1,1,0,1,0,25,83,12,0
|
||||
48,1,1,0,0,0,20,79,12,0
|
||||
10,1,1,0,1,0,23,82,12,0
|
||||
48,1,1,0,0,0,23,82,13,0
|
||||
2,1,1,1,1,0,24,82,12,0
|
||||
6,1,1,0,0,0,24,82,14,0
|
||||
36,1,2,0,0,0,22,82,14,0
|
||||
12,1,1,0,0,0,22,83,12,0
|
||||
2,1,1,0,1,0,21,85,12,0
|
||||
4,1,1,0,1,0,18,80,12,1
|
||||
24,1,1,0,0,0,23,82,13,0
|
||||
1,1,1,0,0,0,23,83,11,0
|
||||
20,1,1,0,0,0,21,81,13,0
|
||||
76,1,1,0,0,0,21,83,14,0
|
||||
8,1,1,0,0,0,20,79,12,0
|
||||
4,1,3,0,0,0,24,81,11,0
|
||||
36,1,1,0,1,0,20,80,12,0
|
||||
6,1,1,0,0,0,21,82,12,0
|
||||
32,1,1,0,0,0,19,83,14,0
|
||||
4,1,1,0,0,0,20,81,12,0
|
||||
4,1,1,0,1,0,21,79,12,0
|
||||
40,1,1,1,1,0,22,85,12,0
|
||||
3,1,3,0,0,0,20,81,9,0
|
||||
8,1,1,1,0,1,23,83,10,1
|
||||
32,1,1,0,0,0,18,80,11,0
|
||||
10,0,1,0,0,0,28,85,15,1
|
||||
1,1,1,0,0,0,20,84,12,1
|
||||
1,1,1,0,1,0,20,80,12,0
|
||||
5,1,1,1,1,1,21,78,15,0
|
||||
24,1,1,0,1,0,18,81,10,0
|
||||
48,1,1,0,0,0,23,83,12,0
|
||||
12,1,1,0,1,0,24,83,12,0
|
||||
20,1,1,0,0,0,27,85,17,0
|
||||
4,1,1,0,1,0,21,84,12,0
|
||||
16,1,1,1,1,0,21,82,12,0
|
||||
32,1,3,1,0,0,18,82,10,1
|
||||
24,1,1,0,0,0,26,85,14,1
|
||||
13,1,1,0,0,0,21,82,12,0
|
||||
1,1,1,1,0,0,16,81,9,1
|
||||
16,1,1,0,1,0,20,81,12,0
|
||||
44,1,1,0,0,0,21,80,12,0
|
||||
32,1,1,0,1,1,22,83,12,0
|
||||
1,1,1,0,1,1,20,83,12,0
|
||||
8,1,1,0,1,0,22,79,12,0
|
||||
6,1,1,0,0,0,22,82,13,1
|
||||
6,1,1,1,1,0,21,81,12,0
|
||||
32,1,1,0,0,1,25,84,18,0
|
||||
28,1,1,0,1,1,19,80,12,0
|
||||
7,1,1,0,0,1,24,83,14,0
|
||||
12,1,1,1,1,1,20,80,10,1
|
||||
4,1,1,1,0,0,18,81,11,0
|
||||
32,1,1,0,0,0,23,81,16,0
|
||||
48,1,1,1,0,0,20,84,11,1
|
||||
32,1,1,1,0,0,17,78,12,1
|
||||
3,1,2,0,1,0,19,79,11,1
|
||||
4,1,2,0,0,0,21,78,12,0
|
||||
4,1,1,0,1,0,23,82,12,0
|
||||
2,1,1,0,0,0,24,82,13,0
|
||||
3,1,1,0,0,1,21,80,12,0
|
||||
1,1,1,0,1,1,20,81,12,0
|
||||
32,1,1,0,1,0,24,81,12,0
|
||||
24,1,1,0,0,0,20,80,12,0
|
||||
4,1,1,0,0,0,20,79,12,0
|
||||
5,1,1,0,0,1,22,81,12,0
|
||||
24,1,2,0,0,0,21,80,12,0
|
||||
6,1,1,0,1,0,20,80,12,0
|
|
|
@ -0,0 +1,137 @@
|
|||
<?xml version="1.0"?>
|
||||
<PMML version="4.3" xmlns="http://www.dmg.org/PMML-4_3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.dmg.org/PMML-4_3 http://www.dmg.org/pmml/v4-3/pmml-4-3.xsd">
|
||||
<Header copyright="Copyright (c) 2017 Syncfusion" description="CoxPH Survival Regression Model">
|
||||
<Extension name="user" value="Syncfusion" extender="Rattle/PMML"/>
|
||||
<Application name="Rattle/PMML" version="1.4"/>
|
||||
<Timestamp>2017-11-15 15:25:37</Timestamp>
|
||||
</Header>
|
||||
<DataDictionary numberOfFields="11">
|
||||
<DataField name="survival" optype="continuous" dataType="double"/>
|
||||
<DataField name="Race" optype="continuous" dataType="double"/>
|
||||
<DataField name="Is_Poor" optype="continuous" dataType="double"/>
|
||||
<DataField name="Smoker" optype="continuous" dataType="double"/>
|
||||
<DataField name="Alcoholic" optype="continuous" dataType="double"/>
|
||||
<DataField name="Age" optype="continuous" dataType="double"/>
|
||||
<DataField name="Year" optype="continuous" dataType="double"/>
|
||||
<DataField name="Education_Level" optype="continuous" dataType="double"/>
|
||||
<DataField name="Prenatal_Care" optype="continuous" dataType="double"/>
|
||||
<DataField name="Duration" optype="continuous" dataType="double"/>
|
||||
<DataField name="Bfeed_Indicator" optype="continuous" dataType="double"/>
|
||||
</DataDictionary>
|
||||
<GeneralRegressionModel modelType="CoxRegression" modelName="CoxPH_Survival_Regression_Model" functionName="regression" algorithmName="coxph" endTimeVariable="Duration" statusVariable="Bfeed_Indicator">
|
||||
<MiningSchema>
|
||||
<MiningField name="survival" usageType="predicted"/>
|
||||
<MiningField name="Race" usageType="active"/>
|
||||
<MiningField name="Is_Poor" usageType="active"/>
|
||||
<MiningField name="Smoker" usageType="active"/>
|
||||
<MiningField name="Alcoholic" usageType="active"/>
|
||||
<MiningField name="Age" usageType="active"/>
|
||||
<MiningField name="Year" usageType="active"/>
|
||||
<MiningField name="Education_Level" usageType="active"/>
|
||||
<MiningField name="Prenatal_Care" usageType="active"/>
|
||||
<MiningField name="Duration" usageType="active"/>
|
||||
<MiningField name="Bfeed_Indicator" usageType="active"/>
|
||||
</MiningSchema>
|
||||
<Output>
|
||||
<OutputField name="Predicted_hazard" feature="predictedValue"/>
|
||||
<OutputField name="SurvivalProbability" feature="transformedValue">
|
||||
<Apply function="exp">
|
||||
<Apply function="*">
|
||||
<Constant>-1.0</Constant>
|
||||
<FieldRef field="Predicted_hazard"/>
|
||||
</Apply>
|
||||
</Apply>
|
||||
</OutputField>
|
||||
</Output>
|
||||
<ParameterList>
|
||||
<Parameter name="p0" label="Race" referencePoint="1.45883940620783"/>
|
||||
<Parameter name="p1" label="Is_Poor" referencePoint="0.184885290148448"/>
|
||||
<Parameter name="p2" label="Smoker" referencePoint="0.279352226720648"/>
|
||||
<Parameter name="p3" label="Alcoholic" referencePoint="0.0755735492577598"/>
|
||||
<Parameter name="p4" label="Age" referencePoint="21.5155195681511"/>
|
||||
<Parameter name="p5" label="Year" referencePoint="82.0904183535763"/>
|
||||
<Parameter name="p6" label="Education_Level" referencePoint="12.2402159244265"/>
|
||||
<Parameter name="p7" label="Prenatal_Care" referencePoint="0.186234817813765"/>
|
||||
</ParameterList>
|
||||
<FactorList/>
|
||||
<CovariateList>
|
||||
<Predictor name="Race"/>
|
||||
<Predictor name="Is_Poor"/>
|
||||
<Predictor name="Smoker"/>
|
||||
<Predictor name="Alcoholic"/>
|
||||
<Predictor name="Age"/>
|
||||
<Predictor name="Year"/>
|
||||
<Predictor name="Education_Level"/>
|
||||
<Predictor name="Prenatal_Care"/>
|
||||
</CovariateList>
|
||||
<PPMatrix>
|
||||
<PPCell value="1" predictorName="Race" parameterName="p0"/>
|
||||
<PPCell value="1" predictorName="Is_Poor" parameterName="p1"/>
|
||||
<PPCell value="1" predictorName="Smoker" parameterName="p2"/>
|
||||
<PPCell value="1" predictorName="Alcoholic" parameterName="p3"/>
|
||||
<PPCell value="1" predictorName="Age" parameterName="p4"/>
|
||||
<PPCell value="1" predictorName="Year" parameterName="p5"/>
|
||||
<PPCell value="1" predictorName="Education_Level" parameterName="p6"/>
|
||||
<PPCell value="1" predictorName="Prenatal_Care" parameterName="p7"/>
|
||||
</PPMatrix>
|
||||
<ParamMatrix>
|
||||
<PCell parameterName="p0" df="1" beta="0.152578050826247"/>
|
||||
<PCell parameterName="p1" df="1" beta="-0.215797330193555"/>
|
||||
<PCell parameterName="p2" df="1" beta="0.156861641237673"/>
|
||||
<PCell parameterName="p3" df="1" beta="0.0870307437675765"/>
|
||||
<PCell parameterName="p4" df="1" beta="-0.0247291463080276"/>
|
||||
<PCell parameterName="p5" df="1" beta="0.0877445384559638"/>
|
||||
<PCell parameterName="p6" df="1" beta="-0.0519582456183678"/>
|
||||
<PCell parameterName="p7" df="1" beta="-0.0384105466220913"/>
|
||||
</ParamMatrix>
|
||||
<BaseCumHazardTables maxTime="192">
|
||||
<BaselineCell time="1" cumHazard="0.0838886537615686"/>
|
||||
<BaselineCell time="2" cumHazard="0.177917037880248"/>
|
||||
<BaselineCell time="3" cumHazard="0.235812717515143"/>
|
||||
<BaselineCell time="4" cumHazard="0.33331898146686"/>
|
||||
<BaselineCell time="5" cumHazard="0.358553822689809"/>
|
||||
<BaselineCell time="6" cumHazard="0.443442782013665"/>
|
||||
<BaselineCell time="7" cumHazard="0.467898670715241"/>
|
||||
<BaselineCell time="8" cumHazard="0.611885378757318"/>
|
||||
<BaselineCell time="9" cumHazard="0.619875964348722"/>
|
||||
<BaselineCell time="10" cumHazard="0.669523909398948"/>
|
||||
<BaselineCell time="11" cumHazard="0.672364008756808"/>
|
||||
<BaselineCell time="12" cumHazard="0.860267123782257"/>
|
||||
<BaselineCell time="13" cumHazard="0.874205032906218"/>
|
||||
<BaselineCell time="14" cumHazard="0.895611522448572"/>
|
||||
<BaselineCell time="15" cumHazard="0.913860799157463"/>
|
||||
<BaselineCell time="16" cumHazard="1.0991605587751"/>
|
||||
<BaselineCell time="17" cumHazard="1.10363157561429"/>
|
||||
<BaselineCell time="18" cumHazard="1.14026684520907"/>
|
||||
<BaselineCell time="20" cumHazard="1.26598098240445"/>
|
||||
<BaselineCell time="21" cumHazard="1.27674348799424"/>
|
||||
<BaselineCell time="22" cumHazard="1.28760313513273"/>
|
||||
<BaselineCell time="23" cumHazard="1.28760313513273"/>
|
||||
<BaselineCell time="24" cumHazard="1.58454601105941"/>
|
||||
<BaselineCell time="25" cumHazard="1.59189878742297"/>
|
||||
<BaselineCell time="26" cumHazard="1.62184699428524"/>
|
||||
<BaselineCell time="28" cumHazard="1.74276637666679"/>
|
||||
<BaselineCell time="30" cumHazard="1.7600367376345"/>
|
||||
<BaselineCell time="32" cumHazard="1.91967088909108"/>
|
||||
<BaselineCell time="34" cumHazard="1.92985754170268"/>
|
||||
<BaselineCell time="36" cumHazard="2.09602516705927"/>
|
||||
<BaselineCell time="38" cumHazard="2.12033769586878"/>
|
||||
<BaselineCell time="40" cumHazard="2.33728150688235"/>
|
||||
<BaselineCell time="42" cumHazard="2.38336175359491"/>
|
||||
<BaselineCell time="44" cumHazard="2.51628007826677"/>
|
||||
<BaselineCell time="46" cumHazard="2.55201233739136"/>
|
||||
<BaselineCell time="48" cumHazard="3.11618502418433"/>
|
||||
<BaselineCell time="50" cumHazard="3.1811328997199"/>
|
||||
<BaselineCell time="52" cumHazard="3.79606198196728"/>
|
||||
<BaselineCell time="56" cumHazard="3.98749753148606"/>
|
||||
<BaselineCell time="60" cumHazard="4.41034761655305"/>
|
||||
<BaselineCell time="64" cumHazard="4.64074543636402"/>
|
||||
<BaselineCell time="68" cumHazard="4.78322198137233"/>
|
||||
<BaselineCell time="72" cumHazard="4.94037144429135"/>
|
||||
<BaselineCell time="80" cumHazard="5.11152462512956"/>
|
||||
<BaselineCell time="96" cumHazard="6.222699426868"/>
|
||||
<BaselineCell time="104" cumHazard="6.79288876724028"/>
|
||||
<BaselineCell time="192" cumHazard="8.29524826950812"/>
|
||||
</BaseCumHazardTables>
|
||||
</GeneralRegressionModel>
|
||||
</PMML>
|
|
@ -0,0 +1,928 @@
|
|||
,Predicted_Survival
|
||||
1,0.948773533125988
|
||||
2,0.106685064741818
|
||||
3,0.371429191359731
|
||||
4,0.432672000976977
|
||||
5,2.26169956048912
|
||||
6,2.24819964510635
|
||||
7,1.07509786636342
|
||||
8,0.817617050135163
|
||||
9,1.16536859570171
|
||||
10,1.99096411521757
|
||||
11,1.47475749852548
|
||||
12,2.17817416696918
|
||||
13,1.7184832134066
|
||||
14,0.609794189019769
|
||||
15,0.349950345866522
|
||||
16,0.144658300195172
|
||||
17,0.370054280925074
|
||||
18,5.52148021627731
|
||||
19,0.352663695418917
|
||||
20,0.850285509501719
|
||||
21,0.484157360845486
|
||||
22,1.42794975266649
|
||||
23,1.38740753898548
|
||||
24,1.05987062663177
|
||||
25,0.211644092375205
|
||||
26,1.01739531776558
|
||||
27,1.43650369458459
|
||||
28,0.0893004962108296
|
||||
29,1.00641097885783
|
||||
30,2.40042326768392
|
||||
31,2.09441709925446
|
||||
32,1.11281333880004
|
||||
33,0.200343606439679
|
||||
34,0.554877329215033
|
||||
35,0.0937248659643642
|
||||
36,1.52154967423753
|
||||
37,6.27075117601494
|
||||
38,0.700660165614246
|
||||
39,0.179626462666422
|
||||
40,0.632074812471015
|
||||
41,1.09281910179984
|
||||
42,1.97629667000233
|
||||
43,0.124429436631808
|
||||
44,0.413206694345718
|
||||
45,0.302943517459415
|
||||
46,1.88543922204873
|
||||
47,0.139793714532003
|
||||
48,0.388328526903651
|
||||
49,0.229941803718496
|
||||
50,0.401414318264051
|
||||
51,0.281622502094802
|
||||
52,2.00880728054107
|
||||
53,0.791421606384421
|
||||
54,1.9981104913991
|
||||
55,1.65815195969239
|
||||
56,0.887060421913283
|
||||
57,2.56843155639243
|
||||
58,2.03548332020618
|
||||
59,0.674197806316835
|
||||
60,0.251184250893111
|
||||
61,1.00213621623545
|
||||
62,1.60750912902361
|
||||
63,1.69958635788543
|
||||
64,0.382148808777394
|
||||
65,1.79887153067261
|
||||
66,0.702400674592139
|
||||
67,1.69418200047204
|
||||
68,0.190335722545447
|
||||
69,3.16490604884205
|
||||
70,0.89380120845513
|
||||
71,1.55416698100159
|
||||
72,0.489192878792767
|
||||
73,0.278803899769494
|
||||
74,1.80992497558525
|
||||
75,0.43563132671544
|
||||
76,1.08074032254579
|
||||
77,0.720313157445224
|
||||
78,0.80660733295038
|
||||
79,1.83909542512157
|
||||
80,0.383705526243645
|
||||
81,0.413383464643899
|
||||
82,1.03235955031792
|
||||
83,0.372765897175713
|
||||
84,1.23665038352895
|
||||
85,0.560198363069019
|
||||
86,0.108216799661844
|
||||
87,0.622892919736987
|
||||
88,0.0767944378489242
|
||||
89,0.0844839809247056
|
||||
90,0.986207370137801
|
||||
91,1.23175980709216
|
||||
92,2.18531009441578
|
||||
93,1.01339490310365
|
||||
94,0.885321527605306
|
||||
95,3.84595748092033
|
||||
96,0.350536827423095
|
||||
97,0.299179483486965
|
||||
98,1.61171802992317
|
||||
99,1.19921632515595
|
||||
100,0.604689341816898
|
||||
101,0.439652559647235
|
||||
102,0.892323478879192
|
||||
103,1.17795042400827
|
||||
104,0.625124365520671
|
||||
105,0.366427668519218
|
||||
106,3.47500755436549
|
||||
107,1.25086828033642
|
||||
108,1.08436435969329
|
||||
109,0.433425503363489
|
||||
110,0.525909259011723
|
||||
111,0.400032455642398
|
||||
112,0.0812918605416502
|
||||
113,1.02524431535338
|
||||
114,1.24322821832816
|
||||
115,0.27609762666063
|
||||
116,1.08894264910343
|
||||
117,4.68655495610537
|
||||
118,2.72501215212743
|
||||
119,3.32325359218529
|
||||
120,0.38077257867902
|
||||
121,0.236557577828194
|
||||
122,1.12813220365939
|
||||
123,1.73130125286271
|
||||
124,0.0982197162705487
|
||||
125,3.07877165789845
|
||||
126,1.57410745309061
|
||||
127,1.66474811523516
|
||||
128,1.47189077308874
|
||||
129,0.642610659171818
|
||||
130,1.36918968464884
|
||||
131,0.672580552690841
|
||||
132,1.6993751111011
|
||||
133,1.63183993176402
|
||||
134,1.15003189658344
|
||||
135,0.213496965237593
|
||||
136,1.27125179377874
|
||||
137,1.20834054846734
|
||||
138,2.96386193391516
|
||||
139,0.066549269776706
|
||||
140,2.40850841255249
|
||||
141,1.41530348507481
|
||||
142,0.124429436631808
|
||||
143,2.68436117027554
|
||||
144,1.80580009600838
|
||||
145,1.50914937336892
|
||||
146,2.00817977194842
|
||||
147,1.58213808392079
|
||||
148,0.311646386075043
|
||||
149,0.0934801093348887
|
||||
150,0.413570774140727
|
||||
151,0.586947408798818
|
||||
152,1.62747269970017
|
||||
153,1.61741746969448
|
||||
154,0.372623709878131
|
||||
155,0.359665239584866
|
||||
156,1.58153740804953
|
||||
157,0.560198363069019
|
||||
158,0.813368470517977
|
||||
159,0.429613826412283
|
||||
160,0.198199838873068
|
||||
161,0.849543393959401
|
||||
162,0.916179709505926
|
||||
163,1.27502188655671
|
||||
164,0.917431342221607
|
||||
165,1.57793625664407
|
||||
166,1.27149744262541
|
||||
167,5.05596031333974
|
||||
168,0.913937967939855
|
||||
169,0.23008131689314
|
||||
170,0.857981287192888
|
||||
171,0.284742533261655
|
||||
172,0.307402471651973
|
||||
173,1.09192951963203
|
||||
174,0.974289073227353
|
||||
175,1.0445600021568
|
||||
176,1.70417248579454
|
||||
177,0.660565770555229
|
||||
178,0.475582725739483
|
||||
179,1.41371997764407
|
||||
180,0.809254856480642
|
||||
181,0.902017055007867
|
||||
182,1.07216711613747
|
||||
183,0.520000935268033
|
||||
184,1.821907152616
|
||||
185,2.3535978963016
|
||||
186,0.866272584979326
|
||||
187,1.73798007569862
|
||||
188,1.04914389187267
|
||||
189,2.76636834419797
|
||||
190,0.439310386110051
|
||||
191,0.0934801093348887
|
||||
192,1.94930487251512
|
||||
193,0.962799557947637
|
||||
194,2.94495163085512
|
||||
195,0.223901962011443
|
||||
196,0.128141406628855
|
||||
197,0.571101150113198
|
||||
198,1.90474572037099
|
||||
199,0.982937823382338
|
||||
200,0.0759587148787008
|
||||
201,0.444634519433129
|
||||
202,1.56876066826514
|
||||
203,3.13459002932497
|
||||
204,0.95107848241219
|
||||
205,0.21836144078796
|
||||
206,0.878096697872855
|
||||
207,2.01749491053975
|
||||
208,0.331916874393678
|
||||
209,0.101980276102843
|
||||
210,2.32350511602956
|
||||
211,0.105264208148312
|
||||
212,0.289670798045301
|
||||
213,0.821648525000309
|
||||
214,0.201306258484489
|
||||
215,4.07351902867345
|
||||
216,1.49477923479327
|
||||
217,0.967129808110559
|
||||
218,0.146917900615264
|
||||
219,0.617201448281947
|
||||
220,1.3024361004854
|
||||
221,0.935210945469414
|
||||
222,0.752739991081065
|
||||
223,0.0763272870696938
|
||||
224,1.39801373075171
|
||||
225,1.46173629453087
|
||||
226,0.361451960958913
|
||||
227,1.40232242811603
|
||||
228,0.404773341167888
|
||||
229,2.11022707161083
|
||||
230,0.649522099291223
|
||||
231,2.75157072280407
|
||||
232,0.561125578608799
|
||||
233,0.479669841341361
|
||||
234,1.33349606763548
|
||||
235,0.494969734528303
|
||||
236,0.888270071817849
|
||||
237,0.177961237947372
|
||||
238,0.925424532037173
|
||||
239,1.06234426020181
|
||||
240,0.233109348399048
|
||||
241,2.66022592024995
|
||||
242,0.40348824171668
|
||||
243,0.473554985817296
|
||||
244,2.39430890945322
|
||||
245,0.660237123500764
|
||||
246,3.88232410957914
|
||||
247,0.81116331899597
|
||||
248,1.15286487414355
|
||||
249,1.80386613922474
|
||||
250,0.943356450730933
|
||||
251,0.80889135123253
|
||||
252,1.93283170223399
|
||||
253,0.174782944724232
|
||||
254,2.11313047297582
|
||||
255,0.582062125345302
|
||||
256,0.473177464351283
|
||||
257,1.79148155490168
|
||||
258,0.919379873507292
|
||||
259,0.0911967748500991
|
||||
260,0.465930453865257
|
||||
261,0.769434665058295
|
||||
262,0.172377687175358
|
||||
263,2.16350283725786
|
||||
264,1.08479574176948
|
||||
265,0.52981528621416
|
||||
266,0.756705653986223
|
||||
267,0.321172007590013
|
||||
268,0.0988208566851122
|
||||
269,0.185663524347663
|
||||
270,0.110505862362262
|
||||
271,0.380728830329236
|
||||
272,0.815921307884594
|
||||
273,0.55577421506361
|
||||
274,0.731291578204183
|
||||
275,1.26065563044839
|
||||
276,0.527253846058615
|
||||
277,0.977882843500197
|
||||
278,0.630107356016271
|
||||
279,0.497225527030361
|
||||
280,1.10040118986564
|
||||
281,2.20359048878845
|
||||
282,0.213526962222923
|
||||
283,0.0922213420843653
|
||||
284,0.897446663908787
|
||||
285,0.678444976078189
|
||||
286,1.3319589149452
|
||||
287,0.27104403088127
|
||||
288,0.203593007352569
|
||||
289,0.30890871635222
|
||||
290,1.10795444138348
|
||||
291,0.0844667574766335
|
||||
292,0.543618563399859
|
||||
293,0.490990402546975
|
||||
294,2.84272896006063
|
||||
295,1.69514799433934
|
||||
296,3.53946234875456
|
||||
297,2.75845812579846
|
||||
298,0.439445132497678
|
||||
299,1.64113199947422
|
||||
300,0.757252900838094
|
||||
301,0.470407150277574
|
||||
302,1.46771192587055
|
||||
303,0.184313741297057
|
||||
304,1.84222755631804
|
||||
305,1.93793849616019
|
||||
306,0.362106317832199
|
||||
307,0.348688598274634
|
||||
308,1.45797019105495
|
||||
309,0.70676942322714
|
||||
310,1.49816229151513
|
||||
311,2.27319625894667
|
||||
312,0.0749179613997876
|
||||
313,0.427932894281091
|
||||
314,0.590013292082682
|
||||
315,2.69971984931817
|
||||
316,0.331589039148379
|
||||
317,1.50709138522524
|
||||
318,0.249175952261128
|
||||
319,0.482074151113968
|
||||
320,1.1052864184118
|
||||
321,3.30938455281313
|
||||
322,0.7848658704791
|
||||
323,3.02556560722779
|
||||
324,1.10169496476304
|
||||
325,0.503576562383022
|
||||
326,0.819481182800557
|
||||
327,0.0558379360166038
|
||||
328,0.200461742591672
|
||||
329,0.290096264826017
|
||||
330,0.455456021200556
|
||||
331,2.03661060321388
|
||||
332,1.64098787510538
|
||||
333,0.0691545405522593
|
||||
334,0.202216717741825
|
||||
335,0.892591662120158
|
||||
336,1.12680708305035
|
||||
337,0.198282062048114
|
||||
338,0.216466350675659
|
||||
339,0.215094616296834
|
||||
340,0.682627166830874
|
||||
341,0.842661813296632
|
||||
342,0.401473941187835
|
||||
343,0.68169387645152
|
||||
344,0.240378365792831
|
||||
345,1.57412177036181
|
||||
346,0.13554951682927
|
||||
347,0.652763385082658
|
||||
348,1.72703905216568
|
||||
349,0.404938297577567
|
||||
350,0.154068791956889
|
||||
351,0.0856272985688075
|
||||
352,2.63377680030936
|
||||
353,7.39191115439482
|
||||
354,0.0713109772699876
|
||||
355,0.954429360805358
|
||||
356,0.540387761881134
|
||||
357,2.50668351126604
|
||||
358,0.367302021387852
|
||||
359,0.149206248770378
|
||||
360,0.180044470273975
|
||||
361,0.0765183404128482
|
||||
362,0.801940408767951
|
||||
363,0.157944428095768
|
||||
364,0.842830688925505
|
||||
365,0.40351909622095
|
||||
366,0.859071681169577
|
||||
367,0.0689739477919034
|
||||
368,0.387971757175932
|
||||
369,1.63128639545339
|
||||
370,0.260822693558132
|
||||
371,0.662774390161612
|
||||
372,0.143085387187816
|
||||
373,1.00113502400553
|
||||
374,2.21586735843644
|
||||
375,0.471165036746743
|
||||
376,0.0864281601622696
|
||||
377,0.195903737908453
|
||||
378,2.8467627480549
|
||||
379,0.880768034370335
|
||||
380,0.36434217967444
|
||||
381,0.101814510686822
|
||||
382,0.306646989396713
|
||||
383,0.704766847537665
|
||||
384,0.40558830550799
|
||||
385,1.63127106055963
|
||||
386,1.45791906155912
|
||||
387,1.03507538329699
|
||||
388,0.40351909622095
|
||||
389,0.465930453865257
|
||||
390,0.164108779254938
|
||||
391,1.15165541019114
|
||||
392,0.068833975782394
|
||||
393,0.478493465128332
|
||||
394,0.15124282658719
|
||||
395,0.516984333152939
|
||||
396,1.61333321088686
|
||||
397,0.92250307907169
|
||||
398,1.50313707566236
|
||||
399,0.987654124266145
|
||||
400,1.3400561990791
|
||||
401,0.267353028118712
|
||||
402,2.13193195938747
|
||||
403,2.57220205563502
|
||||
404,0.520148465448927
|
||||
405,3.45124044036023
|
||||
406,3.77439597410069
|
||||
407,0.152409634179407
|
||||
408,1.42657670086872
|
||||
409,3.08445484376544
|
||||
410,0.17915906356942
|
||||
411,0.134331586955896
|
||||
412,2.16923940610019
|
||||
413,0.850285509501719
|
||||
414,0.0889692128329128
|
||||
415,0.358712209364376
|
||||
416,1.04932411609261
|
||||
417,0.692324679449233
|
||||
418,0.773249743097035
|
||||
419,0.672664160175752
|
||||
420,2.4322997881058
|
||||
421,0.709658722433271
|
||||
422,1.54924051378758
|
||||
423,0.979973984544662
|
||||
424,0.438861266327717
|
||||
425,0.858101358491403
|
||||
426,0.581975642634626
|
||||
427,2.61172383681139
|
||||
428,1.45791906155912
|
||||
429,0.0849065539199683
|
||||
430,0.3962438691177
|
||||
431,0.510864315890137
|
||||
432,0.478875227929907
|
||||
433,0.825658412141667
|
||||
434,0.170979812746739
|
||||
435,1.63995548917371
|
||||
436,0.112094186279857
|
||||
437,0.13735110617056
|
||||
438,0.0897258215421902
|
||||
439,0.530953233728503
|
||||
440,0.0640495066918033
|
||||
441,0.0784896954813958
|
||||
442,0.767684376798937
|
||||
443,0.0838371940539514
|
||||
444,1.58333802185858
|
||||
445,0.0861513688035231
|
||||
446,0.520065575808374
|
||||
447,1.44884887943789
|
||||
448,1.05131145909608
|
||||
449,0.396067028726277
|
||||
450,0.567909991532724
|
||||
451,2.93054177681483
|
||||
452,0.523217330952997
|
||||
453,3.89845254566857
|
||||
454,2.08122078012682
|
||||
455,0.155798242039853
|
||||
456,0.348785720441969
|
||||
457,3.40700069631272
|
||||
458,0.204227519033335
|
||||
459,0.788136576748706
|
||||
460,0.285711106620368
|
||||
461,1.28072052186419
|
||||
462,1.29707562887845
|
||||
463,0.846844657083073
|
||||
464,1.01354629844274
|
||||
465,0.545522294479139
|
||||
466,0.265383161634566
|
||||
467,0.49245881513286
|
||||
468,3.70254157055767
|
||||
469,1.05035348531629
|
||||
470,0.0999230422158836
|
||||
471,0.61392745736402
|
||||
472,0.682542415762655
|
||||
473,0.398461800023889
|
||||
474,3.38504719664277
|
||||
475,0.304367852949686
|
||||
476,2.41721077935207
|
||||
477,2.15175730241934
|
||||
478,3.05703815911585
|
||||
479,0.856956274357137
|
||||
480,2.41691623270818
|
||||
481,0.326560169773232
|
||||
482,4.19270897786033
|
||||
483,0.875747890637334
|
||||
484,3.52708882579018
|
||||
485,0.0600164641331571
|
||||
486,0.446498688959429
|
||||
487,0.586024455819137
|
||||
488,1.22855553196765
|
||||
489,4.79370413117051
|
||||
490,0.50611276606448
|
||||
491,0.107154281333399
|
||||
492,1.51007459289973
|
||||
493,0.340846362453173
|
||||
494,0.0773163749728704
|
||||
495,0.400714379480103
|
||||
496,0.903546203716307
|
||||
497,0.409670752916944
|
||||
498,2.02400302593198
|
||||
499,0.231638150759391
|
||||
500,0.194945861555683
|
||||
501,1.64642927783111
|
||||
502,0.508519278694335
|
||||
503,1.42603209058076
|
||||
504,0.962783951223636
|
||||
505,1.29986556577046
|
||||
506,0.282958792772042
|
||||
507,0.340550074399506
|
||||
508,2.49304287223433
|
||||
509,3.76277593188457
|
||||
510,0.768369355077863
|
||||
511,0.289137255494302
|
||||
512,1.02538019363803
|
||||
513,0.111724579617596
|
||||
514,3.32538410803282
|
||||
515,1.53097962792136
|
||||
516,0.94570885764674
|
||||
517,0.665648743803318
|
||||
518,6.39528829493036
|
||||
519,0.997172519452485
|
||||
520,0.832405673556159
|
||||
521,0.204442258397782
|
||||
522,0.0808900204067107
|
||||
523,0.140626150825512
|
||||
524,1.45510496306512
|
||||
525,0.417890670592703
|
||||
526,1.02307664775821
|
||||
527,0.145055084740185
|
||||
528,0.299974605125944
|
||||
529,0.0857618690011615
|
||||
530,0.391297534030238
|
||||
531,0.0734010414089703
|
||||
532,0.848940486615892
|
||||
533,2.66857657657084
|
||||
534,1.26742660207243
|
||||
535,0.717720127441068
|
||||
536,0.298430924808744
|
||||
537,1.36495067868827
|
||||
538,0.242354236802257
|
||||
539,0.593772384586487
|
||||
540,0.643337799777811
|
||||
541,0.891467102463602
|
||||
542,0.0779687309885285
|
||||
543,1.52118576151603
|
||||
544,1.06925030396688
|
||||
545,0.414327274364734
|
||||
546,0.0974901729819271
|
||||
547,2.15224994340381
|
||||
548,0.224556622410638
|
||||
549,0.249952526340618
|
||||
550,1.16295214515075
|
||||
551,0.470032510628734
|
||||
552,0.162680367361272
|
||||
553,1.53976709233412
|
||||
554,0.291871759558872
|
||||
555,1.53177011116815
|
||||
556,0.606723100833454
|
||||
557,0.380422035716361
|
||||
558,0.319408239001265
|
||||
559,0.413206694345718
|
||||
560,0.281164408039806
|
||||
561,0.458117912323726
|
||||
562,1.03547068485176
|
||||
563,1.71124526857904
|
||||
564,0.23246793544006
|
||||
565,0.996795353921835
|
||||
566,1.34480148721409
|
||||
567,0.0769743920942701
|
||||
568,0.983043257405762
|
||||
569,1.00486609188663
|
||||
570,1.61265603544106
|
||||
571,1.62193739043972
|
||||
572,3.20483682254625
|
||||
573,1.34676830374682
|
||||
574,0.434479623242827
|
||||
575,0.114109757344028
|
||||
576,0.722199135348304
|
||||
577,2.23364720942712
|
||||
578,0.608332444021093
|
||||
579,0.371054229549081
|
||||
580,0.75593013436945
|
||||
581,0.376205344476193
|
||||
582,0.386408723151415
|
||||
583,2.31785514708667
|
||||
584,3.71180933012808
|
||||
585,0.974208270661597
|
||||
586,0.765794005138363
|
||||
587,5.11675210458092
|
||||
588,0.118085933885857
|
||||
589,0.731982942570762
|
||||
590,0.292178760543499
|
||||
591,1.06215387811769
|
||||
592,0.847525009435253
|
||||
593,0.165519115492561
|
||||
594,4.49032294651915
|
||||
595,0.982980936342257
|
||||
596,0.743338998128305
|
||||
597,1.33531830350703
|
||||
598,0.858910098807812
|
||||
599,0.816331457648957
|
||||
600,1.05938012965172
|
||||
601,0.463948535307033
|
||||
602,0.45232489586155
|
||||
603,1.3303994993905
|
||||
604,0.112098051669392
|
||||
605,0.546403605700202
|
||||
606,0.450404541753939
|
||||
607,0.194143517582439
|
||||
608,0.387375935287682
|
||||
609,0.769510295908683
|
||||
610,0.308511923084411
|
||||
611,2.02928841971228
|
||||
612,1.47563536420566
|
||||
613,0.094863789334469
|
||||
614,0.36237213986602
|
||||
615,0.16247005969316
|
||||
616,0.780997556336414
|
||||
617,0.528198777430487
|
||||
618,1.32081173942622
|
||||
619,1.00550612316689
|
||||
620,0.294611759100088
|
||||
621,2.52736182359548
|
||||
622,0.677283622621978
|
||||
623,1.04329955235743
|
||||
624,0.8338496142252
|
||||
625,0.373702473207338
|
||||
626,1.19067484806443
|
||||
627,0.370496529472036
|
||||
628,0.229946009476626
|
||||
629,0.704466996315955
|
||||
630,0.945042940418814
|
||||
631,0.797646029356427
|
||||
632,0.24759461155123
|
||||
633,0.347004633516302
|
||||
634,0.703062670681754
|
||||
635,0.27823360485317
|
||||
636,2.59315168827224
|
||||
637,0.185686603903336
|
||||
638,0.0747107474072024
|
||||
639,0.0773622252513285
|
||||
640,0.812720691082668
|
||||
641,0.310840595809426
|
||||
642,1.23471453967711
|
||||
643,0.430318026112275
|
||||
644,1.6439445423958
|
||||
645,0.413527144845067
|
||||
646,2.08727450679551
|
||||
647,0.212071959915317
|
||||
648,0.220030302050435
|
||||
649,0.700510808168086
|
||||
650,2.47177720319465
|
||||
651,3.36992367848134
|
||||
652,0.171957720348718
|
||||
653,1.7376511112814
|
||||
654,0.850789747153746
|
||||
655,0.565488596263901
|
||||
656,0.30660990302924
|
||||
657,0.224328345349684
|
||||
658,0.236461687811483
|
||||
659,0.497565061449058
|
||||
660,2.76184950116849
|
||||
661,1.183201784393
|
||||
662,0.214742719423168
|
||||
663,1.29349515624607
|
||||
664,3.08952563348403
|
||||
665,4.8653642240408
|
||||
666,0.122739813981107
|
||||
667,0.239189992401144
|
||||
668,0.348056019078374
|
||||
669,1.01414735326495
|
||||
670,2.31735398244103
|
||||
671,1.06215387811769
|
||||
672,0.502710467303213
|
||||
673,0.220245614125891
|
||||
674,0.65246277734426
|
||||
675,0.0606477919030215
|
||||
676,0.439457633339722
|
||||
677,0.277672483563757
|
||||
678,3.60550854632762
|
||||
679,0.481172915524913
|
||||
680,1.40666805433586
|
||||
681,0.981845214831699
|
||||
682,0.148886349595505
|
||||
683,0.363291177723984
|
||||
684,5.14564101861401
|
||||
685,0.2286748652599
|
||||
686,1.09487090039656
|
||||
687,0.637715029153977
|
||||
688,0.227553426403431
|
||||
689,3.45309732516387
|
||||
690,0.448468070811415
|
||||
691,0.347210917761426
|
||||
692,0.130370230971394
|
||||
693,0.621452102939217
|
||||
694,0.91355053020453
|
||||
695,0.99900689386977
|
||||
696,0.151943488281267
|
||||
697,0.265380666902432
|
||||
698,0.910637344453003
|
||||
699,0.494969734528303
|
||||
700,3.3708912806511
|
||||
701,4.4367985755814
|
||||
702,1.4946489248654
|
||||
703,1.20185751010296
|
||||
704,0.748080052527042
|
||||
705,0.735104092540724
|
||||
706,0.474262881747473
|
||||
707,0.352719494561219
|
||||
708,0.91140086539375
|
||||
709,0.0606477919030215
|
||||
710,0.37041966938879
|
||||
711,0.253967063649832
|
||||
712,1.64154649699216
|
||||
713,0.479648868377117
|
||||
714,2.21564739433389
|
||||
715,0.107980824377266
|
||||
716,0.501439257152335
|
||||
717,0.233076600414291
|
||||
718,0.268813540024044
|
||||
719,0.161457611877573
|
||||
720,0.148254144629051
|
||||
721,2.1505743412574
|
||||
722,0.211392786763572
|
||||
723,1.98175745319973
|
||||
724,0.722105051924044
|
||||
725,0.60117579836453
|
||||
726,0.8392158940198
|
||||
727,0.846967654690207
|
||||
728,0.798759438576785
|
||||
729,0.418135782651133
|
||||
730,0.539419352373792
|
||||
731,1.75350048643334
|
||||
732,1.06215387811769
|
||||
733,0.130338365460084
|
||||
734,0.209165827647501
|
||||
735,0.940710603858938
|
||||
736,0.0649237449062295
|
||||
737,0.929944319793183
|
||||
738,0.708299439485088
|
||||
739,0.216247825539019
|
||||
740,0.32234060533728
|
||||
741,4.24034327886732
|
||||
742,0.647265168058827
|
||||
743,2.96372999501341
|
||||
744,1.90147466798938
|
||||
745,1.86687448563705
|
||||
746,1.01458966870482
|
||||
747,0.740184719427737
|
||||
748,0.260767069203584
|
||||
749,4.43629377576045
|
||||
750,1.03748803834302
|
||||
751,0.244336150323993
|
||||
752,0.589043843790886
|
||||
753,0.923560585429523
|
||||
754,2.6072335331296
|
||||
755,0.317814949533265
|
||||
756,5.64371691703985
|
||||
757,0.518958008043728
|
||||
758,0.744440967957724
|
||||
759,0.747088808143852
|
||||
760,0.560140037807726
|
||||
761,0.771402522132896
|
||||
762,0.183623649646745
|
||||
763,0.20316225698185
|
||||
764,0.718786527633959
|
||||
765,2.04654581969483
|
||||
766,5.24385306634481
|
||||
767,0.35940860405069
|
||||
768,0.306632057197553
|
||||
769,0.653393271142366
|
||||
770,1.54847660853231
|
||||
771,0.557245706824258
|
||||
772,0.0808699332718611
|
||||
773,0.0868917459966026
|
||||
774,0.482109303594999
|
||||
775,0.283264405263564
|
||||
776,0.984215266199527
|
||||
777,0.105975987034662
|
||||
778,0.832511788920787
|
||||
779,0.6407758841563
|
||||
780,0.522685910554196
|
||||
781,0.999668522531557
|
||||
782,0.143890193776344
|
||||
783,0.523102517621911
|
||||
784,0.741044689470985
|
||||
785,0.620366916790918
|
||||
786,0.756182930561673
|
||||
787,1.10360826539004
|
||||
788,0.629526404951393
|
||||
789,0.218698818378543
|
||||
790,1.08153260994288
|
||||
791,1.52257315737285
|
||||
792,1.77678818121566
|
||||
793,1.66847372966732
|
||||
794,4.38833486241985
|
||||
795,0.509616226786447
|
||||
796,0.0794505542558207
|
||||
797,2.53397915177159
|
||||
798,0.277787444632549
|
||||
799,1.3060879700236
|
||||
800,0.774119254673215
|
||||
801,1.25519216023167
|
||||
802,0.271002240204741
|
||||
803,1.28850069103274
|
||||
804,0.0624404551733988
|
||||
805,0.401994659072391
|
||||
806,0.15124282658719
|
||||
807,0.717055645121261
|
||||
808,2.56856648153352
|
||||
809,0.274318148673389
|
||||
810,0.329451506570509
|
||||
811,0.438297549000355
|
||||
812,0.354528208103406
|
||||
813,2.58476468782836
|
||||
814,0.473458443850189
|
||||
815,0.883597809269557
|
||||
816,1.13920458824537
|
||||
817,1.75493249991071
|
||||
818,0.281587498373052
|
||||
819,0.619508317880243
|
||||
820,0.544184848137027
|
||||
821,0.284442460400823
|
||||
822,0.753824735279892
|
||||
823,0.372105108546874
|
||||
824,0.199239080955227
|
||||
825,0.146651028885089
|
||||
826,0.141142436084597
|
||||
827,0.333973863307953
|
||||
828,0.419186928752752
|
||||
829,0.0806297196003009
|
||||
830,2.78329952539468
|
||||
831,1.35748310192603
|
||||
832,1.55989937222634
|
||||
833,0.438297549000355
|
||||
834,0.379780507366155
|
||||
835,1.28758129425281
|
||||
836,0.303619828671484
|
||||
837,1.01385398304106
|
||||
838,0.682454018911006
|
||||
839,0.199472699661369
|
||||
840,0.0726524498479238
|
||||
841,0.254451868204436
|
||||
842,0.449940811907593
|
||||
843,3.20647804239835
|
||||
844,0.0649237449062295
|
||||
845,1.37230894093763
|
||||
846,0.899271597185515
|
||||
847,1.36604687600622
|
||||
848,0.0672891980128768
|
||||
849,7.13316798891834
|
||||
850,1.9161783419809
|
||||
851,0.220480036512521
|
||||
852,1.56101321759382
|
||||
853,0.409026895303065
|
||||
854,2.69108034235023
|
||||
855,1.65971380610461
|
||||
856,4.27864880996489
|
||||
857,1.59851125487747
|
||||
858,0.282316331841616
|
||||
859,0.376959624443473
|
||||
860,1.62728571342826
|
||||
861,1.25778512496917
|
||||
862,0.392175583396378
|
||||
863,2.32111184870961
|
||||
864,0.704798189292955
|
||||
865,2.6621504787621
|
||||
866,0.147250543645364
|
||||
867,0.350866612094145
|
||||
868,2.02975778241613
|
||||
869,0.866272584979326
|
||||
870,0.25604517634272
|
||||
871,0.320598855560967
|
||||
872,1.35367440932573
|
||||
873,0.0868060344531751
|
||||
874,1.04090007731069
|
||||
875,4.59610794675101
|
||||
876,0.455767032978901
|
||||
877,0.383072238533021
|
||||
878,1.99388653015307
|
||||
879,0.419267884820371
|
||||
880,1.87644940973987
|
||||
881,0.295901261219748
|
||||
882,0.283346134315378
|
||||
883,2.64454377602758
|
||||
884,0.331953416248009
|
||||
885,0.564258149953239
|
||||
886,1.72763193500914
|
||||
887,0.570408325347565
|
||||
888,0.0932458287611335
|
||||
889,0.0798007864583703
|
||||
890,0.210032488523095
|
||||
891,1.91834004263675
|
||||
892,3.06129194438973
|
||||
893,0.964493382169883
|
||||
894,1.03547068485176
|
||||
895,0.439391990716866
|
||||
896,0.97975998674915
|
||||
897,2.28221667032073
|
||||
898,1.49406420943646
|
||||
899,0.826546535229472
|
||||
900,0.0745149444762376
|
||||
901,1.14148984327979
|
||||
902,1.99617700670555
|
||||
903,2.46699994842995
|
||||
904,0.113272647116634
|
||||
905,0.507443378379386
|
||||
906,0.373684597836961
|
||||
907,0.362067200545781
|
||||
908,1.56509856247658
|
||||
909,1.85387233055221
|
||||
910,0.440920412679918
|
||||
911,0.768180935857984
|
||||
912,0.263919736828376
|
||||
913,1.28538621028933
|
||||
914,2.94032281720416
|
||||
915,1.09398346987558
|
||||
916,0.248686052724363
|
||||
917,0.258434198649206
|
||||
918,0.350880097479584
|
||||
919,0.148281568746753
|
||||
920,0.204081794529902
|
||||
921,0.0950410251435072
|
||||
922,1.80583791579914
|
||||
923,1.28850069103274
|
||||
924,0.248274935948343
|
||||
925,0.330490237697521
|
||||
926,1.46422807440927
|
||||
927,0.42183395688476
|
|
|
@ -0,0 +1,190 @@
|
|||
#region Copyright Syncfusion Inc. 2001-2018.
|
||||
// Copyright Syncfusion Inc. 2001-2018. All rights reserved.
|
||||
// Use of this code is subject to the terms of our license.
|
||||
// A copy of the current license can be obtained at any time by e-mailing
|
||||
// licensing@syncfusion.com. Any infringement will be prosecuted under
|
||||
// applicable laws.
|
||||
#endregion
|
||||
using Syncfusion.PMML;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
namespace BfeedCoxRegression
|
||||
{
|
||||
/// <summary>
|
||||
/// Console program to demonstrate PMML execution engine
|
||||
/// </summary>
|
||||
public class Program
|
||||
{
|
||||
//Create Table instance for input, output and R Result
|
||||
public Table inputTable = null;
|
||||
private Table outputTable = null;
|
||||
private Table rResults = null;
|
||||
|
||||
#if CONSOLE
|
||||
|
||||
private static void Main(string[] args)
|
||||
{
|
||||
//Create instance
|
||||
Program program = new Program();
|
||||
//Load input csv
|
||||
program.inputTable = new Table("../../Model/Bfeed.csv", true, ',');
|
||||
//Invoke PredictResult
|
||||
program.outputTable = program.PredictResult(program.inputTable,
|
||||
"../../Model/Bfeed.pmml");
|
||||
//Dispose the inputTable values
|
||||
program.inputTable.Dispose();
|
||||
//Compare predicted results of PMML execution engine with R Results
|
||||
program.ComparePredictedResultsWithR("../../Model/ROutput.csv");
|
||||
//Write the Result as CSV Table
|
||||
program.outputTable.WriteToCSV("../../Model/PredictedOutput.csv", true, ',');
|
||||
//Dispose the output Table
|
||||
program.outputTable.Dispose();
|
||||
//Display the result saved location
|
||||
Console.WriteLine("\nResult saved in : " + Path.GetFullPath("../../Model/PredictedOutput.csv"));
|
||||
Console.ReadKey();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#region PredictResult
|
||||
|
||||
/// <summary>
|
||||
/// Predicts the results for given PMML and CSV file and serialize the results in a CSV file
|
||||
/// </summary>
|
||||
public Table PredictResult(Table inputTable, string pmmlPath)
|
||||
{
|
||||
//Get PMML Evaluator instance
|
||||
PMMLEvaluator evaluator = new PMMLEvaluatorFactory().
|
||||
GetPMMLEvaluatorInstance(pmmlPath);
|
||||
|
||||
string[] predictedCategories = null;
|
||||
|
||||
//Predict the value for each record using the PMML Evaluator instance
|
||||
for (int i = 0; i < inputTable.RowCount; i++)
|
||||
{
|
||||
var bfeed = GetDataObject(inputTable, i);
|
||||
|
||||
//Get result
|
||||
PredictedResult predictedResult = evaluator.GetResult(bfeed, null);
|
||||
|
||||
if (i == 0)
|
||||
{
|
||||
//Get the predicted propability fields
|
||||
predictedCategories = predictedResult.GetPredictedCategories();
|
||||
//Initialize the output table
|
||||
InitializeTable(inputTable.RowCount, predictedResult.PredictedField, predictedCategories);
|
||||
}
|
||||
|
||||
//Add predicted value
|
||||
outputTable[i, 0] = predictedResult.PredictedValue;
|
||||
//Add predicted Survival
|
||||
outputTable[i, 1] = predictedResult.GetPredictedProbability("survival");
|
||||
}
|
||||
return outputTable;
|
||||
}
|
||||
|
||||
#endregion PredictResult
|
||||
|
||||
#region Compare Predicted Results With R
|
||||
|
||||
/// <summary>
|
||||
/// Compare predicted results of PMML execution engine with R results
|
||||
/// </summary>
|
||||
|
||||
public void ComparePredictedResultsWithR(string rOutputDataCSVPath)
|
||||
{
|
||||
//Create instance to hold results of R
|
||||
rResults = new Table(rOutputDataCSVPath, true, ',');
|
||||
string differentIndices = string.Empty;
|
||||
//Pass the Table to the compare method of resultTable
|
||||
bool isDifferent = Compare(rResults, 1, 0, ref differentIndices);
|
||||
#if CONSOLE
|
||||
//Display mismatched index
|
||||
if (isDifferent)
|
||||
{
|
||||
Console.WriteLine("\nDifference in predicted results by R and PMML execution engine");
|
||||
Console.WriteLine("\nDifferent indices are " + differentIndices);
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("\nBoth predicted results by R and PMML execution engine are equal");
|
||||
}
|
||||
#endif
|
||||
//Dispose the R results Table
|
||||
rResults.Dispose();
|
||||
}
|
||||
|
||||
#endregion Compare Predicted Results With R
|
||||
|
||||
#region Initialize OutputTable
|
||||
|
||||
/// <summary>
|
||||
/// Initialize the outputTable
|
||||
/// </summary>
|
||||
/// <param name="rowCount">rowCount of output table</param>
|
||||
/// <param name="predictedfield">predictedfield name</param>
|
||||
/// <param name="predictedCategories">probableFields</param>
|
||||
private void InitializeTable(int rowCount, string predictedfield, string[] predictedCategories)
|
||||
{
|
||||
//Create instance to hold evaluated results
|
||||
outputTable = new Table(rowCount, predictedCategories.Length + 1);
|
||||
//Add predicted column names
|
||||
outputTable.ColumnNames[0] = "CumulativeHazard";
|
||||
outputTable.ColumnNames[1] = "Predicted_" + predictedfield;
|
||||
}
|
||||
|
||||
#endregion Initialize OutputTable
|
||||
|
||||
#region GetDataObject
|
||||
|
||||
/// <summary>
|
||||
/// Returns the row as anonymous object
|
||||
/// </summary>
|
||||
/// <param name="inputTable"> input Table values</param>
|
||||
/// <param name="row">input row</param>
|
||||
/// <returns>Anonymous object</returns>
|
||||
public Dictionary<string, object> GetDataObject(Table inputTable, int row)
|
||||
{
|
||||
Dictionary<string, object> bfeed = new Dictionary<string, object>();
|
||||
for (int i = 0; i < inputTable.ColumnCount; i++)
|
||||
{
|
||||
bfeed.Add(inputTable.ColumnNames[i], inputTable[row, inputTable.ColumnNames[i]]);
|
||||
}
|
||||
return bfeed;
|
||||
}
|
||||
|
||||
#endregion GetDataObject
|
||||
|
||||
#region Compare
|
||||
|
||||
/// <summary>
|
||||
/// Compares the result of 2 Tables based on column index.
|
||||
/// </summary>
|
||||
/// <param name="rOutput">R output table</param>
|
||||
/// <param name="rColumnIndex">R's Column to be compared</param>
|
||||
/// <param name="predictedColumnIndex">predicted result's column index</param>
|
||||
/// <param name="differentIndices"> different indices</param>
|
||||
/// <returns>IsDifferent</returns>
|
||||
public bool Compare(Table table, int rColumnIndex, int predictedColumnIndex, ref string differentIndices)
|
||||
{
|
||||
bool isDifferent = false;
|
||||
//Compare predicted values
|
||||
for (int i = 0; i < table.RowCount; i++)
|
||||
{
|
||||
//Compare Results based on column index
|
||||
double predictedC = Math.Round(Convert.ToDouble(outputTable[i, predictedColumnIndex]), 2);
|
||||
double predictedR = Math.Round(Convert.ToDouble(table[i, rColumnIndex]), 2);
|
||||
if (predictedC != predictedR)
|
||||
{
|
||||
differentIndices += ", " + i;
|
||||
isDifferent = true;
|
||||
}
|
||||
}
|
||||
return isDifferent;
|
||||
}
|
||||
|
||||
#endregion Compare
|
||||
}
|
||||
}
|
|
@ -0,0 +1,70 @@
|
|||
# Copyright Syncfusion Inc. 2001 - 2016. All rights reserved.
|
||||
# Use of this code is subject to the terms of our license.
|
||||
# A copy of the current license can be obtained at any time by e-mailing
|
||||
# licensing@syncfusion.com. Any infringement will be prosecuted under
|
||||
# applicable laws.
|
||||
|
||||
|
||||
# If you are not familiar with R you can obtain a quick introduction by downloading
|
||||
# R Succinctly for free from Syncfusion - http://www.syncfusion.com/resources/techportal/ebooks/rsuccinctly
|
||||
# R Succinctly is also included with this installation and is available here
|
||||
# Installed Drive :\Program Files (x86)\Syncfusion\Essential Studio\XX.X.X.XX\Infrastructure\EBooks\R_Succintly.pdf OF R Succinctly
|
||||
# Uncomment below lines to install necessary packages if not installed already
|
||||
# install.packages("pmml")
|
||||
# install.packages("survival")
|
||||
# install.packages("KMsurv")
|
||||
|
||||
# Load below packages
|
||||
library(pmml)
|
||||
library(survival)
|
||||
library(KMsurv) #This package is specifically loaded for larynx data shipped within it.
|
||||
|
||||
# Here we directly load the larynx dataset installed with the "KMsurv" package.
|
||||
data(larynx)
|
||||
|
||||
#rename column names for larynx dataset from KMsurv package
|
||||
larynxOriginal <- setNames(larynx, c("Cancer_Stage", "Survival_Time", "Diagnosed_Age", "Diagnosed_Year", "Death_Indicator"))
|
||||
|
||||
# Code below demonstrates loading the same dataset from a CSV file shipped with our installer.
|
||||
# Please check installed samples (Data) location to set actual working directory
|
||||
# Uncomment below lines and comment out the code to read data from package.
|
||||
# setwd("C:/actual_data_location")
|
||||
# larynx = read.csv("Larynx.csv")
|
||||
|
||||
# Divide dataset for training and test
|
||||
trainData=larynxOriginal[1:72,]
|
||||
testData=larynxOriginal[73:90,]
|
||||
|
||||
# Applying Cox Regression Model to predict Survival
|
||||
larynx_Cox = coxph(Surv(Survival_Time,Death_Indicator)~Cancer_Stage+Diagnosed_Age+Diagnosed_Year, trainData)
|
||||
summary(larynx_Cox)
|
||||
|
||||
# Calculate Survival fit of the model
|
||||
survfit(larynx_Cox, trainData)
|
||||
plot(survfit(larynx_Cox))
|
||||
|
||||
# Display the predicted results
|
||||
# Predict "Survival" column for test data set
|
||||
larynxTestPrediction = predict(larynx_Cox, type = "expected",testData)
|
||||
# Display predicted values
|
||||
larynxTestPrediction
|
||||
|
||||
# The code below is used for evaluation purpose.
|
||||
# The model is applied for original larynx data set and predicted results are saved in "ROutput.csv"
|
||||
# "ROutput.csv" file used for comparing the R results with PMML Evaluation engine results
|
||||
|
||||
# Applying Cox Regression model to entire dataset and save the results in a CSV file
|
||||
larynxEntirePrediction = predict(larynx_Cox, type = "expected", larynxOriginal)
|
||||
|
||||
# PMML generation
|
||||
pmmlFile<-pmml(larynx_Cox, data=trainData)
|
||||
write(toString(pmmlFile), file="Larynx.pmml")
|
||||
saveXML(pmmlFile, file="Larynx.pmml")
|
||||
|
||||
# Save predicted value in a data frame
|
||||
result = data.frame(larynxEntirePrediction)
|
||||
names(result) = c("Predicted_Survival")
|
||||
|
||||
# Write the results in a CSV file
|
||||
write.csv(result,"ROutput.csv",quote=F)
|
||||
|
|
@ -0,0 +1,91 @@
|
|||
Cancer_Stage,Survival_Time,Diagnosed_Age,Diagnosed_Year,Death_Indicator
|
||||
1,0.6,77,76,1
|
||||
1,1.3,53,71,1
|
||||
1,2.4,45,71,1
|
||||
1,2.5,57,78,0
|
||||
1,3.2,58,74,1
|
||||
1,3.2,51,77,0
|
||||
1,3.3,76,74,1
|
||||
1,3.3,63,77,0
|
||||
1,3.5,43,71,1
|
||||
1,3.5,60,73,1
|
||||
1,4,52,71,1
|
||||
1,4,63,76,1
|
||||
1,4.3,86,74,1
|
||||
1,4.5,48,76,0
|
||||
1,4.5,68,76,0
|
||||
1,5.3,81,72,1
|
||||
1,5.5,70,75,0
|
||||
1,5.9,58,75,0
|
||||
1,5.9,47,75,0
|
||||
1,6,75,73,1
|
||||
1,6.1,77,75,0
|
||||
1,6.2,64,75,0
|
||||
1,6.4,77,72,1
|
||||
1,6.5,67,70,1
|
||||
1,6.5,79,74,0
|
||||
1,6.7,61,74,0
|
||||
1,7,66,74,0
|
||||
1,7.4,68,71,1
|
||||
1,7.4,73,73,0
|
||||
1,8.1,56,73,0
|
||||
1,8.1,73,73,0
|
||||
1,9.6,58,71,0
|
||||
1,10.7,68,70,0
|
||||
2,0.2,86,74,1
|
||||
2,1.8,64,77,1
|
||||
2,2,63,75,1
|
||||
2,2.2,71,78,0
|
||||
2,2.6,67,78,0
|
||||
2,3.3,51,77,0
|
||||
2,3.6,70,77,1
|
||||
2,3.6,72,77,0
|
||||
2,4,81,71,1
|
||||
2,4.3,47,76,0
|
||||
2,4.3,64,76,0
|
||||
2,5,66,76,0
|
||||
2,6.2,74,72,1
|
||||
2,7,62,73,1
|
||||
2,7.5,50,73,0
|
||||
2,7.6,53,73,0
|
||||
2,9.3,61,71,0
|
||||
3,0.3,49,72,1
|
||||
3,0.3,71,76,1
|
||||
3,0.5,57,74,1
|
||||
3,0.7,79,77,1
|
||||
3,0.8,82,74,1
|
||||
3,1,49,76,1
|
||||
3,1.3,60,76,1
|
||||
3,1.6,64,72,1
|
||||
3,1.8,74,71,1
|
||||
3,1.9,72,74,1
|
||||
3,1.9,53,74,1
|
||||
3,3.2,54,75,1
|
||||
3,3.5,81,74,1
|
||||
3,3.7,52,77,0
|
||||
3,4.5,66,76,0
|
||||
3,4.8,54,76,0
|
||||
3,4.8,63,76,0
|
||||
3,5,59,73,1
|
||||
3,5,49,76,0
|
||||
3,5.1,69,76,0
|
||||
3,6.3,70,72,1
|
||||
3,6.4,65,72,1
|
||||
3,6.5,65,74,0
|
||||
3,7.8,68,72,1
|
||||
3,8,78,73,0
|
||||
3,9.3,69,71,0
|
||||
3,10.1,51,71,0
|
||||
4,0.1,65,72,1
|
||||
4,0.3,71,76,1
|
||||
4,0.4,76,77,1
|
||||
4,0.8,65,76,1
|
||||
4,0.8,78,77,1
|
||||
4,1,41,77,1
|
||||
4,1.5,68,73,1
|
||||
4,2,69,76,1
|
||||
4,2.3,62,71,1
|
||||
4,2.9,74,78,0
|
||||
4,3.6,71,75,1
|
||||
4,3.8,84,74,1
|
||||
4,4.3,48,76,0
|
|
|
@ -0,0 +1,105 @@
|
|||
<?xml version="1.0"?>
|
||||
<PMML version="4.3" xmlns="http://www.dmg.org/PMML-4_3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.dmg.org/PMML-4_3 http://www.dmg.org/pmml/v4-3/pmml-4-3.xsd">
|
||||
<Header copyright="Copyright (c) 2017 Syncfusion" description="CoxPH Survival Regression Model">
|
||||
<Extension name="user" value="Syncfusion" extender="Rattle/PMML"/>
|
||||
<Application name="Rattle/PMML" version="1.4"/>
|
||||
<Timestamp>2017-11-06 15:15:48</Timestamp>
|
||||
</Header>
|
||||
<DataDictionary numberOfFields="6">
|
||||
<DataField name="survival" optype="continuous" dataType="double"/>
|
||||
<DataField name="Cancer_Stage" optype="continuous" dataType="double"/>
|
||||
<DataField name="Diagnosed_Age" optype="continuous" dataType="double"/>
|
||||
<DataField name="Diagnosed_Year" optype="continuous" dataType="double"/>
|
||||
<DataField name="Survival_Time" optype="continuous" dataType="double"/>
|
||||
<DataField name="Death_Indicator" optype="continuous" dataType="double"/>
|
||||
</DataDictionary>
|
||||
<GeneralRegressionModel modelType="CoxRegression" modelName="CoxPH_Survival_Regression_Model" functionName="regression" algorithmName="coxph" endTimeVariable="Survival_Time" statusVariable="Death_Indicator">
|
||||
<MiningSchema>
|
||||
<MiningField name="survival" usageType="predicted"/>
|
||||
<MiningField name="Cancer_Stage" usageType="active"/>
|
||||
<MiningField name="Diagnosed_Age" usageType="active"/>
|
||||
<MiningField name="Diagnosed_Year" usageType="active"/>
|
||||
<MiningField name="Survival_Time" usageType="active"/>
|
||||
<MiningField name="Death_Indicator" usageType="active"/>
|
||||
</MiningSchema>
|
||||
<Output>
|
||||
<OutputField name="Predicted_hazard" feature="predictedValue"/>
|
||||
<OutputField name="SurvivalProbability" feature="transformedValue">
|
||||
<Apply function="exp">
|
||||
<Apply function="*">
|
||||
<Constant>-1.0</Constant>
|
||||
<FieldRef field="Predicted_hazard"/>
|
||||
</Apply>
|
||||
</Apply>
|
||||
</OutputField>
|
||||
</Output>
|
||||
<ParameterList>
|
||||
<Parameter name="p0" label="Cancer_Stage" referencePoint="1.84722222222222"/>
|
||||
<Parameter name="p1" label="Diagnosed_Age" referencePoint="64.0555555555556"/>
|
||||
<Parameter name="p2" label="Diagnosed_Year" referencePoint="74.2083333333333"/>
|
||||
</ParameterList>
|
||||
<FactorList/>
|
||||
<CovariateList>
|
||||
<Predictor name="Cancer_Stage"/>
|
||||
<Predictor name="Diagnosed_Age"/>
|
||||
<Predictor name="Diagnosed_Year"/>
|
||||
</CovariateList>
|
||||
<PPMatrix>
|
||||
<PPCell value="1" predictorName="Cancer_Stage" parameterName="p0"/>
|
||||
<PPCell value="1" predictorName="Diagnosed_Age" parameterName="p1"/>
|
||||
<PPCell value="1" predictorName="Diagnosed_Year" parameterName="p2"/>
|
||||
</PPMatrix>
|
||||
<ParamMatrix>
|
||||
<PCell parameterName="p0" df="1" beta="0.694881782977505"/>
|
||||
<PCell parameterName="p1" df="1" beta="0.0305946726019501"/>
|
||||
<PCell parameterName="p2" df="1" beta="-0.0812507702344597"/>
|
||||
</ParamMatrix>
|
||||
<BaseCumHazardTables maxTime="10.7">
|
||||
<BaselineCell time="0.2" cumHazard="0.011064600982993"/>
|
||||
<BaselineCell time="0.3" cumHazard="0.0340168954955346"/>
|
||||
<BaselineCell time="0.5" cumHazard="0.0459073211308657"/>
|
||||
<BaselineCell time="0.6" cumHazard="0.0580616353015745"/>
|
||||
<BaselineCell time="0.7" cumHazard="0.0703222010559839"/>
|
||||
<BaselineCell time="0.8" cumHazard="0.0830194522871062"/>
|
||||
<BaselineCell time="1" cumHazard="0.0963824093902679"/>
|
||||
<BaselineCell time="1.3" cumHazard="0.123756914350011"/>
|
||||
<BaselineCell time="1.6" cumHazard="0.137761792152044"/>
|
||||
<BaselineCell time="1.8" cumHazard="0.167382620697763"/>
|
||||
<BaselineCell time="1.9" cumHazard="0.199233959231861"/>
|
||||
<BaselineCell time="2" cumHazard="0.216059581131259"/>
|
||||
<BaselineCell time="2.2" cumHazard="0.216059581131259"/>
|
||||
<BaselineCell time="2.4" cumHazard="0.233477247819676"/>
|
||||
<BaselineCell time="2.5" cumHazard="0.233477247819676"/>
|
||||
<BaselineCell time="2.6" cumHazard="0.233477247819676"/>
|
||||
<BaselineCell time="3.2" cumHazard="0.269655245122846"/>
|
||||
<BaselineCell time="3.3" cumHazard="0.288351591059325"/>
|
||||
<BaselineCell time="3.5" cumHazard="0.348300953406043"/>
|
||||
<BaselineCell time="3.6" cumHazard="0.369611235593527"/>
|
||||
<BaselineCell time="3.7" cumHazard="0.369611235593527"/>
|
||||
<BaselineCell time="4" cumHazard="0.440440182792452"/>
|
||||
<BaselineCell time="4.3" cumHazard="0.465366611919873"/>
|
||||
<BaselineCell time="4.5" cumHazard="0.465366611919873"/>
|
||||
<BaselineCell time="4.8" cumHazard="0.465366611919873"/>
|
||||
<BaselineCell time="5" cumHazard="0.49729184913079"/>
|
||||
<BaselineCell time="5.1" cumHazard="0.49729184913079"/>
|
||||
<BaselineCell time="5.3" cumHazard="0.537709476691464"/>
|
||||
<BaselineCell time="5.5" cumHazard="0.537709476691464"/>
|
||||
<BaselineCell time="5.9" cumHazard="0.537709476691464"/>
|
||||
<BaselineCell time="6" cumHazard="0.582631470557061"/>
|
||||
<BaselineCell time="6.1" cumHazard="0.582631470557061"/>
|
||||
<BaselineCell time="6.2" cumHazard="0.63110072592843"/>
|
||||
<BaselineCell time="6.3" cumHazard="0.685720574486457"/>
|
||||
<BaselineCell time="6.4" cumHazard="0.82739448530233"/>
|
||||
<BaselineCell time="6.5" cumHazard="0.915265960458558"/>
|
||||
<BaselineCell time="6.7" cumHazard="0.915265960458558"/>
|
||||
<BaselineCell time="7" cumHazard="1.02492204445785"/>
|
||||
<BaselineCell time="7.4" cumHazard="1.16063742021447"/>
|
||||
<BaselineCell time="7.5" cumHazard="1.16063742021447"/>
|
||||
<BaselineCell time="7.6" cumHazard="1.16063742021447"/>
|
||||
<BaselineCell time="8.1" cumHazard="1.16063742021447"/>
|
||||
<BaselineCell time="9.3" cumHazard="1.16063742021447"/>
|
||||
<BaselineCell time="9.6" cumHazard="1.16063742021447"/>
|
||||
<BaselineCell time="10.7" cumHazard="1.16063742021447"/>
|
||||
</BaseCumHazardTables>
|
||||
</GeneralRegressionModel>
|
||||
</PMML>
|
|
@ -0,0 +1,91 @@
|
|||
,Predicted_Survival
|
||||
1,0.0413984143214506
|
||||
2,0.063563438386851
|
||||
3,0.0938827267194137
|
||||
4,0.0767403077323243
|
||||
5,0.126480037449032
|
||||
6,0.0800114276478648
|
||||
7,0.234586610414816
|
||||
8,0.123512430886763
|
||||
9,0.131741194747617
|
||||
10,0.188377371462237
|
||||
11,0.21940056721906
|
||||
12,0.204626564346705
|
||||
13,0.514099361115534
|
||||
14,0.136635590282056
|
||||
15,0.251945025020722
|
||||
16,0.59970486004446
|
||||
17,0.335675166153858
|
||||
18,0.232527350279481
|
||||
19,0.166079477699248
|
||||
20,0.498625483935877
|
||||
21,0.45058335401818
|
||||
22,0.327904681190506
|
||||
23,0.81649609077527
|
||||
24,0.782512612394911
|
||||
25,0.81618662069386
|
||||
26,0.470567269740302
|
||||
27,0.61404574652093
|
||||
28,0.943280681630955
|
||||
29,0.934335618650197
|
||||
30,0.555420938597553
|
||||
31,0.934335618650197
|
||||
32,0.694656278463757
|
||||
33,1.02312265499513
|
||||
34,0.0244889928041727
|
||||
35,0.148104789048783
|
||||
36,0.218131654399915
|
||||
37,0.218351002217785
|
||||
38,0.208774684088725
|
||||
39,0.171415000135426
|
||||
40,0.392940223769918
|
||||
41,0.417734825783524
|
||||
42,1.06744841589773
|
||||
43,0.265497272449439
|
||||
44,0.446622626309968
|
||||
45,0.507377303134346
|
||||
46,1.13831431921278
|
||||
47,1.18065340104873
|
||||
48,0.926153531408113
|
||||
49,1.0151828665788
|
||||
50,1.52550832390297
|
||||
51,0.057208963824845
|
||||
52,0.08102763850946
|
||||
53,0.0838252031004886
|
||||
54,0.197260886413506
|
||||
55,0.3257241538825
|
||||
56,0.117117054166232
|
||||
57,0.2105474113675
|
||||
58,0.366610291433631
|
||||
59,0.656060616412734
|
||||
60,0.575655278592374
|
||||
61,0.321890114322944
|
||||
62,0.414146010618385
|
||||
63,1.32537161901597
|
||||
64,0.453881056703549
|
||||
65,0.951257819885282
|
||||
66,0.658950922181642
|
||||
67,0.867834572637509
|
||||
68,1.04704406817244
|
||||
69,0.604273713424696
|
||||
70,1.11423206452926
|
||||
71,2.19253044992211
|
||||
72,2.27025995002319
|
||||
73,2.13469952952753
|
||||
74,3.49076671997939
|
||||
75,4.37023751290381
|
||||
76,3.9038640530236
|
||||
77,2.25074829982746
|
||||
78,0
|
||||
79,0.162336622434891
|
||||
80,0.174407530216633
|
||||
81,0.329745675726396
|
||||
82,0.452506284439772
|
||||
83,0.169363540123067
|
||||
84,0.687527847659964
|
||||
85,0.969887059391167
|
||||
86,1.17529066923748
|
||||
87,1.03813579414045
|
||||
88,1.91317085291397
|
||||
89,3.08867906370727
|
||||
90,1.09878775032168
|
|
|
@ -0,0 +1,190 @@
|
|||
#region Copyright Syncfusion Inc. 2001-2018.
|
||||
// Copyright Syncfusion Inc. 2001-2018. All rights reserved.
|
||||
// Use of this code is subject to the terms of our license.
|
||||
// A copy of the current license can be obtained at any time by e-mailing
|
||||
// licensing@syncfusion.com. Any infringement will be prosecuted under
|
||||
// applicable laws.
|
||||
#endregion
|
||||
using Syncfusion.PMML;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
namespace LarynxCoxRegression
|
||||
{
|
||||
/// <summary>
|
||||
/// Console program to demonstrate PMML execution engine
|
||||
/// </summary>
|
||||
public class Program
|
||||
{
|
||||
//Create Table instance for input, output and R Result
|
||||
public Table inputTable = null;
|
||||
private Table outputTable = null;
|
||||
private Table rResults = null;
|
||||
|
||||
#if CONSOLE
|
||||
|
||||
private static void Main(string[] args)
|
||||
{
|
||||
//Create instance
|
||||
Program program = new Program();
|
||||
//Load input csv
|
||||
program.inputTable = new Table("../../Model/Larynx.csv", true, ',');
|
||||
//Invoke PredictResult
|
||||
program.outputTable = program.PredictResult(program.inputTable,
|
||||
"../../Model/Larynx.pmml");
|
||||
//Dispose the inputTable values
|
||||
program.inputTable.Dispose();
|
||||
//Compare predicted results of PMML execution engine with R Results
|
||||
program.ComparePredictedResultsWithR("../../Model/ROutput.csv");
|
||||
//Write the Result as CSV Table
|
||||
program.outputTable.WriteToCSV("../../Model/PredictedOutput.csv", true, ',');
|
||||
//Dispose the output Table
|
||||
program.outputTable.Dispose();
|
||||
//Display the result saved location
|
||||
Console.WriteLine("\nResult saved in : " + Path.GetFullPath("../../Model/PredictedOutput.csv"));
|
||||
Console.ReadKey();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#region PredictResult
|
||||
|
||||
/// <summary>
|
||||
/// Predicts the results for given PMML and CSV file and serialize the results in a CSV file
|
||||
/// </summary>
|
||||
public Table PredictResult(Table inputTable, string pmmlPath)
|
||||
{
|
||||
//Get PMML Evaluator instance
|
||||
PMMLEvaluator evaluator = new PMMLEvaluatorFactory().
|
||||
GetPMMLEvaluatorInstance(pmmlPath);
|
||||
|
||||
string[] predictedCategories = null;
|
||||
|
||||
//Predict the value for each record using the PMML Evaluator instance
|
||||
for (int i = 0; i < inputTable.RowCount; i++)
|
||||
{
|
||||
var larynx = GetDataObject(inputTable, i);
|
||||
|
||||
//Get result
|
||||
PredictedResult predictedResult = evaluator.GetResult(larynx, null);
|
||||
|
||||
if (i == 0)
|
||||
{
|
||||
//Get the predicted propability fields
|
||||
predictedCategories = predictedResult.GetPredictedCategories();
|
||||
//Initialize the output table
|
||||
InitializeTable(inputTable.RowCount, predictedResult.PredictedField, predictedCategories);
|
||||
}
|
||||
|
||||
//Add predicted value
|
||||
outputTable[i, 0] = predictedResult.PredictedValue;
|
||||
//Add predicted Survival
|
||||
outputTable[i, 1] = predictedResult.GetPredictedProbability("survival");
|
||||
}
|
||||
return outputTable;
|
||||
}
|
||||
|
||||
#endregion PredictResult
|
||||
|
||||
#region Compare Predicted Results With R
|
||||
|
||||
/// <summary>
|
||||
/// Compare predicted results of PMML execution engine with R results
|
||||
/// </summary>
|
||||
|
||||
public void ComparePredictedResultsWithR(string rOutputDataCSVPath)
|
||||
{
|
||||
//Create instance to hold results of R
|
||||
rResults = new Table(rOutputDataCSVPath, true, ',');
|
||||
string differentIndices = string.Empty;
|
||||
//Pass the Table to the compare method of resultTable
|
||||
bool isDifferent = Compare(rResults, 1, 0, ref differentIndices);
|
||||
#if CONSOLE
|
||||
//Display mismatched index
|
||||
if (isDifferent)
|
||||
{
|
||||
Console.WriteLine("\nDifference in predicted results by R and PMML execution engine");
|
||||
Console.WriteLine("\nDifferent indices are " + differentIndices);
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("\nBoth predicted results by R and PMML execution engine are equal");
|
||||
}
|
||||
#endif
|
||||
//Dispose the R results Table
|
||||
rResults.Dispose();
|
||||
}
|
||||
|
||||
#endregion Compare Predicted Results With R
|
||||
|
||||
#region Initialize OutputTable
|
||||
|
||||
/// <summary>
|
||||
/// Initialize the outputTable
|
||||
/// </summary>
|
||||
/// <param name="rowCount">rowCount of output table</param>
|
||||
/// <param name="predictedfield">predictedfield name</param>
|
||||
/// <param name="predictedCategories">probableFields</param>
|
||||
private void InitializeTable(int rowCount, string predictedfield, string[] predictedCategories)
|
||||
{
|
||||
//Create instance to hold evaluated results
|
||||
outputTable = new Table(rowCount, predictedCategories.Length + 1);
|
||||
//Add predicted column names
|
||||
outputTable.ColumnNames[0] = "CumulativeHazard";
|
||||
outputTable.ColumnNames[1] = "Predicted_" + predictedfield;
|
||||
}
|
||||
|
||||
#endregion Initialize OutputTable
|
||||
|
||||
#region GetDataObject
|
||||
|
||||
/// <summary>
|
||||
/// Returns the row as anonymous object
|
||||
/// </summary>
|
||||
/// <param name="inputTable"> input Table values</param>
|
||||
/// <param name="row">input row</param>
|
||||
/// <returns>Anonymous object</returns>
|
||||
public Dictionary<string, object> GetDataObject(Table inputTable, int row)
|
||||
{
|
||||
Dictionary<string, object> larynx = new Dictionary<string, object>();
|
||||
for (int i = 0; i < inputTable.ColumnCount; i++)
|
||||
{
|
||||
larynx.Add(inputTable.ColumnNames[i], inputTable[row, inputTable.ColumnNames[i]]);
|
||||
}
|
||||
return larynx;
|
||||
}
|
||||
|
||||
#endregion GetDataObject
|
||||
|
||||
#region Compare
|
||||
|
||||
/// <summary>
|
||||
/// Compares the result of 2 Tables based on column index.
|
||||
/// </summary>
|
||||
/// <param name="rOutput">R output table</param>
|
||||
/// <param name="rColumnIndex">R's Column to be compared</param>
|
||||
/// <param name="predictedColumnIndex">predicted result's column index</param>
|
||||
/// <param name="differentIndices"> different indices</param>
|
||||
/// <returns>IsDifferent</returns>
|
||||
public bool Compare(Table table, int rColumnIndex, int predictedColumnIndex, ref string differentIndices)
|
||||
{
|
||||
bool isDifferent = false;
|
||||
//Compare predicted values
|
||||
for (int i = 0; i < table.RowCount; i++)
|
||||
{
|
||||
//Compare Results based on column index
|
||||
double predictedC = Math.Round(Convert.ToDouble(outputTable[i, predictedColumnIndex]), 2);
|
||||
double predictedR = Math.Round(Convert.ToDouble(table[i, rColumnIndex]), 2);
|
||||
if (predictedC != predictedR)
|
||||
{
|
||||
differentIndices += ", " + i;
|
||||
isDifferent = true;
|
||||
}
|
||||
}
|
||||
return isDifferent;
|
||||
}
|
||||
|
||||
#endregion Compare
|
||||
}
|
||||
}
|
|
@ -0,0 +1,73 @@
|
|||
# Copyright Syncfusion Inc. 2001 - 2016. All rights reserved.
|
||||
# Use of this code is subject to the terms of our license.
|
||||
# A copy of the current license can be obtained at any time by e-mailing
|
||||
# licensing@syncfusion.com. Any infringement will be prosecuted under
|
||||
# applicable laws.
|
||||
|
||||
|
||||
# If you are not familiar with R you can obtain a quick introduction by downloading
|
||||
# R Succinctly for free from Syncfusion - http://www.syncfusion.com/resources/techportal/ebooks/rsuccinctly
|
||||
# R Succinctly is also included with this installation and is available here
|
||||
# Installed Drive :\Program Files (x86)\Syncfusion\Essential Studio\XX.X.X.XX\Infrastructure\EBooks\R_Succintly.pdf OF R Succinctly
|
||||
# Uncomment below lines to install necessary packages if not installed already
|
||||
# install.packages("pmml")
|
||||
# install.packages("survival")
|
||||
|
||||
# Load below packages
|
||||
library(pmml)
|
||||
library(survival)
|
||||
|
||||
# Here we directly load the cancer dataset installed with the "survival" package.
|
||||
data(cancer)
|
||||
|
||||
# rename column names for lung dataset from survival package
|
||||
lungOriginal <- setNames(cancer, c("Code", "Survival_Time", "Censoring_Status", "Age", "Sex", "ECOG_Score", "Physician_Score", "Patient_Score",
|
||||
"Calories_Consumed", "Weight_Loss"))
|
||||
|
||||
# Omit rows with missing values
|
||||
lungOriginal = na.omit(lungOriginal)
|
||||
|
||||
# Code below demonstrates loading the same dataset from a CSV file shipped with our installer.
|
||||
# Please check installed samples (Data) location to set actual working directory
|
||||
# Uncomment below lines and comment out the code to read data from package.
|
||||
# setwd("C:/actual_data_location")
|
||||
# lung = read.csv("Lung.csv")
|
||||
|
||||
# Divide dataset for training and test
|
||||
trainData=lungOriginal[1:133,]
|
||||
testData=lungOriginal[134:167,]
|
||||
|
||||
# Applying Cox Regression Model to predict Survival
|
||||
lung_Cox = coxph(Surv(Survival_Time,Censoring_Status)~Code+Age+Sex+ECOG_Score+Physician_Score+Weight_Loss, trainData)
|
||||
summary(lung_Cox)
|
||||
|
||||
# Calculate Survival fit of the model
|
||||
survfit(lung_Cox, trainData)
|
||||
plot(survfit(lung_Cox))
|
||||
|
||||
# Display the predicted results
|
||||
# Predict "Survival" column for test data set
|
||||
lungTestPrediction = predict(lung_Cox, type = "expected",testData)
|
||||
# Display predicted values
|
||||
lungTestPrediction
|
||||
|
||||
|
||||
# The code below is used for evaluation purpose.
|
||||
# The model is applied for original lung data set and predicted results are saved in "ROutput.csv"
|
||||
# "ROutput.csv" file used for comparing the R results with PMML Evaluation engine results
|
||||
|
||||
# Applying Cox Regression model to entire dataset and save the results in a CSV file
|
||||
lungEntirePrediction = predict(lung_Cox, type = "expected", lungOriginal)
|
||||
|
||||
# PMML generation
|
||||
pmmlFile<-pmml(lung_Cox, data=lungOriginal)
|
||||
write(toString(pmmlFile), file="Lung.pmml")
|
||||
saveXML(pmmlFile, file="Lung.pmml")
|
||||
|
||||
# Save predicted value in a data frame
|
||||
result = data.frame(lungEntirePrediction)
|
||||
names(result) = c("Predicted_Survival")
|
||||
|
||||
# Write the results in a CSV file
|
||||
write.csv(result,"ROutput.csv",quote=F)
|
||||
|
|
@ -0,0 +1,168 @@
|
|||
Code,Survival_Time,Censoring_Status,Age,Sex,ECOG_Score,Physician_Score,Patient_Score,Calories_Consumed,Weight_Loss
|
||||
3,455,2,68,1,0,90,90,1225,15
|
||||
5,210,2,57,1,1,90,60,1150,11
|
||||
12,1022,1,74,1,1,50,80,513,0
|
||||
7,310,2,68,2,2,70,60,384,10
|
||||
11,361,2,71,2,2,60,80,538,1
|
||||
1,218,2,53,1,1,70,80,825,16
|
||||
7,166,2,61,1,2,70,70,271,34
|
||||
6,170,2,57,1,1,80,80,1025,27
|
||||
12,567,2,57,1,1,80,70,2600,60
|
||||
22,613,2,70,1,1,90,100,1150,-5
|
||||
16,707,2,63,1,2,50,70,1025,22
|
||||
1,61,2,56,2,2,60,60,238,10
|
||||
11,301,2,67,1,1,80,80,1025,17
|
||||
6,81,2,49,2,0,100,70,1175,-8
|
||||
15,371,2,58,1,0,90,100,975,13
|
||||
12,520,2,70,2,1,90,80,825,6
|
||||
4,574,2,60,1,0,100,100,1025,-13
|
||||
13,118,2,70,1,3,60,70,1075,20
|
||||
13,390,2,53,1,1,80,70,875,-7
|
||||
1,12,2,74,1,2,70,50,305,20
|
||||
12,473,2,69,2,1,90,90,1025,-1
|
||||
1,26,2,73,1,2,60,70,388,20
|
||||
16,107,2,60,2,2,50,60,925,-15
|
||||
12,53,2,61,1,2,70,100,1075,10
|
||||
22,814,2,65,1,2,70,60,513,28
|
||||
15,965,1,66,2,1,70,90,875,4
|
||||
1,93,2,74,1,2,50,40,1225,24
|
||||
1,731,2,64,2,1,80,100,1175,15
|
||||
5,460,2,70,1,1,80,60,975,10
|
||||
11,153,2,73,2,2,60,70,1075,11
|
||||
10,433,2,59,2,0,90,90,363,27
|
||||
7,583,2,68,1,1,60,70,1025,7
|
||||
7,95,2,76,2,2,60,60,625,-24
|
||||
1,303,2,74,1,0,90,70,463,30
|
||||
3,519,2,63,1,1,80,70,1025,10
|
||||
13,643,2,74,1,0,90,90,1425,2
|
||||
22,765,2,50,2,1,90,100,1175,4
|
||||
21,53,2,68,1,0,90,100,1025,0
|
||||
1,246,2,58,1,0,100,90,1175,7
|
||||
6,689,2,59,1,1,90,80,1300,15
|
||||
5,5,2,65,2,0,100,80,338,5
|
||||
3,687,2,58,2,1,80,80,1225,10
|
||||
1,345,2,64,2,1,90,80,1075,-3
|
||||
22,444,2,75,2,2,70,70,438,8
|
||||
12,223,2,48,1,1,90,80,1300,68
|
||||
11,60,2,65,2,1,90,80,1025,0
|
||||
3,163,2,69,1,1,80,60,1125,0
|
||||
3,65,2,68,1,2,70,50,825,8
|
||||
5,821,1,64,2,0,90,70,1025,3
|
||||
22,428,2,68,1,0,100,80,1039,0
|
||||
6,230,2,67,1,1,80,100,488,23
|
||||
13,840,1,63,1,0,90,90,1175,-1
|
||||
3,305,2,48,2,1,80,90,538,29
|
||||
5,11,2,74,1,2,70,100,1175,0
|
||||
21,226,2,53,2,1,90,80,825,3
|
||||
12,426,2,71,2,1,90,90,1075,19
|
||||
1,705,2,51,2,0,100,80,1300,0
|
||||
6,363,2,56,2,1,80,70,1225,-2
|
||||
1,176,2,73,1,0,90,70,169,30
|
||||
4,791,2,59,1,0,100,80,768,5
|
||||
13,95,2,55,1,1,70,90,1500,15
|
||||
11,196,1,42,1,1,80,80,1425,8
|
||||
21,167,2,44,2,1,80,90,588,-1
|
||||
16,806,1,44,1,1,80,80,1025,1
|
||||
6,284,2,71,1,1,80,90,1100,14
|
||||
22,641,2,62,2,1,80,80,1150,1
|
||||
21,147,2,61,1,0,100,90,1175,4
|
||||
13,740,1,44,2,1,90,80,588,39
|
||||
1,163,2,72,1,2,70,70,910,2
|
||||
11,655,2,63,1,0,100,90,975,-1
|
||||
5,88,2,66,1,1,90,80,875,8
|
||||
10,245,2,57,2,1,80,60,280,14
|
||||
12,30,2,72,1,2,80,60,288,7
|
||||
11,477,2,64,1,1,90,100,910,0
|
||||
1,559,1,58,2,0,100,100,710,15
|
||||
6,450,2,69,2,1,80,90,1175,3
|
||||
12,156,2,66,1,1,80,90,875,14
|
||||
26,529,1,54,2,1,80,100,975,-3
|
||||
21,429,2,55,1,1,100,80,975,5
|
||||
3,351,2,75,2,2,60,50,925,11
|
||||
13,15,2,69,1,0,90,70,575,10
|
||||
1,181,2,44,1,1,80,90,1175,5
|
||||
10,283,2,80,1,1,80,100,1030,6
|
||||
1,13,2,76,1,2,70,70,413,20
|
||||
3,212,2,49,1,2,70,60,675,20
|
||||
1,524,2,68,1,2,60,70,1300,30
|
||||
16,288,2,66,1,2,70,60,613,24
|
||||
15,363,2,80,1,1,80,90,346,11
|
||||
26,199,2,60,2,2,70,80,675,10
|
||||
3,550,2,69,2,1,70,80,910,0
|
||||
11,54,2,72,1,2,60,60,768,-3
|
||||
1,558,2,70,1,0,90,90,1025,17
|
||||
22,207,2,66,1,1,80,80,925,20
|
||||
7,92,2,50,1,1,80,60,1075,13
|
||||
12,60,2,64,1,1,80,90,993,0
|
||||
16,551,1,77,2,2,80,60,750,28
|
||||
4,293,2,59,2,1,80,80,925,52
|
||||
6,353,2,47,1,0,100,90,1225,5
|
||||
1,267,2,67,1,0,90,70,313,6
|
||||
22,511,1,74,2,2,60,40,96,37
|
||||
1,457,2,54,1,1,90,90,975,-5
|
||||
5,337,2,56,1,0,100,100,1500,15
|
||||
21,201,2,73,2,2,70,60,1225,-16
|
||||
3,404,1,74,1,1,80,70,413,38
|
||||
26,222,2,76,1,2,70,70,1500,8
|
||||
1,62,2,65,2,1,80,90,1075,0
|
||||
11,458,1,57,1,1,80,100,513,30
|
||||
16,353,2,71,1,0,100,80,775,2
|
||||
16,163,2,54,1,1,90,80,1225,13
|
||||
12,31,2,82,1,0,100,90,413,27
|
||||
13,229,2,70,1,1,70,60,1175,-2
|
||||
32,156,2,55,1,2,70,30,1025,10
|
||||
4,291,2,62,1,2,70,60,475,27
|
||||
12,179,2,63,1,1,80,70,538,-2
|
||||
1,376,1,56,2,1,80,90,825,17
|
||||
32,384,1,62,2,0,90,90,588,8
|
||||
10,268,2,44,2,1,90,100,2450,2
|
||||
11,292,1,69,1,2,60,70,2450,36
|
||||
6,142,2,63,1,1,90,80,875,2
|
||||
7,413,1,64,1,1,80,70,413,16
|
||||
16,266,1,57,2,0,90,90,1075,3
|
||||
21,320,2,46,1,0,100,100,860,4
|
||||
6,181,2,61,1,1,90,90,730,0
|
||||
12,285,2,65,1,0,100,90,1025,0
|
||||
13,301,1,61,1,1,90,100,825,2
|
||||
2,348,2,58,2,0,90,80,1225,10
|
||||
2,197,2,56,1,1,90,60,768,37
|
||||
16,382,1,43,2,0,100,90,338,6
|
||||
1,303,1,53,1,1,90,80,1225,12
|
||||
13,296,1,59,2,1,80,100,1025,0
|
||||
1,180,2,56,1,2,60,80,1225,-2
|
||||
1,145,2,53,2,1,80,90,588,13
|
||||
7,269,1,74,2,0,100,100,588,0
|
||||
13,300,1,60,1,0,100,100,975,5
|
||||
1,284,1,39,1,0,100,90,1225,-5
|
||||
12,292,1,51,2,0,90,80,1225,0
|
||||
12,332,1,45,2,0,90,100,975,5
|
||||
2,285,2,72,2,2,70,90,463,20
|
||||
3,259,1,58,1,0,90,80,1300,8
|
||||
15,110,2,64,1,1,80,60,1025,12
|
||||
22,286,2,53,1,0,90,90,1225,8
|
||||
16,270,2,72,1,1,80,90,488,14
|
||||
1,225,1,64,1,1,90,80,825,33
|
||||
22,269,2,71,1,1,90,90,1300,-2
|
||||
12,225,1,70,1,0,100,100,1175,6
|
||||
32,243,1,63,2,1,80,90,825,0
|
||||
1,276,1,52,2,0,100,80,975,0
|
||||
32,135,2,60,1,1,90,70,1275,0
|
||||
15,79,2,64,2,1,90,90,488,37
|
||||
22,59,2,73,1,1,60,60,2200,5
|
||||
32,240,1,63,2,0,90,100,1025,0
|
||||
3,202,1,50,2,0,100,100,635,1
|
||||
26,235,1,63,2,0,100,90,413,0
|
||||
13,239,2,50,2,2,60,60,1025,-3
|
||||
1,252,1,60,2,0,100,90,488,-2
|
||||
6,221,1,67,1,1,80,70,413,23
|
||||
15,185,1,69,1,1,90,70,1075,0
|
||||
11,222,1,65,1,1,90,70,1025,18
|
||||
21,183,2,76,1,2,80,60,825,7
|
||||
11,211,1,70,2,2,70,30,131,3
|
||||
2,175,1,57,2,0,80,80,725,11
|
||||
22,197,1,67,1,1,80,90,1500,2
|
||||
11,203,1,71,2,1,80,90,1025,0
|
||||
13,191,1,39,1,0,90,90,2350,-5
|
||||
32,105,1,75,2,2,60,70,1025,5
|
||||
6,174,1,66,1,1,90,100,1075,1
|
||||
22,177,1,58,2,1,80,90,1060,0
|
|
|
@ -0,0 +1,200 @@
|
|||
<?xml version="1.0"?>
|
||||
<PMML version="4.3" xmlns="http://www.dmg.org/PMML-4_3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.dmg.org/PMML-4_3 http://www.dmg.org/pmml/v4-3/pmml-4-3.xsd">
|
||||
<Header copyright="Copyright (c) 2017 Syncfusion" description="CoxPH Survival Regression Model">
|
||||
<Extension name="user" value="Syncfusion" extender="Rattle/PMML"/>
|
||||
<Application name="Rattle/PMML" version="1.4"/>
|
||||
<Timestamp>2017-11-14 10:22:57</Timestamp>
|
||||
</Header>
|
||||
<DataDictionary numberOfFields="9">
|
||||
<DataField name="survival" optype="continuous" dataType="double"/>
|
||||
<DataField name="Code" optype="continuous" dataType="double"/>
|
||||
<DataField name="Age" optype="continuous" dataType="double"/>
|
||||
<DataField name="Sex" optype="continuous" dataType="double"/>
|
||||
<DataField name="ECOG_Score" optype="continuous" dataType="double"/>
|
||||
<DataField name="Physician_Score" optype="continuous" dataType="double"/>
|
||||
<DataField name="Weight_Loss" optype="continuous" dataType="double"/>
|
||||
<DataField name="Survival_Time" optype="continuous" dataType="double"/>
|
||||
<DataField name="Censoring_Status" optype="continuous" dataType="double"/>
|
||||
</DataDictionary>
|
||||
<GeneralRegressionModel modelType="CoxRegression" modelName="CoxPH_Survival_Regression_Model" functionName="regression" algorithmName="coxph" endTimeVariable="Survival_Time" statusVariable="Censoring_Status">
|
||||
<MiningSchema>
|
||||
<MiningField name="survival" usageType="predicted"/>
|
||||
<MiningField name="Code" usageType="active"/>
|
||||
<MiningField name="Age" usageType="active"/>
|
||||
<MiningField name="Sex" usageType="active"/>
|
||||
<MiningField name="ECOG_Score" usageType="active"/>
|
||||
<MiningField name="Physician_Score" usageType="active"/>
|
||||
<MiningField name="Weight_Loss" usageType="active"/>
|
||||
<MiningField name="Survival_Time" usageType="active"/>
|
||||
<MiningField name="Censoring_Status" usageType="active"/>
|
||||
</MiningSchema>
|
||||
<Output>
|
||||
<OutputField name="Predicted_hazard" feature="predictedValue"/>
|
||||
<OutputField name="SurvivalProbability" feature="transformedValue">
|
||||
<Apply function="exp">
|
||||
<Apply function="*">
|
||||
<Constant>-1.0</Constant>
|
||||
<FieldRef field="Predicted_hazard"/>
|
||||
</Apply>
|
||||
</Apply>
|
||||
</OutputField>
|
||||
</Output>
|
||||
<ParameterList>
|
||||
<Parameter name="p0" label="Code" referencePoint="9.83458646616541"/>
|
||||
<Parameter name="p1" label="Age" referencePoint="62.796992481203"/>
|
||||
<Parameter name="p2" label="Sex" referencePoint="1.3609022556391"/>
|
||||
<Parameter name="p3" label="ECOG_Score" referencePoint="1.01503759398496"/>
|
||||
<Parameter name="p4" label="Physician_Score" referencePoint="81.1278195488722"/>
|
||||
<Parameter name="p5" label="Weight_Loss" referencePoint="10.6466165413534"/>
|
||||
</ParameterList>
|
||||
<FactorList/>
|
||||
<CovariateList>
|
||||
<Predictor name="Code"/>
|
||||
<Predictor name="Age"/>
|
||||
<Predictor name="Sex"/>
|
||||
<Predictor name="ECOG_Score"/>
|
||||
<Predictor name="Physician_Score"/>
|
||||
<Predictor name="Weight_Loss"/>
|
||||
</CovariateList>
|
||||
<PPMatrix>
|
||||
<PPCell value="1" predictorName="Code" parameterName="p0"/>
|
||||
<PPCell value="1" predictorName="Age" parameterName="p1"/>
|
||||
<PPCell value="1" predictorName="Sex" parameterName="p2"/>
|
||||
<PPCell value="1" predictorName="ECOG_Score" parameterName="p3"/>
|
||||
<PPCell value="1" predictorName="Physician_Score" parameterName="p4"/>
|
||||
<PPCell value="1" predictorName="Weight_Loss" parameterName="p5"/>
|
||||
</PPMatrix>
|
||||
<ParamMatrix>
|
||||
<PCell parameterName="p0" df="1" beta="-0.0418388759539228"/>
|
||||
<PCell parameterName="p1" df="1" beta="0.0151506027645405"/>
|
||||
<PCell parameterName="p2" df="1" beta="-0.529105395707073"/>
|
||||
<PCell parameterName="p3" df="1" beta="1.04077395751669"/>
|
||||
<PCell parameterName="p4" df="1" beta="0.0298514331081054"/>
|
||||
<PCell parameterName="p5" df="1" beta="-0.0153828533661669"/>
|
||||
</ParamMatrix>
|
||||
<BaseCumHazardTables maxTime="1022">
|
||||
<BaselineCell time="5" cumHazard="0.00612179523174694"/>
|
||||
<BaselineCell time="11" cumHazard="0.0122662073533502"/>
|
||||
<BaselineCell time="12" cumHazard="0.0185708326251288"/>
|
||||
<BaselineCell time="13" cumHazard="0.0250216418927638"/>
|
||||
<BaselineCell time="15" cumHazard="0.0316304013463081"/>
|
||||
<BaselineCell time="26" cumHazard="0.0382625245963313"/>
|
||||
<BaselineCell time="30" cumHazard="0.0450122298333848"/>
|
||||
<BaselineCell time="31" cumHazard="0.0519311375810725"/>
|
||||
<BaselineCell time="53" cumHazard="0.0659002108605696"/>
|
||||
<BaselineCell time="54" cumHazard="0.0729814526448227"/>
|
||||
<BaselineCell time="60" cumHazard="0.087452242853474"/>
|
||||
<BaselineCell time="61" cumHazard="0.0947799068669335"/>
|
||||
<BaselineCell time="62" cumHazard="0.102183247022985"/>
|
||||
<BaselineCell time="65" cumHazard="0.109652746970287"/>
|
||||
<BaselineCell time="81" cumHazard="0.117330455207463"/>
|
||||
<BaselineCell time="88" cumHazard="0.125040881321667"/>
|
||||
<BaselineCell time="92" cumHazard="0.132876890664382"/>
|
||||
<BaselineCell time="93" cumHazard="0.140776697736748"/>
|
||||
<BaselineCell time="95" cumHazard="0.156912919666665"/>
|
||||
<BaselineCell time="107" cumHazard="0.165135005932408"/>
|
||||
<BaselineCell time="118" cumHazard="0.173415808361066"/>
|
||||
<BaselineCell time="142" cumHazard="0.182002467670915"/>
|
||||
<BaselineCell time="145" cumHazard="0.190745961562171"/>
|
||||
<BaselineCell time="147" cumHazard="0.199552340946331"/>
|
||||
<BaselineCell time="153" cumHazard="0.20839762534678"/>
|
||||
<BaselineCell time="156" cumHazard="0.226350006096163"/>
|
||||
<BaselineCell time="163" cumHazard="0.254281801540146"/>
|
||||
<BaselineCell time="166" cumHazard="0.264049361385344"/>
|
||||
<BaselineCell time="167" cumHazard="0.273996822819139"/>
|
||||
<BaselineCell time="170" cumHazard="0.28398230782065"/>
|
||||
<BaselineCell time="176" cumHazard="0.294064783424328"/>
|
||||
<BaselineCell time="179" cumHazard="0.304217676122095"/>
|
||||
<BaselineCell time="180" cumHazard="0.314504493519846"/>
|
||||
<BaselineCell time="181" cumHazard="0.335896825966499"/>
|
||||
<BaselineCell time="196" cumHazard="0.335896825966499"/>
|
||||
<BaselineCell time="197" cumHazard="0.346999059668167"/>
|
||||
<BaselineCell time="199" cumHazard="0.358263417669808"/>
|
||||
<BaselineCell time="201" cumHazard="0.369617545116384"/>
|
||||
<BaselineCell time="207" cumHazard="0.38117796498054"/>
|
||||
<BaselineCell time="210" cumHazard="0.392823140738271"/>
|
||||
<BaselineCell time="212" cumHazard="0.404707999882245"/>
|
||||
<BaselineCell time="218" cumHazard="0.416921424153202"/>
|
||||
<BaselineCell time="222" cumHazard="0.429283129683928"/>
|
||||
<BaselineCell time="223" cumHazard="0.441888806660348"/>
|
||||
<BaselineCell time="226" cumHazard="0.454569472311198"/>
|
||||
<BaselineCell time="229" cumHazard="0.467340184576685"/>
|
||||
<BaselineCell time="230" cumHazard="0.480278517890627"/>
|
||||
<BaselineCell time="245" cumHazard="0.493419536225264"/>
|
||||
<BaselineCell time="246" cumHazard="0.506662599295223"/>
|
||||
<BaselineCell time="266" cumHazard="0.506662599295223"/>
|
||||
<BaselineCell time="267" cumHazard="0.520139367237353"/>
|
||||
<BaselineCell time="268" cumHazard="0.533783206166303"/>
|
||||
<BaselineCell time="269" cumHazard="0.533783206166303"/>
|
||||
<BaselineCell time="283" cumHazard="0.547705343549652"/>
|
||||
<BaselineCell time="284" cumHazard="0.561943640322498"/>
|
||||
<BaselineCell time="285" cumHazard="0.576483074944899"/>
|
||||
<BaselineCell time="288" cumHazard="0.591198460328917"/>
|
||||
<BaselineCell time="291" cumHazard="0.606268324369129"/>
|
||||
<BaselineCell time="292" cumHazard="0.606268324369129"/>
|
||||
<BaselineCell time="293" cumHazard="0.622214216607419"/>
|
||||
<BaselineCell time="296" cumHazard="0.622214216607419"/>
|
||||
<BaselineCell time="301" cumHazard="0.638443281012562"/>
|
||||
<BaselineCell time="303" cumHazard="0.655379470116313"/>
|
||||
<BaselineCell time="305" cumHazard="0.673094489230082"/>
|
||||
<BaselineCell time="310" cumHazard="0.690982024302407"/>
|
||||
<BaselineCell time="320" cumHazard="0.709449112571006"/>
|
||||
<BaselineCell time="337" cumHazard="0.728052910466884"/>
|
||||
<BaselineCell time="345" cumHazard="0.746924781052148"/>
|
||||
<BaselineCell time="348" cumHazard="0.766408242994568"/>
|
||||
<BaselineCell time="351" cumHazard="0.786052914385106"/>
|
||||
<BaselineCell time="353" cumHazard="0.826998143819714"/>
|
||||
<BaselineCell time="361" cumHazard="0.847946867542526"/>
|
||||
<BaselineCell time="363" cumHazard="0.891530741014319"/>
|
||||
<BaselineCell time="371" cumHazard="0.914083315764566"/>
|
||||
<BaselineCell time="376" cumHazard="0.914083315764566"/>
|
||||
<BaselineCell time="382" cumHazard="0.914083315764566"/>
|
||||
<BaselineCell time="384" cumHazard="0.914083315764566"/>
|
||||
<BaselineCell time="390" cumHazard="0.937479749113727"/>
|
||||
<BaselineCell time="404" cumHazard="0.937479749113727"/>
|
||||
<BaselineCell time="413" cumHazard="0.937479749113727"/>
|
||||
<BaselineCell time="426" cumHazard="0.962996176002771"/>
|
||||
<BaselineCell time="428" cumHazard="0.989066144048285"/>
|
||||
<BaselineCell time="429" cumHazard="1.01552681704631"/>
|
||||
<BaselineCell time="433" cumHazard="1.04290879821234"/>
|
||||
<BaselineCell time="444" cumHazard="1.0704685519575"/>
|
||||
<BaselineCell time="450" cumHazard="1.09886894225058"/>
|
||||
<BaselineCell time="455" cumHazard="1.12808641737452"/>
|
||||
<BaselineCell time="457" cumHazard="1.1579484377549"/>
|
||||
<BaselineCell time="458" cumHazard="1.1579484377549"/>
|
||||
<BaselineCell time="460" cumHazard="1.1910185055462"/>
|
||||
<BaselineCell time="473" cumHazard="1.22592250606013"/>
|
||||
<BaselineCell time="477" cumHazard="1.26221763501311"/>
|
||||
<BaselineCell time="511" cumHazard="1.26221763501311"/>
|
||||
<BaselineCell time="519" cumHazard="1.30178205853138"/>
|
||||
<BaselineCell time="520" cumHazard="1.34393777458808"/>
|
||||
<BaselineCell time="524" cumHazard="1.38795085416478"/>
|
||||
<BaselineCell time="529" cumHazard="1.38795085416478"/>
|
||||
<BaselineCell time="550" cumHazard="1.43730908176698"/>
|
||||
<BaselineCell time="551" cumHazard="1.43730908176698"/>
|
||||
<BaselineCell time="558" cumHazard="1.49291820068069"/>
|
||||
<BaselineCell time="559" cumHazard="1.49291820068069"/>
|
||||
<BaselineCell time="567" cumHazard="1.55304441209971"/>
|
||||
<BaselineCell time="574" cumHazard="1.61484702849068"/>
|
||||
<BaselineCell time="583" cumHazard="1.6820548427984"/>
|
||||
<BaselineCell time="613" cumHazard="1.7531683715569"/>
|
||||
<BaselineCell time="641" cumHazard="1.83167616289028"/>
|
||||
<BaselineCell time="643" cumHazard="1.9131758408741"/>
|
||||
<BaselineCell time="655" cumHazard="1.99923669726997"/>
|
||||
<BaselineCell time="687" cumHazard="2.09204527614673"/>
|
||||
<BaselineCell time="689" cumHazard="2.19278740791313"/>
|
||||
<BaselineCell time="705" cumHazard="2.31302940772115"/>
|
||||
<BaselineCell time="707" cumHazard="2.44297322373625"/>
|
||||
<BaselineCell time="731" cumHazard="2.58941650365254"/>
|
||||
<BaselineCell time="740" cumHazard="2.58941650365254"/>
|
||||
<BaselineCell time="765" cumHazard="2.77112643872556"/>
|
||||
<BaselineCell time="791" cumHazard="2.97106689196499"/>
|
||||
<BaselineCell time="806" cumHazard="2.97106689196499"/>
|
||||
<BaselineCell time="814" cumHazard="3.27847073247162"/>
|
||||
<BaselineCell time="821" cumHazard="3.27847073247162"/>
|
||||
<BaselineCell time="840" cumHazard="3.27847073247162"/>
|
||||
<BaselineCell time="965" cumHazard="3.27847073247162"/>
|
||||
<BaselineCell time="1022" cumHazard="3.27847073247162"/>
|
||||
</BaseCumHazardTables>
|
||||
</GeneralRegressionModel>
|
||||
</PMML>
|
|
@ -0,0 +1,168 @@
|
|||
,Predicted_Survival
|
||||
1,0.833362427562709
|
||||
2,0.680291287254311
|
||||
3,1.96674685401826
|
||||
4,1.21230286491656
|
||||
5,1.1221579436125
|
||||
6,0.409472407293856
|
||||
7,0.488901956170073
|
||||
8,0.273580158213002
|
||||
9,0.700635461724011
|
||||
10,2.32195343819874
|
||||
11,2.11818299238502
|
||||
12,0.132215390632006
|
||||
13,0.677124898175315
|
||||
14,0.0648464024277207
|
||||
15,0.362239459846654
|
||||
16,1.34535793562595
|
||||
17,2.10143691217473
|
||||
18,0.745950974382693
|
||||
19,1.07000687271421
|
||||
20,0.0667509921197825
|
||||
21,1.34619104428898
|
||||
22,0.10050253611696
|
||||
23,0.14241061474775
|
||||
24,0.14318845823438
|
||||
25,3.77620439046083
|
||||
26,1.54658803626236
|
||||
27,0.261907609032725
|
||||
28,2.42262758030904
|
||||
29,1.8923070940895
|
||||
30,0.243742284305849
|
||||
31,0.24568062279412
|
||||
32,1.37457562689535
|
||||
33,0.388993144361791
|
||||
34,0.457713560156248
|
||||
35,2.02252274089618
|
||||
36,1.24414326233436
|
||||
37,1.39051606003214
|
||||
38,0.0288749740145699
|
||||
39,0.533140383993218
|
||||
40,3.52988757740512
|
||||
41,0.00368088751348686
|
||||
42,1.77516833097477
|
||||
43,1.24238766446064
|
||||
44,1.14969472772888
|
||||
45,0.207300548715967
|
||||
46,0.0928079207595696
|
||||
47,0.504610442693701
|
||||
48,0.398102037293786
|
||||
49,1.48553703955551
|
||||
50,0.560186795747236
|
||||
51,0.572542142740428
|
||||
52,1.88995222023265
|
||||
53,0.366448701360909
|
||||
54,0.0507304653297945
|
||||
55,0.25276124417601
|
||||
56,0.801335017191294
|
||||
57,1.43622469673094
|
||||
58,0.778578164610528
|
||||
59,0.202285214493102
|
||||
60,2.88712232132651
|
||||
61,0.0976393212483133
|
||||
62,0.280145066067966
|
||||
63,0.104885864714312
|
||||
64,2.30760785043994
|
||||
65,0.817433713726846
|
||||
66,0.856495681014958
|
||||
67,0.0996674245148872
|
||||
68,1.00914154266967
|
||||
69,1.16959195539668
|
||||
70,1.68899219074133
|
||||
71,0.2599024328793
|
||||
72,0.289327340959265
|
||||
73,0.163085362437096
|
||||
74,2.23952577400487
|
||||
75,0.81832474901056
|
||||
76,1.08204682615918
|
||||
77,0.237475506085516
|
||||
78,0.517193631206625
|
||||
79,1.29131014975902
|
||||
80,1.32438021211953
|
||||
81,0.0168606993317044
|
||||
82,0.459503283358091
|
||||
83,0.873552692090196
|
||||
84,0.0927047100187748
|
||||
85,0.916076564630023
|
||||
86,2.89782055410859
|
||||
87,0.945023069480112
|
||||
88,1.06812737252039
|
||||
89,0.25146109071847
|
||||
90,1.24669564790724
|
||||
91,0.177005997414677
|
||||
92,1.19857886232656
|
||||
93,0.239981652160919
|
||||
94,0.13694407618056
|
||||
95,0.110402587941788
|
||||
96,2.02660990300682
|
||||
97,0.269419429529517
|
||||
98,0.616252402392682
|
||||
99,0.472605127101215
|
||||
100,0.63413242227739
|
||||
101,2.89747823224468
|
||||
102,0.555902914697283
|
||||
103,0.580909490093061
|
||||
104,1.11849953662747
|
||||
105,0.672106744026599
|
||||
106,0.122251611478541
|
||||
107,0.864148744907534
|
||||
108,0.610959633475058
|
||||
109,0.257536005995683
|
||||
110,0.0364735669051091
|
||||
111,0.474098109366685
|
||||
112,0.194497901986123
|
||||
113,1.43898859595578
|
||||
114,0.39009851729903
|
||||
115,0.734633223866461
|
||||
116,0.12023592753373
|
||||
117,0.416688703025865
|
||||
118,0.771176952938904
|
||||
119,0.380198030393139
|
||||
120,1.14059417214419
|
||||
121,0.130316058452786
|
||||
122,0.28230613171444
|
||||
123,0.702005018184694
|
||||
124,0.474087552741845
|
||||
125,0.965389364683294
|
||||
126,0.322804635277047
|
||||
127,0.449841586450165
|
||||
128,0.244764488290135
|
||||
129,1.24357581945618
|
||||
130,0.411425465256099
|
||||
131,0.8956707742426
|
||||
132,0.155784203837248
|
||||
133,0.365358922083552
|
||||
134,0.42124908544241
|
||||
135,0.533294511122305
|
||||
136,0.176274164553509
|
||||
137,0.174406495609966
|
||||
138,1.13578287825244
|
||||
139,0.358242394800619
|
||||
140,0.152886102417922
|
||||
141,0.170650714852167
|
||||
142,0.518800737197246
|
||||
143,0.717093914038953
|
||||
144,0.68538176203555
|
||||
145,0.357437388413354
|
||||
146,0.152379388851156
|
||||
147,0.336500694673127
|
||||
148,0.120285412325016
|
||||
149,0.0548765428298389
|
||||
150,0.0354197579465406
|
||||
151,0.0725382322258808
|
||||
152,0.204735199890861
|
||||
153,0.125670242177555
|
||||
154,0.452255847047187
|
||||
155,0.371826097155953
|
||||
156,0.497013871424965
|
||||
157,0.54380759081805
|
||||
158,0.586263796564396
|
||||
159,0.887311502678562
|
||||
160,0.669243772289506
|
||||
161,0.0860730596497853
|
||||
162,0.2925571811692
|
||||
163,0.31871498372571
|
||||
164,0.143150348954916
|
||||
165,0.0861712392396216
|
||||
166,0.630440389071261
|
||||
167,0.131425880941663
|
|
|
@ -0,0 +1,190 @@
|
|||
#region Copyright Syncfusion Inc. 2001-2018.
|
||||
// Copyright Syncfusion Inc. 2001-2018. All rights reserved.
|
||||
// Use of this code is subject to the terms of our license.
|
||||
// A copy of the current license can be obtained at any time by e-mailing
|
||||
// licensing@syncfusion.com. Any infringement will be prosecuted under
|
||||
// applicable laws.
|
||||
#endregion
|
||||
using Syncfusion.PMML;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
namespace LungCoxRegression
|
||||
{
|
||||
/// <summary>
|
||||
/// Console program to demonstrate PMML execution engine
|
||||
/// </summary>
|
||||
public class Program
|
||||
{
|
||||
//Create Table instance for input, output and R Result
|
||||
public Table inputTable = null;
|
||||
private Table outputTable = null;
|
||||
private Table rResults = null;
|
||||
|
||||
#if CONSOLE
|
||||
|
||||
private static void Main(string[] args)
|
||||
{
|
||||
//Create instance
|
||||
Program program = new Program();
|
||||
//Load input csv
|
||||
program.inputTable = new Table("../../Model/Lung.csv", true, ',');
|
||||
//Invoke PredictResult
|
||||
program.outputTable = program.PredictResult(program.inputTable,
|
||||
"../../Model/Lung.pmml");
|
||||
//Dispose the inputTable values
|
||||
program.inputTable.Dispose();
|
||||
//Compare predicted results of PMML execution engine with R Results
|
||||
program.ComparePredictedResultsWithR("../../Model/ROutput.csv");
|
||||
//Write the Result as CSV Table
|
||||
program.outputTable.WriteToCSV("../../Model/PredictedOutput.csv", true, ',');
|
||||
//Dispose the output Table
|
||||
program.outputTable.Dispose();
|
||||
//Display the result saved location
|
||||
Console.WriteLine("\nResult saved in : " + Path.GetFullPath("../../Model/PredictedOutput.csv"));
|
||||
Console.ReadKey();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#region PredictResult
|
||||
|
||||
/// <summary>
|
||||
/// Predicts the results for given PMML and CSV file and serialize the results in a CSV file
|
||||
/// </summary>
|
||||
public Table PredictResult(Table inputTable, string pmmlPath)
|
||||
{
|
||||
//Get PMML Evaluator instance
|
||||
PMMLEvaluator evaluator = new PMMLEvaluatorFactory().
|
||||
GetPMMLEvaluatorInstance(pmmlPath);
|
||||
|
||||
string[] predictedCategories = null;
|
||||
|
||||
//Predict the value for each record using the PMML Evaluator instance
|
||||
for (int i = 0; i < inputTable.RowCount; i++)
|
||||
{
|
||||
var lung = GetDataObject(inputTable, i);
|
||||
|
||||
//Get result
|
||||
PredictedResult predictedResult = evaluator.GetResult(lung, null);
|
||||
|
||||
if (i == 0)
|
||||
{
|
||||
//Get the predicted propability fields
|
||||
predictedCategories = predictedResult.GetPredictedCategories();
|
||||
//Initialize the output table
|
||||
InitializeTable(inputTable.RowCount, predictedResult.PredictedField, predictedCategories);
|
||||
}
|
||||
|
||||
//Add predicted value
|
||||
outputTable[i, 0] = predictedResult.PredictedValue;
|
||||
//Add predicted Survival
|
||||
outputTable[i, 1] = predictedResult.GetPredictedProbability("survival");
|
||||
}
|
||||
return outputTable;
|
||||
}
|
||||
|
||||
#endregion PredictResult
|
||||
|
||||
#region Compare Predicted Results With R
|
||||
|
||||
/// <summary>
|
||||
/// Compare predicted results of PMML execution engine with R results
|
||||
/// </summary>
|
||||
|
||||
public void ComparePredictedResultsWithR(string rOutputDataCSVPath)
|
||||
{
|
||||
//Create instance to hold results of R
|
||||
rResults = new Table(rOutputDataCSVPath, true, ',');
|
||||
string differentIndices = string.Empty;
|
||||
//Pass the Table to the compare method of resultTable
|
||||
bool isDifferent = Compare(rResults, 1, 0, ref differentIndices);
|
||||
#if CONSOLE
|
||||
//Display mismatched index
|
||||
if (isDifferent)
|
||||
{
|
||||
Console.WriteLine("\nDifference in predicted results by R and PMML execution engine");
|
||||
Console.WriteLine("\nDifferent indices are " + differentIndices);
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("\nBoth predicted results by R and PMML execution engine are equal");
|
||||
}
|
||||
#endif
|
||||
//Dispose the R results Table
|
||||
rResults.Dispose();
|
||||
}
|
||||
|
||||
#endregion Compare Predicted Results With R
|
||||
|
||||
#region Initialize OutputTable
|
||||
|
||||
/// <summary>
|
||||
/// Initialize the outputTable
|
||||
/// </summary>
|
||||
/// <param name="rowCount">rowCount of output table</param>
|
||||
/// <param name="predictedfield">predictedfield name</param>
|
||||
/// <param name="predictedCategories">probableFields</param>
|
||||
private void InitializeTable(int rowCount, string predictedfield, string[] predictedCategories)
|
||||
{
|
||||
//Create instance to hold evaluated results
|
||||
outputTable = new Table(rowCount, predictedCategories.Length + 1);
|
||||
//Add predicted column names
|
||||
outputTable.ColumnNames[0] = "CumulativeHazard";
|
||||
outputTable.ColumnNames[1] = "Predicted_" + predictedfield;
|
||||
}
|
||||
|
||||
#endregion Initialize OutputTable
|
||||
|
||||
#region GetDataObject
|
||||
|
||||
/// <summary>
|
||||
/// Returns the row as anonymous object
|
||||
/// </summary>
|
||||
/// <param name="inputTable"> input Table values</param>
|
||||
/// <param name="row">input row</param>
|
||||
/// <returns>Anonymous object</returns>
|
||||
public Dictionary<string, object> GetDataObject(Table inputTable, int row)
|
||||
{
|
||||
Dictionary<string, object> lung = new Dictionary<string, object>();
|
||||
for (int i = 0; i < inputTable.ColumnCount; i++)
|
||||
{
|
||||
lung.Add(inputTable.ColumnNames[i], inputTable[row, inputTable.ColumnNames[i]]);
|
||||
}
|
||||
return lung;
|
||||
}
|
||||
|
||||
#endregion GetDataObject
|
||||
|
||||
#region Compare
|
||||
|
||||
/// <summary>
|
||||
/// Compares the result of 2 Tables based on column index.
|
||||
/// </summary>
|
||||
/// <param name="rOutput">R output table</param>
|
||||
/// <param name="rColumnIndex">R's Column to be compared</param>
|
||||
/// <param name="predictedColumnIndex">predicted result's column index</param>
|
||||
/// <param name="differentIndices"> different indices</param>
|
||||
/// <returns>IsDifferent</returns>
|
||||
public bool Compare(Table table, int rColumnIndex, int predictedColumnIndex, ref string differentIndices)
|
||||
{
|
||||
bool isDifferent = false;
|
||||
//Compare predicted values
|
||||
for (int i = 0; i < table.RowCount; i++)
|
||||
{
|
||||
//Compare Results based on column index
|
||||
double predictedC = Math.Round(Convert.ToDouble(outputTable[i, predictedColumnIndex]), 2);
|
||||
double predictedR = Math.Round(Convert.ToDouble(table[i, rColumnIndex]), 2);
|
||||
if (predictedC != predictedR)
|
||||
{
|
||||
differentIndices += ", " + i;
|
||||
isDifferent = true;
|
||||
}
|
||||
}
|
||||
return isDifferent;
|
||||
}
|
||||
|
||||
#endregion Compare
|
||||
}
|
||||
}
|
|
@ -0,0 +1,72 @@
|
|||
# Copyright Syncfusion Inc. 2001 - 2016. All rights reserved.
|
||||
# Use of this code is subject to the terms of our license.
|
||||
# A copy of the current license can be obtained at any time by e-mailing
|
||||
# licensing@syncfusion.com. Any infringement will be prosecuted under
|
||||
# applicable laws.
|
||||
|
||||
|
||||
# If you are not familiar with R you can obtain a quick introduction by downloading
|
||||
# R Succinctly for free from Syncfusion - http://www.syncfusion.com/resources/techportal/ebooks/rsuccinctly
|
||||
# R Succinctly is also included with this installation and is available here
|
||||
# Installed Drive :\Program Files (x86)\Syncfusion\Essential Studio\XX.X.X.XX\Infrastructure\EBooks\R_Succintly.pdf OF R Succinctly
|
||||
# Uncomment below lines to install necessary packages if not installed already
|
||||
# install.packages("pmml")
|
||||
# install.packages("survival")
|
||||
|
||||
# Load below packages
|
||||
library(pmml)
|
||||
library(survival)
|
||||
|
||||
# Here we directly load the ovarian dataset installed with the "survival" package.
|
||||
data(ovarian)
|
||||
|
||||
# rename column names for ovarian dataset from survival package
|
||||
ovarianOriginal <- setNames(ovarian, c("Survival_Time", "Censoring_Status", "Age", "Residual_Disease_Present", "Treatment_Group", "ECOG_Score"))
|
||||
|
||||
# Omit rows with missing values
|
||||
ovarianOriginal = na.omit(ovarianOriginal)
|
||||
|
||||
# Code below demonstrates loading the same dataset from a CSV file shipped with our installer.
|
||||
# Please check installed samples (Data) location to set actual working directory
|
||||
# Uncomment below lines and comment out the code to read data from package.
|
||||
# setwd("C:/actual_data_location")
|
||||
# ovarian= read.csv("Ovarian.csv")
|
||||
|
||||
# Divide dataset for training and test
|
||||
trainData=ovarianOriginal[1:22,]
|
||||
testData=ovarianOriginal[23:26,]
|
||||
|
||||
# Applying Cox Regression Model to predict Survival
|
||||
ovarian_Cox = coxph(Surv(Survival_Time,Censoring_Status)~Age+Residual_Disease_Present+Treatment_Group+ECOG_Score, trainData)
|
||||
summary(ovarian_Cox)
|
||||
|
||||
# Calculate Survival fit of the model
|
||||
survfit(ovarian_Cox, trainData)
|
||||
plot(survfit(ovarian_Cox))
|
||||
|
||||
# Display the predicted results
|
||||
# Predict "Survival" column for test data set
|
||||
ovarianTestPrediction = predict(ovarian_Cox, type = "expected",testData)
|
||||
# Display predicted values
|
||||
ovarianTestPrediction
|
||||
|
||||
|
||||
# The code below is used for evaluation purpose.
|
||||
# The model is applied for original ovarian data set and predicted results are saved in "ROutput.csv"
|
||||
# "ROutput.csv" file used for comparing the R results with PMML Evaluation engine results
|
||||
|
||||
# Applying Cox Regression model to entire dataset and save the results in a CSV file
|
||||
ovarianEntirePrediction = predict(ovarian_Cox, type = "expected", ovarianOriginal)
|
||||
|
||||
# PMML generation
|
||||
pmmlFile<-pmml(ovarian_Cox, data=ovarianOriginal)
|
||||
write(toString(pmmlFile), file="Ovarian.pmml")
|
||||
saveXML(pmmlFile, file="Ovarian.pmml")
|
||||
|
||||
# Save predicted value in a data frame
|
||||
result = data.frame(ovarianEntirePrediction)
|
||||
names(result) = c("Predicted_Survival")
|
||||
|
||||
# Write the results in a CSV file
|
||||
write.csv(result,"ROutput.csv",quote=F)
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
Survival_Time,Censoring_Status,Age,Residual_Disease_Present,Treatment_Group,ECOG_Score
|
||||
59,1,72.3315,2,1,1
|
||||
115,1,74.4932,2,1,1
|
||||
156,1,66.4658,2,1,2
|
||||
421,0,53.3644,2,2,1
|
||||
431,1,50.3397,2,1,1
|
||||
448,0,56.4301,1,1,2
|
||||
464,1,56.937,2,2,2
|
||||
475,1,59.8548,2,2,2
|
||||
477,0,64.1753,2,1,1
|
||||
563,1,55.1781,1,2,2
|
||||
638,1,56.7562,1,1,2
|
||||
744,0,50.1096,1,2,1
|
||||
769,0,59.6301,2,2,2
|
||||
770,0,57.0521,2,2,1
|
||||
803,0,39.2712,1,1,1
|
||||
855,0,43.1233,1,1,2
|
||||
1040,0,38.8932,2,1,2
|
||||
1106,0,44.6,1,1,1
|
||||
1129,0,53.9068,1,2,1
|
||||
1206,0,44.2055,2,2,1
|
||||
1227,0,59.589,1,2,2
|
||||
268,1,74.5041,2,1,2
|
||||
329,1,43.137,2,1,1
|
||||
353,1,63.2192,1,2,2
|
||||
365,1,64.4247,2,2,1
|
||||
377,0,58.3096,1,2,1
|
|
|
@ -0,0 +1,88 @@
|
|||
<?xml version="1.0"?>
|
||||
<PMML version="4.3" xmlns="http://www.dmg.org/PMML-4_3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.dmg.org/PMML-4_3 http://www.dmg.org/pmml/v4-3/pmml-4-3.xsd">
|
||||
<Header copyright="Copyright (c) 2017 Syncfusion" description="CoxPH Survival Regression Model">
|
||||
<Extension name="user" value="Syncfusion" extender="Rattle/PMML"/>
|
||||
<Application name="Rattle/PMML" version="1.4"/>
|
||||
<Timestamp>2017-11-14 11:29:50</Timestamp>
|
||||
</Header>
|
||||
<DataDictionary numberOfFields="7">
|
||||
<DataField name="survival" optype="continuous" dataType="double"/>
|
||||
<DataField name="Age" optype="continuous" dataType="double"/>
|
||||
<DataField name="Residual_Disease_Present" optype="continuous" dataType="double"/>
|
||||
<DataField name="Treatment_Group" optype="continuous" dataType="double"/>
|
||||
<DataField name="ECOG_Score" optype="continuous" dataType="double"/>
|
||||
<DataField name="Survival_Time" optype="continuous" dataType="double"/>
|
||||
<DataField name="Censoring_Status" optype="continuous" dataType="double"/>
|
||||
</DataDictionary>
|
||||
<GeneralRegressionModel modelType="CoxRegression" modelName="CoxPH_Survival_Regression_Model" functionName="regression" algorithmName="coxph" endTimeVariable="Survival_Time" statusVariable="Censoring_Status">
|
||||
<MiningSchema>
|
||||
<MiningField name="survival" usageType="predicted"/>
|
||||
<MiningField name="Age" usageType="active"/>
|
||||
<MiningField name="Residual_Disease_Present" usageType="active"/>
|
||||
<MiningField name="Treatment_Group" usageType="active"/>
|
||||
<MiningField name="ECOG_Score" usageType="active"/>
|
||||
<MiningField name="Survival_Time" usageType="active"/>
|
||||
<MiningField name="Censoring_Status" usageType="active"/>
|
||||
</MiningSchema>
|
||||
<Output>
|
||||
<OutputField name="Predicted_hazard" feature="predictedValue"/>
|
||||
<OutputField name="SurvivalProbability" feature="transformedValue">
|
||||
<Apply function="exp">
|
||||
<Apply function="*">
|
||||
<Constant>-1.0</Constant>
|
||||
<FieldRef field="Predicted_hazard"/>
|
||||
</Apply>
|
||||
</Apply>
|
||||
</OutputField>
|
||||
</Output>
|
||||
<ParameterList>
|
||||
<Parameter name="p0" label="Age" referencePoint="55.9641363636364"/>
|
||||
<Parameter name="p1" label="Residual_Disease_Present" referencePoint="1.59090909090909"/>
|
||||
<Parameter name="p2" label="Treatment_Group" referencePoint="1.45454545454545"/>
|
||||
<Parameter name="p3" label="ECOG_Score" referencePoint="1.5"/>
|
||||
</ParameterList>
|
||||
<FactorList/>
|
||||
<CovariateList>
|
||||
<Predictor name="Age"/>
|
||||
<Predictor name="Residual_Disease_Present"/>
|
||||
<Predictor name="Treatment_Group"/>
|
||||
<Predictor name="ECOG_Score"/>
|
||||
</CovariateList>
|
||||
<PPMatrix>
|
||||
<PPCell value="1" predictorName="Age" parameterName="p0"/>
|
||||
<PPCell value="1" predictorName="Residual_Disease_Present" parameterName="p1"/>
|
||||
<PPCell value="1" predictorName="Treatment_Group" parameterName="p2"/>
|
||||
<PPCell value="1" predictorName="ECOG_Score" parameterName="p3"/>
|
||||
</PPMatrix>
|
||||
<ParamMatrix>
|
||||
<PCell parameterName="p0" df="1" beta="0.13198832717786"/>
|
||||
<PCell parameterName="p1" df="1" beta="0.918708396032957"/>
|
||||
<PCell parameterName="p2" df="1" beta="-1.0685803616818"/>
|
||||
<PCell parameterName="p3" df="1" beta="0.512312478684471"/>
|
||||
</ParamMatrix>
|
||||
<BaseCumHazardTables maxTime="1227">
|
||||
<BaselineCell time="59" cumHazard="0.00983893983939018"/>
|
||||
<BaselineCell time="115" cumHazard="0.0215011779612164"/>
|
||||
<BaselineCell time="156" cumHazard="0.0369786595063536"/>
|
||||
<BaselineCell time="268" cumHazard="0.0560695383647282"/>
|
||||
<BaselineCell time="421" cumHazard="0.0560695383647282"/>
|
||||
<BaselineCell time="431" cumHazard="0.116298679391451"/>
|
||||
<BaselineCell time="448" cumHazard="0.116298679391451"/>
|
||||
<BaselineCell time="464" cumHazard="0.185581114472328"/>
|
||||
<BaselineCell time="475" cumHazard="0.261113229024981"/>
|
||||
<BaselineCell time="477" cumHazard="0.261113229024981"/>
|
||||
<BaselineCell time="563" cumHazard="0.425883155322658"/>
|
||||
<BaselineCell time="638" cumHazard="0.601591646571988"/>
|
||||
<BaselineCell time="744" cumHazard="0.601591646571988"/>
|
||||
<BaselineCell time="769" cumHazard="0.601591646571988"/>
|
||||
<BaselineCell time="770" cumHazard="0.601591646571988"/>
|
||||
<BaselineCell time="803" cumHazard="0.601591646571988"/>
|
||||
<BaselineCell time="855" cumHazard="0.601591646571988"/>
|
||||
<BaselineCell time="1040" cumHazard="0.601591646571988"/>
|
||||
<BaselineCell time="1106" cumHazard="0.601591646571988"/>
|
||||
<BaselineCell time="1129" cumHazard="0.601591646571988"/>
|
||||
<BaselineCell time="1206" cumHazard="0.601591646571988"/>
|
||||
<BaselineCell time="1227" cumHazard="0.601591646571988"/>
|
||||
</BaseCumHazardTables>
|
||||
</GeneralRegressionModel>
|
||||
</PMML>
|
|
@ -0,0 +1,27 @@
|
|||
,Predicted_Survival
|
||||
1,0.156342055734891
|
||||
2,0.454466950981587
|
||||
3,0.452210523150144
|
||||
4,0.0250349993866925
|
||||
5,0.101412779837432
|
||||
6,0.150907174233733
|
||||
7,0.221634179365164
|
||||
8,0.458337495602544
|
||||
9,1.41393129091109
|
||||
10,0.160908918515834
|
||||
11,0.81494732888683
|
||||
12,0.0697527626800405
|
||||
13,1.0251280102745
|
||||
14,0.437026741111542
|
||||
15,0.0485694680775181
|
||||
16,0.13479293935532
|
||||
17,0.193276999723951
|
||||
18,0.0981340599455593
|
||||
19,0.115139346576043
|
||||
20,0.0801895447591575
|
||||
21,0.406848001730493
|
||||
22,1.98100842915993
|
||||
23,0.0188961418363998
|
||||
24,0.0612275634078533
|
||||
25,0.10778142312184
|
||||
26,0.0191878084504349
|
|
|
@ -0,0 +1,190 @@
|
|||
#region Copyright Syncfusion Inc. 2001-2018.
|
||||
// Copyright Syncfusion Inc. 2001-2018. All rights reserved.
|
||||
// Use of this code is subject to the terms of our license.
|
||||
// A copy of the current license can be obtained at any time by e-mailing
|
||||
// licensing@syncfusion.com. Any infringement will be prosecuted under
|
||||
// applicable laws.
|
||||
#endregion
|
||||
using Syncfusion.PMML;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
namespace OvarianCoxRegression
|
||||
{
|
||||
/// <summary>
|
||||
/// Console program to demonstrate PMML execution engine
|
||||
/// </summary>
|
||||
public class Program
|
||||
{
|
||||
//Create Table instance for input, output and R Result
|
||||
public Table inputTable = null;
|
||||
private Table outputTable = null;
|
||||
private Table rResults = null;
|
||||
|
||||
#if CONSOLE
|
||||
|
||||
private static void Main(string[] args)
|
||||
{
|
||||
//Create instance
|
||||
Program program = new Program();
|
||||
//Load input csv
|
||||
program.inputTable = new Table("../../Model/Ovarian.csv", true, ',');
|
||||
//Invoke PredictResult
|
||||
program.outputTable = program.PredictResult(program.inputTable,
|
||||
"../../Model/Ovarian.pmml");
|
||||
//Dispose the inputTable values
|
||||
program.inputTable.Dispose();
|
||||
//Compare predicted results of PMML execution engine with R Results
|
||||
program.ComparePredictedResultsWithR("../../Model/ROutput.csv");
|
||||
//Write the Result as CSV Table
|
||||
program.outputTable.WriteToCSV("../../Model/PredictedOutput.csv", true, ',');
|
||||
//Dispose the output Table
|
||||
program.outputTable.Dispose();
|
||||
//Display the result saved location
|
||||
Console.WriteLine("\nResult saved in : " + Path.GetFullPath("../../Model/PredictedOutput.csv"));
|
||||
Console.ReadKey();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#region PredictResult
|
||||
|
||||
/// <summary>
|
||||
/// Predicts the results for given PMML and CSV file and serialize the results in a CSV file
|
||||
/// </summary>
|
||||
public Table PredictResult(Table inputTable, string pmmlPath)
|
||||
{
|
||||
//Get PMML Evaluator instance
|
||||
PMMLEvaluator evaluator = new PMMLEvaluatorFactory().
|
||||
GetPMMLEvaluatorInstance(pmmlPath);
|
||||
|
||||
string[] predictedCategories = null;
|
||||
|
||||
//Predict the value for each record using the PMML Evaluator instance
|
||||
for (int i = 0; i < inputTable.RowCount; i++)
|
||||
{
|
||||
var ovarian = GetDataObject(inputTable, i);
|
||||
|
||||
//Get result
|
||||
PredictedResult predictedResult = evaluator.GetResult(ovarian, null);
|
||||
|
||||
if (i == 0)
|
||||
{
|
||||
//Get the predicted propability fields
|
||||
predictedCategories = predictedResult.GetPredictedCategories();
|
||||
//Initialize the output table
|
||||
InitializeTable(inputTable.RowCount, predictedResult.PredictedField, predictedCategories);
|
||||
}
|
||||
|
||||
//Add predicted value
|
||||
outputTable[i, 0] = predictedResult.PredictedValue;
|
||||
//Add predicted Survival
|
||||
outputTable[i, 1] = predictedResult.GetPredictedProbability("survival");
|
||||
}
|
||||
return outputTable;
|
||||
}
|
||||
|
||||
#endregion PredictResult
|
||||
|
||||
#region Compare Predicted Results With R
|
||||
|
||||
/// <summary>
|
||||
/// Compare predicted results of PMML execution engine with R results
|
||||
/// </summary>
|
||||
|
||||
public void ComparePredictedResultsWithR(string rOutputDataCSVPath)
|
||||
{
|
||||
//Create instance to hold results of R
|
||||
rResults = new Table(rOutputDataCSVPath, true, ',');
|
||||
string differentIndices = string.Empty;
|
||||
//Pass the Table to the compare method of resultTable
|
||||
bool isDifferent = Compare(rResults, 1, 0, ref differentIndices);
|
||||
#if CONSOLE
|
||||
//Display mismatched index
|
||||
if (isDifferent)
|
||||
{
|
||||
Console.WriteLine("\nDifference in predicted results by R and PMML execution engine");
|
||||
Console.WriteLine("\nDifferent indices are " + differentIndices);
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("\nBoth predicted results by R and PMML execution engine are equal");
|
||||
}
|
||||
#endif
|
||||
//Dispose the R results Table
|
||||
rResults.Dispose();
|
||||
}
|
||||
|
||||
#endregion Compare Predicted Results With R
|
||||
|
||||
#region Initialize OutputTable
|
||||
|
||||
/// <summary>
|
||||
/// Initialize the outputTable
|
||||
/// </summary>
|
||||
/// <param name="rowCount">rowCount of output table</param>
|
||||
/// <param name="predictedfield">predictedfield name</param>
|
||||
/// <param name="predictedCategories">probableFields</param>
|
||||
private void InitializeTable(int rowCount, string predictedfield, string[] predictedCategories)
|
||||
{
|
||||
//Create instance to hold evaluated results
|
||||
outputTable = new Table(rowCount, predictedCategories.Length + 1);
|
||||
//Add predicted column names
|
||||
outputTable.ColumnNames[0] = "CumulativeHazard";
|
||||
outputTable.ColumnNames[1] = "Predicted_" + predictedfield;
|
||||
}
|
||||
|
||||
#endregion Initialize OutputTable
|
||||
|
||||
#region GetDataObject
|
||||
|
||||
/// <summary>
|
||||
/// Returns the row as anonymous object
|
||||
/// </summary>
|
||||
/// <param name="inputTable"> input Table values</param>
|
||||
/// <param name="row">input row</param>
|
||||
/// <returns>Anonymous object</returns>
|
||||
public Dictionary<string, object> GetDataObject(Table inputTable, int row)
|
||||
{
|
||||
Dictionary<string, object> ovarian = new Dictionary<string, object>();
|
||||
for (int i = 0; i < inputTable.ColumnCount; i++)
|
||||
{
|
||||
ovarian.Add(inputTable.ColumnNames[i], inputTable[row, inputTable.ColumnNames[i]]);
|
||||
}
|
||||
return ovarian;
|
||||
}
|
||||
|
||||
#endregion GetDataObject
|
||||
|
||||
#region Compare
|
||||
|
||||
/// <summary>
|
||||
/// Compares the result of 2 Tables based on column index.
|
||||
/// </summary>
|
||||
/// <param name="rOutput">R output table</param>
|
||||
/// <param name="rColumnIndex">R's Column to be compared</param>
|
||||
/// <param name="predictedColumnIndex">predicted result's column index</param>
|
||||
/// <param name="differentIndices"> different indices</param>
|
||||
/// <returns>IsDifferent</returns>
|
||||
public bool Compare(Table table, int rColumnIndex, int predictedColumnIndex, ref string differentIndices)
|
||||
{
|
||||
bool isDifferent = false;
|
||||
//Compare predicted values
|
||||
for (int i = 0; i < table.RowCount; i++)
|
||||
{
|
||||
//Compare Results based on column index
|
||||
double predictedC = Math.Round(Convert.ToDouble(outputTable[i, predictedColumnIndex]), 2);
|
||||
double predictedR = Math.Round(Convert.ToDouble(table[i, rColumnIndex]), 2);
|
||||
if (predictedC != predictedR)
|
||||
{
|
||||
differentIndices += ", " + i;
|
||||
isDifferent = true;
|
||||
}
|
||||
}
|
||||
return isDifferent;
|
||||
}
|
||||
|
||||
#endregion Compare
|
||||
}
|
||||
}
|
|
@ -0,0 +1,301 @@
|
|||
,Predicted_Survival
|
||||
1,0.129130862864269
|
||||
2,0.00775619015268028
|
||||
3,0.0780696533573868
|
||||
4,0.106364937509885
|
||||
5,0.0792219673778014
|
||||
6,0.0670442716538348
|
||||
7,0.16529712229652
|
||||
8,0.0680338502018724
|
||||
9,0.0803912896407858
|
||||
10,0.10952801929115
|
||||
11,0.0815778711892937
|
||||
12,0.0690380350045321
|
||||
13,0.170212730092397
|
||||
14,0.082781966771692
|
||||
15,0.082781966771692
|
||||
16,0.131866465620601
|
||||
17,0.0135129599534762
|
||||
18,0.0322265390664596
|
||||
19,0.0672408720154404
|
||||
20,0.0650790854500634
|
||||
21,0.0347881134059486
|
||||
22,0.116139171414309
|
||||
23,0.0660396577002893
|
||||
24,0.0310964402891278
|
||||
25,0.117853394416266
|
||||
26,0.0877787171824442
|
||||
27,0.0877787171824442
|
||||
28,0.183150833403865
|
||||
29,0.089074337723249
|
||||
30,0.0680035458292448
|
||||
31,0.115761517244376
|
||||
32,0.06900728333706
|
||||
33,0.0903890817217623
|
||||
34,0.14398412120617
|
||||
35,0.0267313070697605
|
||||
36,0.0598929790729875
|
||||
37,0.191381086671862
|
||||
38,0.0640184986619778
|
||||
39,0.03570732149321
|
||||
40,0.0792557501107076
|
||||
41,0.0944508979931159
|
||||
42,0.0721082652362145
|
||||
43,0.150454339015573
|
||||
44,0.0958450004300767
|
||||
45,0.0958450004300767
|
||||
46,0.0321692184763457
|
||||
47,0.0605793730984978
|
||||
48,0.0550117526869157
|
||||
49,0.103748015256141
|
||||
50,0.0378626287454541
|
||||
51,0.0986952401968938
|
||||
52,0.0331258670793743
|
||||
53,0.100151989447546
|
||||
54,0.0847570113371708
|
||||
55,0.0562486411603539
|
||||
56,0.101630240427918
|
||||
57,0.0389885880510233
|
||||
58,0.212052121868227
|
||||
59,0.103130310505174
|
||||
60,0.0872775163519943
|
||||
61,0.140508489028919
|
||||
62,0.0683354826846299
|
||||
63,0.0683354826846299
|
||||
64,0.218358130399446
|
||||
65,0.0487285752040618
|
||||
66,0.069344119605673
|
||||
67,0.144686932152802
|
||||
68,0.0290074283024031
|
||||
69,0.0703676440843732
|
||||
70,0.224851667087636
|
||||
71,0.109355294538218
|
||||
72,0.0879693371287587
|
||||
73,0.00899220750137547
|
||||
74,0.00878922810792883
|
||||
75,0.0132638255571686
|
||||
76,0.231538308647369
|
||||
77,0.013459600631049
|
||||
78,0.0952977425599237
|
||||
79,0.222569851471162
|
||||
80,0.0282324287330848
|
||||
81,0.0746150613443663
|
||||
82,0.0434231259982761
|
||||
83,0.115956020930824
|
||||
84,0.0757163853239619
|
||||
85,0.157982703775321
|
||||
86,0.117667540617717
|
||||
87,0.111464554209327
|
||||
88,0.145707433860051
|
||||
89,0.119404322465342
|
||||
90,0.0429244627401229
|
||||
91,0.140916667480527
|
||||
92,0.0380268237101714
|
||||
93,0.121166739345113
|
||||
94,0.252815147044831
|
||||
95,0.0938697690797821
|
||||
96,0.104054974483815
|
||||
97,0.256546717840711
|
||||
98,0.0200706548552186
|
||||
99,0.124769997286031
|
||||
100,0.179057534876146
|
||||
101,0.126611611934192
|
||||
102,0.0870835859003722
|
||||
103,0.264175907198058
|
||||
104,0.128480408954606
|
||||
105,0.0461872100870427
|
||||
106,0.268075163677736
|
||||
107,0.130376789561156
|
||||
108,0.110335771579718
|
||||
109,0.139074415655747
|
||||
110,0.132301160889669
|
||||
111,0.0326875193908771
|
||||
112,0.27604718609499
|
||||
113,0.0876644668754184
|
||||
114,0.061602405382811
|
||||
115,0.0630693187000507
|
||||
116,0.136235534391383
|
||||
117,0.0336595812326886
|
||||
118,0.18561225109877
|
||||
119,0.105543800410072
|
||||
120,0.0706774811851155
|
||||
121,0.28845192492831
|
||||
122,0.140286908339252
|
||||
123,0.140286908339252
|
||||
124,0.292709497275773
|
||||
125,0.0929559268147093
|
||||
126,0.0929559268147093
|
||||
127,0.297029911714855
|
||||
128,0.144458762093941
|
||||
129,0.144458762093941
|
||||
130,0.0484858412830069
|
||||
131,0
|
||||
132,0.0175215642617918
|
||||
133,0.305862990774847
|
||||
134,0.076049773568129
|
||||
135,0.00881782218324816
|
||||
136,0.310377551778242
|
||||
137,0.115242577248764
|
||||
138,0.061603075992825
|
||||
139,0.186921406088197
|
||||
140,0.15317834688975
|
||||
141,0.15317834688975
|
||||
142,0.319607563117759
|
||||
143,0.155439270938394
|
||||
144,0.131545744840816
|
||||
145,0.324324995054151
|
||||
146,0.157733566397929
|
||||
147,0.157733566397929
|
||||
148,0.195321097668763
|
||||
149,0.160061725832918
|
||||
150,0.110090605735101
|
||||
151,0.218073921604415
|
||||
152,0.162424249078214
|
||||
153,0.162424249078214
|
||||
154,0.338899194913518
|
||||
155,0.16482164334627
|
||||
156,0.139485895095748
|
||||
157,0.140346731079226
|
||||
158,0.167254423336034
|
||||
159,0.167254423336034
|
||||
160,0.348977383217033
|
||||
161,0.11082495237163
|
||||
162,0.143633928309041
|
||||
163,0.354128315931537
|
||||
164,0.0880504639427954
|
||||
165,0.0313672063198435
|
||||
166,0.23465001979474
|
||||
167,0.174770339254434
|
||||
168,0.0281137712142752
|
||||
169,0.216417692712275
|
||||
170,0.0285287326153286
|
||||
171,0.121981471366151
|
||||
172,0.241628044884231
|
||||
173,0.179967661689281
|
||||
174,0.152303725829744
|
||||
175,0.00737193143484138
|
||||
176,0.182623998061577
|
||||
177,0.0255956766139773
|
||||
178,0.381046095433406
|
||||
179,0.185319542160731
|
||||
180,0.1568329358464
|
||||
181,0.139003491020852
|
||||
182,0.111606619737288
|
||||
183,0.0676035356967189
|
||||
184,0
|
||||
185,0.190830576917523
|
||||
186,0.161496835564594
|
||||
187,0.377179204240565
|
||||
188,0.0696139304481989
|
||||
189,0.10953022542002
|
||||
190,0.404046179970217
|
||||
191,0.0572684667690817
|
||||
192,0.128313182471456
|
||||
193,0.346984784556551
|
||||
194,0.199405934998728
|
||||
195,0.0914973936832841
|
||||
196,0.246923891946748
|
||||
197,0.024186168105129
|
||||
198,0.17124484483415
|
||||
199,0.193727719069571
|
||||
200,0.205335871073874
|
||||
201,0.0738158532718067
|
||||
202,0.428434558193908
|
||||
203,0.106525967907614
|
||||
204,0.176337326073845
|
||||
205,0.0344346295914365
|
||||
206,0.0862898992111148
|
||||
207,0.211442151658804
|
||||
208,0.44117535019937
|
||||
209,0.214563053896549
|
||||
210,0.163807543697385
|
||||
211,0.307919630855958
|
||||
212,0.217730020888655
|
||||
213,0.217730020888655
|
||||
214,0.102284405794011
|
||||
215,0.124969586393627
|
||||
216,0.151965307282007
|
||||
217,0.461000457190456
|
||||
218,0.224204878848716
|
||||
219,0.224204878848716
|
||||
220,0.467804858995678
|
||||
221,0.227514159910334
|
||||
222,0.173695028172253
|
||||
223,0.474709694288991
|
||||
224,0.185721981411515
|
||||
225,0.158794175836059
|
||||
226,0.481716445476316
|
||||
227,0.161137989947009
|
||||
228,0.198267362649689
|
||||
229,0.175727473410277
|
||||
230,0.134468696235026
|
||||
231,0.097021266687069
|
||||
232,0.496041734881766
|
||||
233,0.228529372793142
|
||||
234,0.204163439846729
|
||||
235,0.230968223056352
|
||||
236,0.125156262244552
|
||||
237,0.0880055603062924
|
||||
238,0.0610535015797334
|
||||
239,0.248421205668015
|
||||
240,0.162212842248389
|
||||
241,0.162672808654667
|
||||
242,0.173386309800671
|
||||
243,0.252087921555034
|
||||
244,0.445130918185109
|
||||
245,0.195296457691858
|
||||
246,0.216486821275057
|
||||
247,0.191875665368608
|
||||
248,0.259584515175216
|
||||
249,0.0528456205587091
|
||||
250,0.337357516181515
|
||||
251,0.0369190844735893
|
||||
252,0.0103812342369235
|
||||
253,0.358887550093355
|
||||
254,0.267304042585955
|
||||
255,0.226215094606735
|
||||
256,0.125573106779902
|
||||
257,0.153423379591711
|
||||
258,0.0380169846483394
|
||||
259,0.565963689058754
|
||||
260,0.210141209577391
|
||||
261,0.0989502944664689
|
||||
262,0.574317356148352
|
||||
263,0.279315890575698
|
||||
264,0.165768118311378
|
||||
265,0.0937490100425212
|
||||
266,0.283438614361361
|
||||
267,0.283438614361361
|
||||
268,0.302347218391128
|
||||
269,0.147044803128305
|
||||
270,0.24341001453456
|
||||
271,0.0596222353944893
|
||||
272,0.1492151956046
|
||||
273,0.11196964869878
|
||||
274,0.418859332606962
|
||||
275,0.296175501978903
|
||||
276,0.250648544452186
|
||||
277,0.403520284837593
|
||||
278,0.300547074910978
|
||||
279,0.300547074910978
|
||||
280,0.627093320726364
|
||||
281,0.199146393847664
|
||||
282,0.117001231411197
|
||||
283,0.396357870242517
|
||||
284,0.126301248128893
|
||||
285,0.236275236415216
|
||||
286,0.645741829383252
|
||||
287,0.0775927119870348
|
||||
288,0.265777784143966
|
||||
289,0.620729519422357
|
||||
290,0.208095439988013
|
||||
291,0.318688208524698
|
||||
292,0.664944907613171
|
||||
293,0.116255681564532
|
||||
294,0.0588980411057102
|
||||
295,0.674759545015726
|
||||
296,0.32816536227374
|
||||
297,0.133924838604909
|
||||
298,0.447104434950747
|
||||
299,0.333009107976457
|
||||
300,0.281820230390173
|
|
|
@ -0,0 +1,71 @@
|
|||
# Copyright Syncfusion Inc. 2001 - 2016. All rights reserved.
|
||||
# Use of this code is subject to the terms of our license.
|
||||
# A copy of the current license can be obtained at any time by e-mailing
|
||||
# licensing@syncfusion.com. Any infringement will be prosecuted under
|
||||
# applicable laws.
|
||||
|
||||
|
||||
# If you are not familiar with R you can obtain a quick introduction by downloading
|
||||
# R Succinctly for free from Syncfusion - http://www.syncfusion.com/resources/techportal/ebooks/rsuccinctly
|
||||
# R Succinctly is also included with this installation and is available here
|
||||
# Installed Drive :\Program Files (x86)\Syncfusion\Essential Studio\XX.X.X.XX\Infrastructure\EBooks\R_Succintly.pdf OF R Succinctly
|
||||
# Uncomment below lines to install necessary packages if not installed already
|
||||
# install.packages("pmml")
|
||||
# install.packages("survival")
|
||||
|
||||
# Load below packages
|
||||
library(pmml)
|
||||
library(survival)
|
||||
|
||||
# Here we directly load the rsts dataset installed with the "survival" package.
|
||||
data(rats)
|
||||
|
||||
# rename column names for rats dataset from survival package
|
||||
ratsOriginal <- setNames(rats, c("Litter_Number", "Treatment", "Survival_Time", "Tumor_Status", "Sex"))
|
||||
|
||||
# Omit rows with missing values
|
||||
ratsOriginal = na.omit(ratsOriginal)
|
||||
|
||||
# Code below demonstrates loading the same dataset from a CSV file shipped with our installer.
|
||||
# Please check installed samples (Data) location to set actual working directory
|
||||
# Uncomment below lines and comment out the code to read data from package.
|
||||
# setwd("C:/actual_data_location")
|
||||
# rats= read.csv("Rats.csv")
|
||||
|
||||
# Divide dataset for training and test
|
||||
trainData=ratsOriginal[1:250,]
|
||||
testData=ratsOriginal[251:300,]
|
||||
|
||||
# Applying Cox Regression Model to predict Survival
|
||||
rats_Cox = coxph(Surv(Survival_Time,Tumor_Status)~Litter_Number+Treatment, trainData)
|
||||
summary(rats_Cox)
|
||||
|
||||
# Calculate Survival fit of the model
|
||||
survfit(rats_Cox, trainData)
|
||||
plot(survfit(rats_Cox))
|
||||
|
||||
# Display the predicted results
|
||||
# Predict "Survival" column for test data set
|
||||
ratsTestPrediction = predict(rats_Cox, type = "expected",testData)
|
||||
# Display predicted values
|
||||
ratsTestPrediction
|
||||
|
||||
# PMML generation
|
||||
pmmlFile<-pmml(rats_Cox, data=trainData)
|
||||
write(toString(pmmlFile), file="Rats.pmml")
|
||||
saveXML(pmmlFile, file="Rats.pmml")
|
||||
|
||||
# The code below is used for evaluation purpose.
|
||||
# The model is applied for original rats data set and predicted results are saved in "ROutput.csv"
|
||||
# "ROutput.csv" file used for comparing the R results with PMML Evaluation engine results
|
||||
|
||||
# Applying Cox Regression model to entire dataset and save the results in a CSV file
|
||||
ratsEntirePrediction = predict(rats_Cox, type = "expected", ratsOriginal)
|
||||
|
||||
# Save predicted value in a data frame
|
||||
result = data.frame(ratsEntirePrediction)
|
||||
names(result) = c("Predicted_Survival")
|
||||
|
||||
# Write the results in a CSV file
|
||||
write.csv(result,"ROutput.csv",quote=F)
|
||||
|
|
@ -0,0 +1,301 @@
|
|||
Litter_Number,Treatment,Survival_Time,Tumor_Status,Sex
|
||||
1,1,101,0,f
|
||||
1,0,49,1,f
|
||||
1,0,104,0,f
|
||||
2,1,91,0,m
|
||||
2,0,104,0,m
|
||||
2,0,102,0,m
|
||||
3,1,104,0,f
|
||||
3,0,102,0,f
|
||||
3,0,104,0,f
|
||||
4,1,91,0,m
|
||||
4,0,104,0,m
|
||||
4,0,102,0,m
|
||||
5,1,104,0,f
|
||||
5,0,104,0,f
|
||||
5,0,104,0,f
|
||||
6,1,98,0,m
|
||||
6,0,62,0,m
|
||||
6,0,77,0,m
|
||||
7,1,77,0,f
|
||||
7,0,97,0,f
|
||||
7,0,79,0,f
|
||||
8,1,91,0,m
|
||||
8,0,98,0,m
|
||||
8,0,76,0,m
|
||||
9,1,89,0,f
|
||||
9,0,104,0,f
|
||||
9,0,104,0,f
|
||||
10,1,104,0,m
|
||||
10,0,104,0,m
|
||||
10,0,98,0,m
|
||||
11,1,88,1,f
|
||||
11,0,96,1,f
|
||||
11,0,104,0,f
|
||||
12,1,96,0,m
|
||||
12,0,71,0,m
|
||||
12,0,91,0,m
|
||||
13,1,104,1,f
|
||||
13,0,94,0,f
|
||||
13,0,77,1,f
|
||||
14,1,79,0,m
|
||||
14,0,104,0,m
|
||||
14,0,99,0,m
|
||||
15,1,96,1,f
|
||||
15,0,104,0,f
|
||||
15,0,104,0,f
|
||||
16,1,61,0,m
|
||||
16,0,88,0,m
|
||||
16,0,85,0,m
|
||||
17,1,82,0,f
|
||||
17,0,77,0,f
|
||||
17,0,104,0,f
|
||||
18,1,63,0,m
|
||||
18,0,104,0,m
|
||||
18,0,102,0,m
|
||||
19,1,70,1,f
|
||||
19,0,104,0,f
|
||||
19,0,77,0,f
|
||||
20,1,104,0,m
|
||||
20,0,104,0,m
|
||||
20,0,102,0,m
|
||||
21,1,89,1,f
|
||||
21,0,91,0,f
|
||||
21,0,90,0,f
|
||||
22,1,104,0,m
|
||||
22,0,80,0,m
|
||||
22,0,92,0,m
|
||||
23,1,91,0,f
|
||||
23,0,70,0,f
|
||||
23,0,92,0,f
|
||||
24,1,104,0,m
|
||||
24,0,104,0,m
|
||||
24,0,101,0,m
|
||||
25,1,39,1,f
|
||||
25,0,45,0,f
|
||||
25,0,50,1,f
|
||||
26,1,104,0,m
|
||||
26,0,53,0,m
|
||||
26,0,102,0,m
|
||||
27,1,103,1,f
|
||||
27,0,69,0,f
|
||||
27,0,91,0,f
|
||||
28,1,65,0,m
|
||||
28,0,104,0,m
|
||||
28,0,91,0,m
|
||||
29,1,93,0,f
|
||||
29,0,104,0,f
|
||||
29,0,103,0,f
|
||||
30,1,86,0,m
|
||||
30,0,104,0,m
|
||||
30,0,75,0,m
|
||||
31,1,85,0,f
|
||||
31,0,72,0,f
|
||||
31,0,104,0,f
|
||||
32,1,104,0,m
|
||||
32,0,100,0,m
|
||||
32,0,102,0,m
|
||||
33,1,104,0,f
|
||||
33,0,63,0,f
|
||||
33,0,104,0,f
|
||||
34,1,95,0,m
|
||||
34,0,104,0,m
|
||||
34,0,95,0,m
|
||||
35,1,104,0,f
|
||||
35,0,104,0,f
|
||||
35,0,74,0,f
|
||||
36,1,104,0,m
|
||||
36,0,104,0,m
|
||||
36,0,102,0,m
|
||||
37,1,81,0,f
|
||||
37,0,104,0,f
|
||||
37,0,69,0,f
|
||||
38,1,104,0,m
|
||||
38,0,93,0,m
|
||||
38,0,80,0,m
|
||||
39,1,67,1,f
|
||||
39,0,104,0,f
|
||||
39,0,68,1,f
|
||||
40,1,92,0,m
|
||||
40,0,98,0,m
|
||||
40,0,83,0,m
|
||||
41,1,104,0,f
|
||||
41,0,104,0,f
|
||||
41,0,104,0,f
|
||||
42,1,104,0,m
|
||||
42,0,89,0,m
|
||||
42,0,89,0,m
|
||||
43,1,104,0,f
|
||||
43,0,104,0,f
|
||||
43,0,104,0,f
|
||||
44,1,63,0,m
|
||||
44,0,32,0,m
|
||||
44,0,51,0,m
|
||||
45,1,104,0,f
|
||||
45,0,83,0,f
|
||||
45,0,40,1,f
|
||||
46,1,104,0,m
|
||||
46,0,98,0,m
|
||||
46,0,78,0,m
|
||||
47,1,87,0,f
|
||||
47,0,104,0,f
|
||||
47,0,104,0,f
|
||||
48,1,104,0,m
|
||||
48,0,104,0,m
|
||||
48,0,102,0,m
|
||||
49,1,104,0,f
|
||||
49,0,104,0,f
|
||||
49,0,104,0,f
|
||||
50,1,87,0,m
|
||||
50,0,104,0,m
|
||||
50,0,94,0,m
|
||||
51,1,89,0,f
|
||||
51,0,104,0,f
|
||||
51,0,104,0,f
|
||||
52,1,104,0,m
|
||||
52,0,104,0,m
|
||||
52,0,102,0,m
|
||||
53,1,78,0,f
|
||||
53,0,104,0,f
|
||||
53,0,104,0,f
|
||||
54,1,104,0,m
|
||||
54,0,91,0,m
|
||||
54,0,102,0,m
|
||||
55,1,104,0,f
|
||||
55,0,81,1,f
|
||||
55,0,64,1,f
|
||||
56,1,90,0,m
|
||||
56,0,104,0,m
|
||||
56,0,55,0,m
|
||||
57,1,86,1,f
|
||||
57,0,55,1,f
|
||||
57,0,94,0,f
|
||||
58,1,91,0,m
|
||||
58,0,104,0,m
|
||||
58,0,102,0,m
|
||||
59,1,34,1,f
|
||||
59,0,104,0,f
|
||||
59,0,54,1,f
|
||||
60,1,104,0,m
|
||||
60,0,104,0,m
|
||||
60,0,102,0,m
|
||||
61,1,76,0,f
|
||||
61,0,87,0,f
|
||||
61,0,74,0,f
|
||||
62,1,23,0,m
|
||||
62,0,104,0,m
|
||||
62,0,102,0,m
|
||||
63,1,103,1,f
|
||||
63,0,73,1,f
|
||||
63,0,84,1,f
|
||||
64,1,104,0,m
|
||||
64,0,71,1,m
|
||||
64,0,90,0,m
|
||||
65,1,102,1,f
|
||||
65,0,104,0,f
|
||||
65,0,80,0,f
|
||||
66,1,87,0,m
|
||||
66,0,51,0,m
|
||||
66,0,102,0,m
|
||||
67,1,80,1,f
|
||||
67,0,104,0,f
|
||||
67,0,73,0,f
|
||||
68,1,104,0,m
|
||||
68,0,83,0,m
|
||||
68,0,102,0,m
|
||||
69,1,45,1,f
|
||||
69,0,79,0,f
|
||||
69,0,104,0,f
|
||||
70,1,104,0,m
|
||||
70,0,104,0,m
|
||||
70,0,96,0,m
|
||||
71,1,94,1,f
|
||||
71,0,104,0,f
|
||||
71,0,104,0,f
|
||||
72,1,67,0,m
|
||||
72,0,84,0,m
|
||||
72,0,94,0,m
|
||||
73,1,104,0,f
|
||||
73,0,104,0,f
|
||||
73,0,104,0,f
|
||||
74,1,104,0,m
|
||||
74,0,104,0,m
|
||||
74,0,99,0,m
|
||||
75,1,104,0,f
|
||||
75,0,101,1,f
|
||||
75,0,94,0,f
|
||||
76,1,104,0,m
|
||||
76,0,94,0,m
|
||||
76,0,102,0,m
|
||||
77,1,76,0,f
|
||||
77,0,84,1,f
|
||||
77,0,78,1,f
|
||||
78,1,104,0,m
|
||||
78,0,103,0,m
|
||||
78,0,102,0,m
|
||||
79,1,80,1,f
|
||||
79,0,81,1,f
|
||||
79,0,76,0,f
|
||||
80,1,51,0,m
|
||||
80,0,104,0,m
|
||||
80,0,91,0,m
|
||||
81,1,72,1,f
|
||||
81,0,95,0,f
|
||||
81,0,104,0,f
|
||||
82,1,102,0,m
|
||||
82,0,98,0,m
|
||||
82,0,102,0,m
|
||||
83,1,73,1,f
|
||||
83,0,104,0,f
|
||||
83,0,66,1,f
|
||||
84,1,88,0,m
|
||||
84,0,54,0,m
|
||||
84,0,39,0,m
|
||||
85,1,92,1,f
|
||||
85,0,104,0,f
|
||||
85,0,102,1,f
|
||||
86,1,67,0,m
|
||||
86,0,84,0,m
|
||||
86,0,54,0,m
|
||||
87,1,104,0,f
|
||||
87,0,98,0,f
|
||||
87,0,73,0,f
|
||||
88,1,104,0,m
|
||||
88,0,104,0,m
|
||||
88,0,87,0,m
|
||||
89,1,55,0,f
|
||||
89,0,104,0,f
|
||||
89,0,104,0,f
|
||||
90,1,81,0,m
|
||||
90,0,82,0,m
|
||||
90,0,102,0,m
|
||||
91,1,49,0,f
|
||||
91,0,83,0,f
|
||||
91,0,77,0,f
|
||||
92,1,94,0,m
|
||||
92,0,104,0,m
|
||||
92,0,102,0,m
|
||||
93,1,89,1,f
|
||||
93,0,104,0,f
|
||||
93,0,104,0,f
|
||||
94,1,104,0,m
|
||||
94,0,89,0,m
|
||||
94,0,77,0,m
|
||||
95,1,88,0,f
|
||||
95,0,79,0,f
|
||||
95,0,99,0,f
|
||||
96,1,104,0,m
|
||||
96,0,69,0,m
|
||||
96,0,102,0,m
|
||||
97,1,103,1,f
|
||||
97,0,91,0,f
|
||||
97,0,104,0,f
|
||||
98,1,104,0,m
|
||||
98,0,75,1,m
|
||||
98,0,64,0,m
|
||||
99,1,104,0,f
|
||||
99,0,104,0,f
|
||||
99,0,79,1,f
|
||||
100,1,92,0,m
|
||||
100,0,104,0,m
|
||||
100,0,102,0,m
|
|
|
@ -0,0 +1,110 @@
|
|||
<?xml version="1.0"?>
|
||||
<PMML version="4.3" xmlns="http://www.dmg.org/PMML-4_3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.dmg.org/PMML-4_3 http://www.dmg.org/pmml/v4-3/pmml-4-3.xsd">
|
||||
<Header copyright="Copyright (c) 2017 Syncfusion" description="CoxPH Survival Regression Model">
|
||||
<Extension name="user" value="Syncfusion" extender="Rattle/PMML"/>
|
||||
<Application name="Rattle/PMML" version="1.4"/>
|
||||
<Timestamp>2017-11-14 12:13:29</Timestamp>
|
||||
</Header>
|
||||
<DataDictionary numberOfFields="5">
|
||||
<DataField name="survival" optype="continuous" dataType="double"/>
|
||||
<DataField name="Litter_Number" optype="continuous" dataType="double"/>
|
||||
<DataField name="Treatment" optype="continuous" dataType="double"/>
|
||||
<DataField name="Survival_Time" optype="continuous" dataType="double"/>
|
||||
<DataField name="Tumor_Status" optype="continuous" dataType="double"/>
|
||||
</DataDictionary>
|
||||
<GeneralRegressionModel modelType="CoxRegression" modelName="CoxPH_Survival_Regression_Model" functionName="regression" algorithmName="coxph" endTimeVariable="Survival_Time" statusVariable="Tumor_Status">
|
||||
<MiningSchema>
|
||||
<MiningField name="survival" usageType="predicted"/>
|
||||
<MiningField name="Litter_Number" usageType="active"/>
|
||||
<MiningField name="Treatment" usageType="active"/>
|
||||
<MiningField name="Survival_Time" usageType="active"/>
|
||||
<MiningField name="Tumor_Status" usageType="active"/>
|
||||
</MiningSchema>
|
||||
<Output>
|
||||
<OutputField name="Predicted_hazard" feature="predictedValue"/>
|
||||
<OutputField name="SurvivalProbability" feature="transformedValue">
|
||||
<Apply function="exp">
|
||||
<Apply function="*">
|
||||
<Constant>-1.0</Constant>
|
||||
<FieldRef field="Predicted_hazard"/>
|
||||
</Apply>
|
||||
</Apply>
|
||||
</OutputField>
|
||||
</Output>
|
||||
<ParameterList>
|
||||
<Parameter name="p0" label="Litter_Number" referencePoint="42.168"/>
|
||||
<Parameter name="p1" label="Treatment" referencePoint="0.336"/>
|
||||
</ParameterList>
|
||||
<FactorList/>
|
||||
<CovariateList>
|
||||
<Predictor name="Litter_Number"/>
|
||||
<Predictor name="Treatment"/>
|
||||
</CovariateList>
|
||||
<PPMatrix>
|
||||
<PPCell value="1" predictorName="Litter_Number" parameterName="p0"/>
|
||||
<PPCell value="1" predictorName="Treatment" parameterName="p1"/>
|
||||
</PPMatrix>
|
||||
<ParamMatrix>
|
||||
<PCell parameterName="p0" df="1" beta="0.0146522062718791"/>
|
||||
<PCell parameterName="p1" df="1" beta="0.720838763186183"/>
|
||||
</ParamMatrix>
|
||||
<BaseCumHazardTables maxTime="104">
|
||||
<BaselineCell time="23" cumHazard="0"/>
|
||||
<BaselineCell time="32" cumHazard="0"/>
|
||||
<BaselineCell time="34" cumHazard="0.00356946906801081"/>
|
||||
<BaselineCell time="39" cumHazard="0.0071654474420361"/>
|
||||
<BaselineCell time="40" cumHazard="0.0107777270860397"/>
|
||||
<BaselineCell time="45" cumHazard="0.0144007140873204"/>
|
||||
<BaselineCell time="49" cumHazard="0.0180635321259293"/>
|
||||
<BaselineCell time="50" cumHazard="0.0217321199549444"/>
|
||||
<BaselineCell time="51" cumHazard="0.0217321199549444"/>
|
||||
<BaselineCell time="53" cumHazard="0.0217321199549444"/>
|
||||
<BaselineCell time="54" cumHazard="0.0254826886058197"/>
|
||||
<BaselineCell time="55" cumHazard="0.0292474398212378"/>
|
||||
<BaselineCell time="61" cumHazard="0.0292474398212378"/>
|
||||
<BaselineCell time="62" cumHazard="0.0292474398212378"/>
|
||||
<BaselineCell time="63" cumHazard="0.0292474398212378"/>
|
||||
<BaselineCell time="64" cumHazard="0.0331137192709799"/>
|
||||
<BaselineCell time="65" cumHazard="0.0331137192709799"/>
|
||||
<BaselineCell time="66" cumHazard="0.0370140578111611"/>
|
||||
<BaselineCell time="67" cumHazard="0.0409362373290203"/>
|
||||
<BaselineCell time="68" cumHazard="0.0449215556792318"/>
|
||||
<BaselineCell time="69" cumHazard="0.0449215556792318"/>
|
||||
<BaselineCell time="70" cumHazard="0.0489405971587672"/>
|
||||
<BaselineCell time="71" cumHazard="0.0529879755383518"/>
|
||||
<BaselineCell time="72" cumHazard="0.0570614902043866"/>
|
||||
<BaselineCell time="73" cumHazard="0.0653613928530318"/>
|
||||
<BaselineCell time="74" cumHazard="0.0653613928530318"/>
|
||||
<BaselineCell time="75" cumHazard="0.0653613928530318"/>
|
||||
<BaselineCell time="76" cumHazard="0.0653613928530318"/>
|
||||
<BaselineCell time="77" cumHazard="0.0697510956324988"/>
|
||||
<BaselineCell time="78" cumHazard="0.0742001650257772"/>
|
||||
<BaselineCell time="79" cumHazard="0.0742001650257772"/>
|
||||
<BaselineCell time="80" cumHazard="0.08342709513954"/>
|
||||
<BaselineCell time="81" cumHazard="0.092953077011412"/>
|
||||
<BaselineCell time="82" cumHazard="0.092953077011412"/>
|
||||
<BaselineCell time="83" cumHazard="0.092953077011412"/>
|
||||
<BaselineCell time="84" cumHazard="0.102839303094461"/>
|
||||
<BaselineCell time="85" cumHazard="0.102839303094461"/>
|
||||
<BaselineCell time="86" cumHazard="0.107905068018534"/>
|
||||
<BaselineCell time="87" cumHazard="0.107905068018534"/>
|
||||
<BaselineCell time="88" cumHazard="0.113247446355779"/>
|
||||
<BaselineCell time="89" cumHazard="0.118722503982179"/>
|
||||
<BaselineCell time="90" cumHazard="0.118722503982179"/>
|
||||
<BaselineCell time="91" cumHazard="0.118722503982179"/>
|
||||
<BaselineCell time="92" cumHazard="0.118722503982179"/>
|
||||
<BaselineCell time="93" cumHazard="0.118722503982179"/>
|
||||
<BaselineCell time="94" cumHazard="0.125054477224502"/>
|
||||
<BaselineCell time="95" cumHazard="0.125054477224502"/>
|
||||
<BaselineCell time="96" cumHazard="0.138808299943499"/>
|
||||
<BaselineCell time="97" cumHazard="0.138808299943499"/>
|
||||
<BaselineCell time="98" cumHazard="0.138808299943499"/>
|
||||
<BaselineCell time="99" cumHazard="0.138808299943499"/>
|
||||
<BaselineCell time="100" cumHazard="0.138808299943499"/>
|
||||
<BaselineCell time="101" cumHazard="0.14626081323344"/>
|
||||
<BaselineCell time="102" cumHazard="0.153869496541389"/>
|
||||
<BaselineCell time="103" cumHazard="0.172233087192292"/>
|
||||
<BaselineCell time="104" cumHazard="0.181817833720077"/>
|
||||
</BaseCumHazardTables>
|
||||
</GeneralRegressionModel>
|
||||
</PMML>
|
|
@ -0,0 +1,190 @@
|
|||
#region Copyright Syncfusion Inc. 2001-2018.
|
||||
// Copyright Syncfusion Inc. 2001-2018. All rights reserved.
|
||||
// Use of this code is subject to the terms of our license.
|
||||
// A copy of the current license can be obtained at any time by e-mailing
|
||||
// licensing@syncfusion.com. Any infringement will be prosecuted under
|
||||
// applicable laws.
|
||||
#endregion
|
||||
using Syncfusion.PMML;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
namespace RatsCoxRegression
|
||||
{
|
||||
/// <summary>
|
||||
/// Console program to demonstrate PMML execution engine
|
||||
/// </summary>
|
||||
public class Program
|
||||
{
|
||||
//Create Table instance for input, output and R Result
|
||||
public Table inputTable = null;
|
||||
private Table outputTable = null;
|
||||
private Table rResults = null;
|
||||
|
||||
#if CONSOLE
|
||||
|
||||
private static void Main(string[] args)
|
||||
{
|
||||
//Create instance
|
||||
Program program = new Program();
|
||||
//Load input csv
|
||||
program.inputTable = new Table("../../Model/Rats.csv", true, ',');
|
||||
//Invoke PredictResult
|
||||
program.outputTable = program.PredictResult(program.inputTable,
|
||||
"../../Model/Rats.pmml");
|
||||
//Dispose the inputTable values
|
||||
program.inputTable.Dispose();
|
||||
//Compare predicted results of PMML execution engine with R Results
|
||||
program.ComparePredictedResultsWithR("../../Model/ROutput.csv");
|
||||
//Write the Result as CSV Table
|
||||
program.outputTable.WriteToCSV("../../Model/PredictedOutput.csv", true, ',');
|
||||
//Dispose the output Table
|
||||
program.outputTable.Dispose();
|
||||
//Display the result saved location
|
||||
Console.WriteLine("\nResult saved in : " + Path.GetFullPath("../../Model/PredictedOutput.csv"));
|
||||
Console.ReadKey();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#region PredictResult
|
||||
|
||||
/// <summary>
|
||||
/// Predicts the results for given PMML and CSV file and serialize the results in a CSV file
|
||||
/// </summary>
|
||||
public Table PredictResult(Table inputTable, string pmmlPath)
|
||||
{
|
||||
//Get PMML Evaluator instance
|
||||
PMMLEvaluator evaluator = new PMMLEvaluatorFactory().
|
||||
GetPMMLEvaluatorInstance(pmmlPath);
|
||||
|
||||
string[] predictedCategories = null;
|
||||
|
||||
//Predict the value for each record using the PMML Evaluator instance
|
||||
for (int i = 0; i < inputTable.RowCount; i++)
|
||||
{
|
||||
var rats = GetDataObject(inputTable, i);
|
||||
|
||||
//Get result
|
||||
PredictedResult predictedResult = evaluator.GetResult(rats, null);
|
||||
|
||||
if (i == 0)
|
||||
{
|
||||
//Get the predicted propability fields
|
||||
predictedCategories = predictedResult.GetPredictedCategories();
|
||||
//Initialize the output table
|
||||
InitializeTable(inputTable.RowCount, predictedResult.PredictedField, predictedCategories);
|
||||
}
|
||||
|
||||
//Add predicted value
|
||||
outputTable[i, 0] = predictedResult.PredictedValue;
|
||||
//Add predicted Survival
|
||||
outputTable[i, 1] = predictedResult.GetPredictedProbability("survival");
|
||||
}
|
||||
return outputTable;
|
||||
}
|
||||
|
||||
#endregion PredictResult
|
||||
|
||||
#region Compare Predicted Results With R
|
||||
|
||||
/// <summary>
|
||||
/// Compare predicted results of PMML execution engine with R results
|
||||
/// </summary>
|
||||
|
||||
public void ComparePredictedResultsWithR(string rOutputDataCSVPath)
|
||||
{
|
||||
//Create instance to hold results of R
|
||||
rResults = new Table(rOutputDataCSVPath, true, ',');
|
||||
string differentIndices = string.Empty;
|
||||
//Pass the Table to the compare method of resultTable
|
||||
bool isDifferent = Compare(rResults, 1, 0, ref differentIndices);
|
||||
#if CONSOLE
|
||||
//Display mismatched index
|
||||
if (isDifferent)
|
||||
{
|
||||
Console.WriteLine("\nDifference in predicted results by R and PMML execution engine");
|
||||
Console.WriteLine("\nDifferent indices are " + differentIndices);
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("\nBoth predicted results by R and PMML execution engine are equal");
|
||||
}
|
||||
#endif
|
||||
//Dispose the R results Table
|
||||
rResults.Dispose();
|
||||
}
|
||||
|
||||
#endregion Compare Predicted Results With R
|
||||
|
||||
#region Initialize OutputTable
|
||||
|
||||
/// <summary>
|
||||
/// Initialize the outputTable
|
||||
/// </summary>
|
||||
/// <param name="rowCount">rowCount of output table</param>
|
||||
/// <param name="predictedfield">predictedfield name</param>
|
||||
/// <param name="predictedCategories">probableFields</param>
|
||||
private void InitializeTable(int rowCount, string predictedfield, string[] predictedCategories)
|
||||
{
|
||||
//Create instance to hold evaluated results
|
||||
outputTable = new Table(rowCount, predictedCategories.Length + 1);
|
||||
//Add predicted column names
|
||||
outputTable.ColumnNames[0] = "CumulativeHazard";
|
||||
outputTable.ColumnNames[1] = "Predicted_" + predictedfield;
|
||||
}
|
||||
|
||||
#endregion Initialize OutputTable
|
||||
|
||||
#region GetDataObject
|
||||
|
||||
/// <summary>
|
||||
/// Returns the row as anonymous object
|
||||
/// </summary>
|
||||
/// <param name="inputTable"> input Table values</param>
|
||||
/// <param name="row">input row</param>
|
||||
/// <returns>Anonymous object</returns>
|
||||
public Dictionary<string, object> GetDataObject(Table inputTable, int row)
|
||||
{
|
||||
Dictionary<string, object> rats = new Dictionary<string, object>();
|
||||
for (int i = 0; i < inputTable.ColumnCount; i++)
|
||||
{
|
||||
rats.Add(inputTable.ColumnNames[i], inputTable[row, inputTable.ColumnNames[i]]);
|
||||
}
|
||||
return rats;
|
||||
}
|
||||
|
||||
#endregion GetDataObject
|
||||
|
||||
#region Compare
|
||||
|
||||
/// <summary>
|
||||
/// Compares the result of 2 Tables based on column index.
|
||||
/// </summary>
|
||||
/// <param name="rOutput">R output table</param>
|
||||
/// <param name="rColumnIndex">R's Column to be compared</param>
|
||||
/// <param name="predictedColumnIndex">predicted result's column index</param>
|
||||
/// <param name="differentIndices"> different indices</param>
|
||||
/// <returns>IsDifferent</returns>
|
||||
public bool Compare(Table table, int rColumnIndex, int predictedColumnIndex, ref string differentIndices)
|
||||
{
|
||||
bool isDifferent = false;
|
||||
//Compare predicted values
|
||||
for (int i = 0; i < table.RowCount; i++)
|
||||
{
|
||||
//Compare Results based on column index
|
||||
double predictedC = Math.Round(Convert.ToDouble(outputTable[i, predictedColumnIndex]), 2);
|
||||
double predictedR = Math.Round(Convert.ToDouble(table[i, rColumnIndex]), 2);
|
||||
if (predictedC != predictedR)
|
||||
{
|
||||
differentIndices += ", " + i;
|
||||
isDifferent = true;
|
||||
}
|
||||
}
|
||||
return isDifferent;
|
||||
}
|
||||
|
||||
#endregion Compare
|
||||
}
|
||||
}
|
|
@ -0,0 +1,133 @@
|
|||
# Copyright Syncfusion Inc. 2001 - 2016. All rights reserved.
|
||||
# Use of this code is subject to the terms of our license.
|
||||
# A copy of the current license can be obtained at any time by e-mailing
|
||||
# licensing@syncfusion.com. Any infringement will be prosecuted under
|
||||
# applicable laws.
|
||||
|
||||
|
||||
# If you are not familiar with R you can obtain a quick introduction by downloading
|
||||
# R Succinctly for free from Syncfusion - http://www.syncfusion.com/resources/techportal/ebooks/rsuccinctly
|
||||
# R Succinctly is also included with this installation and is available here
|
||||
# Installed Drive :\Program Files (x86)\Syncfusion\Essential Studio\XX.X.X.XX\Infrastructure\EBooks\R_Succintly.pdf OF R Succinctly
|
||||
# Uncomment below lines to install necessary packages if not installed already
|
||||
# install.packages("pmml")
|
||||
# install.packages("gmodels")
|
||||
# install.packages("ROCR")
|
||||
# install.packages("caret")
|
||||
# install.packages("e1071")
|
||||
|
||||
# Load below packages
|
||||
library(pmml)
|
||||
library(gmodels)
|
||||
library(ROCR)
|
||||
library(caret)
|
||||
library(e1071)
|
||||
|
||||
# Here we directly load the audit dataset installed with the "pmml" package.
|
||||
data(audit)
|
||||
|
||||
# rename column names in audit dataset from pmml package
|
||||
auditOriginal <- setNames(audit, c("ID", "Age", "Employment", "Education", "Marital", "Occupation", "Income", "Sex", "Deductions", "Hours",
|
||||
"Accounts", "Adjustment", "Adjusted"))
|
||||
|
||||
# Omit rows with missing values
|
||||
auditOriginal = na.omit(auditOriginal)
|
||||
|
||||
# Code below demonstrates loading the same dataset from a CSV file shipped with our installer.
|
||||
# Please check installed samples (Data) location to set actual working directory
|
||||
# Uncomment below lines and comment out the code to read data from CSV file.
|
||||
# setwd("C:/actual_data_location")
|
||||
# audit= read.csv("Audit.csv")
|
||||
|
||||
# Considering integer variable as factor
|
||||
auditOriginal[, "Adjusted"]=as.factor(auditOriginal[, "Adjusted"])
|
||||
|
||||
# Randomizing data
|
||||
audit<-auditOriginal[sample(nrow(auditOriginal)),]
|
||||
|
||||
# Divide dataset for training and test
|
||||
trainData=audit[1:1487,]
|
||||
testData=audit[1488:1859,]
|
||||
|
||||
# Applying General Regression Model - probit function to predict Adjusted
|
||||
auditFormula = formula(Adjusted ~ Age + Employment + Education + Marital + Occupation + Income + Sex + Deductions + Hours)
|
||||
audit_GLM = glm(auditFormula, trainData, family = binomial(link="probit"))
|
||||
summary(audit_GLM)
|
||||
|
||||
# Display the predicted results and create cross table to check on accuracy
|
||||
# Predict "Adjusted" column probability for test data set
|
||||
auditTestProbabilities = predict(audit_GLM, type = "response",testData)
|
||||
# Display predicted probabilities
|
||||
auditTestProbabilities
|
||||
|
||||
# Categorize the probability for predicted value (0/1)
|
||||
auditTestPrediction = as.character(as.integer(auditTestProbabilities > 0.5))
|
||||
# Display predicted values
|
||||
auditTestPrediction
|
||||
|
||||
# Create cross table to check on accuracy.
|
||||
CrossTable(auditTestPrediction,testData$Adjusted, prop.chisq = FALSE, prop.t = FALSE, prop.r = FALSE,
|
||||
dnn = c('predicted', 'actual'))
|
||||
|
||||
# Generate ROC curve and calculate AUC value to predict the accuracy for Audit test dataset
|
||||
|
||||
# To create visualizations - ROC curve with "ROCR" package two vectors of data are needed,
|
||||
# The first vector must contain the class values - Adjusted column and
|
||||
# The second vector must contain the estimated probability of the positive class(AuditHighriskProbability)
|
||||
pred <- prediction(labels = testData$Adjusted, predictions = auditTestProbabilities)
|
||||
|
||||
# Using the perf performance object, we can visualize the ROC curve with R's plot() function
|
||||
perf <- performance(pred, measure = "tpr", x.measure = "fpr")
|
||||
|
||||
# Plot the ROC curve for the visualization
|
||||
plot(perf, main = "ROC curve for Audit Test Dataset", col = "blue", lwd = 3)
|
||||
|
||||
# To indicate reference line in the ROC plot
|
||||
abline(a = 0, b = 1, lwd = 2, lty = 2)
|
||||
|
||||
# We can use the ROCR package to calculate the AUC(Area under the ROC Curve)
|
||||
# To do so, we first need to create another performance object and specify measure = "auc", as shown in the following code:
|
||||
perf.auc <- performance(pred, measure = "auc")
|
||||
|
||||
# perf.auc is an object (specifically known as an S4 object) we need to use a special type of notation to access the values stored within.
|
||||
# S4 objects hold information in positions known as slots
|
||||
# The str() function can be used to see all slots for an object
|
||||
str(perf.auc)
|
||||
|
||||
# To access the AUC value, which is stored as a list in the y.values slot, we can use the @ notation along with the unlist() function, which simplifies lists to a vector of numeric values
|
||||
# Below AUC value is under the "outstanding" category
|
||||
unlist(perf.auc@y.values)
|
||||
|
||||
# View Specificity, Sensitivity and Accuracy information using confusionMatrix function from "caret" package
|
||||
confusionMatrix(auditTestPrediction,testData$Adjusted, positive = "1")
|
||||
|
||||
# PMML generation
|
||||
pmmlFile = pmml(audit_GLM , data=trainData)
|
||||
write(toString(pmmlFile) , file="Audit.pmml")
|
||||
saveXML(pmmlFile , file="Audit.pmml")
|
||||
|
||||
# The code below is used for evaluation purpose.
|
||||
# The model is applied for original audit data set and predicted results are saved in "ROutput.csv"
|
||||
# "ROutput.csv" file used for comparing the R results with PMML Evaluation engine results
|
||||
|
||||
# Applying General Regression model to entire dataset and save the results in a CSV file
|
||||
auditEntireProbabilities = predict(audit_GLM, type = "response",auditOriginal)
|
||||
|
||||
# Categorize the probability for predicted value (0/1)
|
||||
auditEntirePrediction = as.character(as.integer(auditEntireProbabilities > 0.5))
|
||||
|
||||
# Save predicted value in a data frame
|
||||
auditProbabilities = cbind(1 - auditEntireProbabilities , auditEntireProbabilities)
|
||||
result = data.frame(auditEntirePrediction , auditProbabilities)
|
||||
names(result) = c("Predicted_Adjusted" , "AuditLowriskProbability" , "AuditHighriskProbability")
|
||||
|
||||
# Write the results in a CSV file
|
||||
write.csv(result, "ROutput.csv" , quote=F)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -0,0 +1,244 @@
|
|||
<?xml version="1.0"?>
|
||||
<PMML version="4.3" xmlns="http://www.dmg.org/PMML-4_3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.dmg.org/PMML-4_3 http://www.dmg.org/pmml/v4-3/pmml-4-3.xsd">
|
||||
<Header copyright="Copyright (c) 2017 Syncfusion" description="Generalized Linear Regression Model">
|
||||
<Extension name="user" value="Syncfusion" extender="Rattle/PMML"/>
|
||||
<Application name="Rattle/PMML" version="1.4"/>
|
||||
<Timestamp>2017-11-07 16:37:40</Timestamp>
|
||||
</Header>
|
||||
<DataDictionary numberOfFields="10">
|
||||
<DataField name="Adjusted" optype="categorical" dataType="string">
|
||||
<Value value="0"/>
|
||||
<Value value="1"/>
|
||||
</DataField>
|
||||
<DataField name="Age" optype="continuous" dataType="double"/>
|
||||
<DataField name="Employment" optype="categorical" dataType="string">
|
||||
<Value value="Consultant"/>
|
||||
<Value value="Private"/>
|
||||
<Value value="PSFederal"/>
|
||||
<Value value="PSLocal"/>
|
||||
<Value value="PSState"/>
|
||||
<Value value="SelfEmp"/>
|
||||
<Value value="Volunteer"/>
|
||||
</DataField>
|
||||
<DataField name="Education" optype="categorical" dataType="string">
|
||||
<Value value="Associate"/>
|
||||
<Value value="Bachelor"/>
|
||||
<Value value="College"/>
|
||||
<Value value="Doctorate"/>
|
||||
<Value value="HSgrad"/>
|
||||
<Value value="Master"/>
|
||||
<Value value="Preschool"/>
|
||||
<Value value="Professional"/>
|
||||
<Value value="Vocational"/>
|
||||
<Value value="Yr10"/>
|
||||
<Value value="Yr11"/>
|
||||
<Value value="Yr12"/>
|
||||
<Value value="Yr1t4"/>
|
||||
<Value value="Yr5t6"/>
|
||||
<Value value="Yr7t8"/>
|
||||
<Value value="Yr9"/>
|
||||
</DataField>
|
||||
<DataField name="Marital" optype="categorical" dataType="string">
|
||||
<Value value="Absent"/>
|
||||
<Value value="Divorced"/>
|
||||
<Value value="Married"/>
|
||||
<Value value="Married-spouse-absent"/>
|
||||
<Value value="Unmarried"/>
|
||||
<Value value="Widowed"/>
|
||||
</DataField>
|
||||
<DataField name="Occupation" optype="categorical" dataType="string">
|
||||
<Value value="Cleaner"/>
|
||||
<Value value="Clerical"/>
|
||||
<Value value="Executive"/>
|
||||
<Value value="Farming"/>
|
||||
<Value value="Home"/>
|
||||
<Value value="Machinist"/>
|
||||
<Value value="Military"/>
|
||||
<Value value="Professional"/>
|
||||
<Value value="Protective"/>
|
||||
<Value value="Repair"/>
|
||||
<Value value="Sales"/>
|
||||
<Value value="Service"/>
|
||||
<Value value="Support"/>
|
||||
<Value value="Transport"/>
|
||||
</DataField>
|
||||
<DataField name="Income" optype="continuous" dataType="double"/>
|
||||
<DataField name="Sex" optype="categorical" dataType="string">
|
||||
<Value value="Female"/>
|
||||
<Value value="Male"/>
|
||||
</DataField>
|
||||
<DataField name="Deductions" optype="continuous" dataType="double"/>
|
||||
<DataField name="Hours" optype="continuous" dataType="double"/>
|
||||
</DataDictionary>
|
||||
<GeneralRegressionModel modelName="General_Regression_Model" modelType="generalizedLinear" functionName="classification" algorithmName="glm" distribution="binomial" linkFunction="probit">
|
||||
<MiningSchema>
|
||||
<MiningField name="Adjusted" usageType="predicted"/>
|
||||
<MiningField name="Age" usageType="active"/>
|
||||
<MiningField name="Employment" usageType="active"/>
|
||||
<MiningField name="Education" usageType="active"/>
|
||||
<MiningField name="Marital" usageType="active"/>
|
||||
<MiningField name="Occupation" usageType="active"/>
|
||||
<MiningField name="Income" usageType="active"/>
|
||||
<MiningField name="Sex" usageType="active"/>
|
||||
<MiningField name="Deductions" usageType="active"/>
|
||||
<MiningField name="Hours" usageType="active"/>
|
||||
</MiningSchema>
|
||||
<Output>
|
||||
<OutputField name="Probability_1" targetField="Adjusted" feature="probability" value="1"/>
|
||||
<OutputField name="Predicted_Adjusted" feature="predictedValue"/>
|
||||
</Output>
|
||||
<ParameterList>
|
||||
<Parameter name="p0" label="(Intercept)"/>
|
||||
<Parameter name="p1" label="Age"/>
|
||||
<Parameter name="p2" label="EmploymentPrivate"/>
|
||||
<Parameter name="p3" label="EmploymentPSFederal"/>
|
||||
<Parameter name="p4" label="EmploymentPSLocal"/>
|
||||
<Parameter name="p5" label="EmploymentPSState"/>
|
||||
<Parameter name="p6" label="EmploymentSelfEmp"/>
|
||||
<Parameter name="p7" label="EmploymentVolunteer"/>
|
||||
<Parameter name="p8" label="EducationBachelor"/>
|
||||
<Parameter name="p9" label="EducationCollege"/>
|
||||
<Parameter name="p10" label="EducationDoctorate"/>
|
||||
<Parameter name="p11" label="EducationHSgrad"/>
|
||||
<Parameter name="p12" label="EducationMaster"/>
|
||||
<Parameter name="p13" label="EducationPreschool"/>
|
||||
<Parameter name="p14" label="EducationProfessional"/>
|
||||
<Parameter name="p15" label="EducationVocational"/>
|
||||
<Parameter name="p16" label="EducationYr10"/>
|
||||
<Parameter name="p17" label="EducationYr11"/>
|
||||
<Parameter name="p18" label="EducationYr12"/>
|
||||
<Parameter name="p19" label="EducationYr1t4"/>
|
||||
<Parameter name="p20" label="EducationYr5t6"/>
|
||||
<Parameter name="p21" label="EducationYr7t8"/>
|
||||
<Parameter name="p22" label="EducationYr9"/>
|
||||
<Parameter name="p23" label="MaritalDivorced"/>
|
||||
<Parameter name="p24" label="MaritalMarried"/>
|
||||
<Parameter name="p25" label="MaritalMarried-spouse-absent"/>
|
||||
<Parameter name="p26" label="MaritalUnmarried"/>
|
||||
<Parameter name="p27" label="MaritalWidowed"/>
|
||||
<Parameter name="p28" label="OccupationClerical"/>
|
||||
<Parameter name="p29" label="OccupationExecutive"/>
|
||||
<Parameter name="p30" label="OccupationFarming"/>
|
||||
<Parameter name="p31" label="OccupationHome"/>
|
||||
<Parameter name="p32" label="OccupationMachinist"/>
|
||||
<Parameter name="p33" label="OccupationMilitary"/>
|
||||
<Parameter name="p34" label="OccupationProfessional"/>
|
||||
<Parameter name="p35" label="OccupationProtective"/>
|
||||
<Parameter name="p36" label="OccupationRepair"/>
|
||||
<Parameter name="p37" label="OccupationSales"/>
|
||||
<Parameter name="p38" label="OccupationService"/>
|
||||
<Parameter name="p39" label="OccupationSupport"/>
|
||||
<Parameter name="p40" label="OccupationTransport"/>
|
||||
<Parameter name="p41" label="Income"/>
|
||||
<Parameter name="p42" label="SexMale"/>
|
||||
<Parameter name="p43" label="Deductions"/>
|
||||
<Parameter name="p44" label="Hours"/>
|
||||
</ParameterList>
|
||||
<FactorList>
|
||||
<Predictor name="Employment"/>
|
||||
<Predictor name="Education"/>
|
||||
<Predictor name="Marital"/>
|
||||
<Predictor name="Occupation"/>
|
||||
<Predictor name="Sex"/>
|
||||
</FactorList>
|
||||
<CovariateList>
|
||||
<Predictor name="Age"/>
|
||||
<Predictor name="Income"/>
|
||||
<Predictor name="Deductions"/>
|
||||
<Predictor name="Hours"/>
|
||||
</CovariateList>
|
||||
<PPMatrix>
|
||||
<PPCell value="1" predictorName="Age" parameterName="p1"/>
|
||||
<PPCell value="Private" predictorName="Employment" parameterName="p2"/>
|
||||
<PPCell value="PSFederal" predictorName="Employment" parameterName="p3"/>
|
||||
<PPCell value="PSLocal" predictorName="Employment" parameterName="p4"/>
|
||||
<PPCell value="PSState" predictorName="Employment" parameterName="p5"/>
|
||||
<PPCell value="SelfEmp" predictorName="Employment" parameterName="p6"/>
|
||||
<PPCell value="Volunteer" predictorName="Employment" parameterName="p7"/>
|
||||
<PPCell value="Bachelor" predictorName="Education" parameterName="p8"/>
|
||||
<PPCell value="College" predictorName="Education" parameterName="p9"/>
|
||||
<PPCell value="Doctorate" predictorName="Education" parameterName="p10"/>
|
||||
<PPCell value="HSgrad" predictorName="Education" parameterName="p11"/>
|
||||
<PPCell value="Master" predictorName="Education" parameterName="p12"/>
|
||||
<PPCell value="Preschool" predictorName="Education" parameterName="p13"/>
|
||||
<PPCell value="Professional" predictorName="Education" parameterName="p14"/>
|
||||
<PPCell value="Vocational" predictorName="Education" parameterName="p15"/>
|
||||
<PPCell value="Yr10" predictorName="Education" parameterName="p16"/>
|
||||
<PPCell value="Yr11" predictorName="Education" parameterName="p17"/>
|
||||
<PPCell value="Yr12" predictorName="Education" parameterName="p18"/>
|
||||
<PPCell value="Yr1t4" predictorName="Education" parameterName="p19"/>
|
||||
<PPCell value="Yr5t6" predictorName="Education" parameterName="p20"/>
|
||||
<PPCell value="Yr7t8" predictorName="Education" parameterName="p21"/>
|
||||
<PPCell value="Yr9" predictorName="Education" parameterName="p22"/>
|
||||
<PPCell value="Divorced" predictorName="Marital" parameterName="p23"/>
|
||||
<PPCell value="Married" predictorName="Marital" parameterName="p24"/>
|
||||
<PPCell value="Married-spouse-absent" predictorName="Marital" parameterName="p25"/>
|
||||
<PPCell value="Unmarried" predictorName="Marital" parameterName="p26"/>
|
||||
<PPCell value="Widowed" predictorName="Marital" parameterName="p27"/>
|
||||
<PPCell value="Clerical" predictorName="Occupation" parameterName="p28"/>
|
||||
<PPCell value="Executive" predictorName="Occupation" parameterName="p29"/>
|
||||
<PPCell value="Farming" predictorName="Occupation" parameterName="p30"/>
|
||||
<PPCell value="Home" predictorName="Occupation" parameterName="p31"/>
|
||||
<PPCell value="Machinist" predictorName="Occupation" parameterName="p32"/>
|
||||
<PPCell value="Military" predictorName="Occupation" parameterName="p33"/>
|
||||
<PPCell value="Professional" predictorName="Occupation" parameterName="p34"/>
|
||||
<PPCell value="Protective" predictorName="Occupation" parameterName="p35"/>
|
||||
<PPCell value="Repair" predictorName="Occupation" parameterName="p36"/>
|
||||
<PPCell value="Sales" predictorName="Occupation" parameterName="p37"/>
|
||||
<PPCell value="Service" predictorName="Occupation" parameterName="p38"/>
|
||||
<PPCell value="Support" predictorName="Occupation" parameterName="p39"/>
|
||||
<PPCell value="Transport" predictorName="Occupation" parameterName="p40"/>
|
||||
<PPCell value="1" predictorName="Income" parameterName="p41"/>
|
||||
<PPCell value="Male" predictorName="Sex" parameterName="p42"/>
|
||||
<PPCell value="1" predictorName="Deductions" parameterName="p43"/>
|
||||
<PPCell value="1" predictorName="Hours" parameterName="p44"/>
|
||||
</PPMatrix>
|
||||
<ParamMatrix>
|
||||
<PCell targetCategory="1" parameterName="p0" df="1" beta="-10.245029765527"/>
|
||||
<PCell targetCategory="1" parameterName="p1" df="1" beta="0.0366643547672245"/>
|
||||
<PCell targetCategory="1" parameterName="p2" df="1" beta="1.21187180616382"/>
|
||||
<PCell targetCategory="1" parameterName="p3" df="1" beta="0.711736832051624"/>
|
||||
<PCell targetCategory="1" parameterName="p4" df="1" beta="1.29656364373441"/>
|
||||
<PCell targetCategory="1" parameterName="p5" df="1" beta="1.63656330537154"/>
|
||||
<PCell targetCategory="1" parameterName="p6" df="1" beta="1.77322992592183"/>
|
||||
<PCell targetCategory="1" parameterName="p7" df="1" beta="-4.72500302246159"/>
|
||||
<PCell targetCategory="1" parameterName="p8" df="1" beta="0.772336104809337"/>
|
||||
<PCell targetCategory="1" parameterName="p9" df="1" beta="-0.923868089287583"/>
|
||||
<PCell targetCategory="1" parameterName="p10" df="1" beta="1.15646208851814"/>
|
||||
<PCell targetCategory="1" parameterName="p11" df="1" beta="-1.03396861663694"/>
|
||||
<PCell targetCategory="1" parameterName="p12" df="1" beta="1.04029419679187"/>
|
||||
<PCell targetCategory="1" parameterName="p13" df="1" beta="-0.16366389928453"/>
|
||||
<PCell targetCategory="1" parameterName="p14" df="1" beta="2.15140531103797"/>
|
||||
<PCell targetCategory="1" parameterName="p15" df="1" beta="-0.281839065895314"/>
|
||||
<PCell targetCategory="1" parameterName="p16" df="1" beta="-6.06646538735489"/>
|
||||
<PCell targetCategory="1" parameterName="p17" df="1" beta="-5.90371634615843"/>
|
||||
<PCell targetCategory="1" parameterName="p18" df="1" beta="0.334805592505848"/>
|
||||
<PCell targetCategory="1" parameterName="p19" df="1" beta="-6.00719275734856"/>
|
||||
<PCell targetCategory="1" parameterName="p20" df="1" beta="-5.87103832674652"/>
|
||||
<PCell targetCategory="1" parameterName="p21" df="1" beta="-4.55840193526594"/>
|
||||
<PCell targetCategory="1" parameterName="p22" df="1" beta="-6.76036814404884"/>
|
||||
<PCell targetCategory="1" parameterName="p23" df="1" beta="-0.516532452566628"/>
|
||||
<PCell targetCategory="1" parameterName="p24" df="1" beta="3.78780551779472"/>
|
||||
<PCell targetCategory="1" parameterName="p25" df="1" beta="-4.17125897059218"/>
|
||||
<PCell targetCategory="1" parameterName="p26" df="1" beta="-3.86376327104417"/>
|
||||
<PCell targetCategory="1" parameterName="p27" df="1" beta="-6.87830524980147"/>
|
||||
<PCell targetCategory="1" parameterName="p28" df="1" beta="1.66808589846316"/>
|
||||
<PCell targetCategory="1" parameterName="p29" df="1" beta="2.30435961637999"/>
|
||||
<PCell targetCategory="1" parameterName="p30" df="1" beta="0.275296187811497"/>
|
||||
<PCell targetCategory="1" parameterName="p31" df="1" beta="1.10684814079681"/>
|
||||
<PCell targetCategory="1" parameterName="p32" df="1" beta="-4.64489468702691"/>
|
||||
<PCell targetCategory="1" parameterName="p33" df="1" beta="1.22243120539793"/>
|
||||
<PCell targetCategory="1" parameterName="p34" df="1" beta="2.36434724156095"/>
|
||||
<PCell targetCategory="1" parameterName="p35" df="1" beta="1.55245658715605"/>
|
||||
<PCell targetCategory="1" parameterName="p36" df="1" beta="0.247720180760695"/>
|
||||
<PCell targetCategory="1" parameterName="p37" df="1" beta="1.382491417886"/>
|
||||
<PCell targetCategory="1" parameterName="p38" df="1" beta="-6.42948138846206"/>
|
||||
<PCell targetCategory="1" parameterName="p39" df="1" beta="1.80961181971797"/>
|
||||
<PCell targetCategory="1" parameterName="p40" df="1" beta="-0.584064682958092"/>
|
||||
<PCell targetCategory="1" parameterName="p41" df="1" beta="3.12071267031604e-06"/>
|
||||
<PCell targetCategory="1" parameterName="p42" df="1" beta="0.18225768579104"/>
|
||||
<PCell targetCategory="1" parameterName="p43" df="1" beta="0.0016762090818281"/>
|
||||
<PCell targetCategory="1" parameterName="p44" df="1" beta="0.0409571458469526"/>
|
||||
</ParamMatrix>
|
||||
</GeneralRegressionModel>
|
||||
</PMML>
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -0,0 +1,190 @@
|
|||
#region Copyright Syncfusion Inc. 2001-2018.
|
||||
// Copyright Syncfusion Inc. 2001-2018. All rights reserved.
|
||||
// Use of this code is subject to the terms of our license.
|
||||
// A copy of the current license can be obtained at any time by e-mailing
|
||||
// licensing@syncfusion.com. Any infringement will be prosecuted under
|
||||
// applicable laws.
|
||||
#endregion
|
||||
using Syncfusion.PMML;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
namespace AuditBinomialProbitClassification
|
||||
{
|
||||
/// <summary>
|
||||
/// Console program to demonstrate PMML execution engine
|
||||
/// </summary>
|
||||
public class Program
|
||||
{
|
||||
//Create Table instance for input, output and R Result
|
||||
public Table inputTable = null;
|
||||
|
||||
private Table outputTable = null;
|
||||
private Table rResults = null;
|
||||
|
||||
#if CONSOLE
|
||||
|
||||
private static void Main(string[] args)
|
||||
{
|
||||
//Create instance
|
||||
Program program = new Program();
|
||||
//Load input csv
|
||||
program.inputTable = new Table("../../Model/Audit.csv", true, ',');
|
||||
//Invoke PredictResult
|
||||
program.outputTable = program.PredictResult(program.inputTable,
|
||||
"../../Model/Audit.pmml");
|
||||
//Compare predicted results of PMML execution engine with R Results
|
||||
//Dispose the inputTable values
|
||||
program.inputTable.Dispose();
|
||||
program.ComparePredictedResultsWithR("../../Model/ROutput.csv");
|
||||
//Write the Result as CSV Table
|
||||
program.outputTable.WriteToCSV("../../Model/PredictedOutput.csv", true, ',');
|
||||
//Dispose the output Table
|
||||
program.outputTable.Dispose();
|
||||
//Display the result saved location
|
||||
Console.WriteLine("\nResult saved in : " + Path.GetFullPath("../../Model/PredictedOutput.csv"));
|
||||
Console.ReadKey();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#region PredictResult
|
||||
|
||||
/// <summary>
|
||||
/// Predicts the results for given PMML and CSV file and serialize the results in a CSV file
|
||||
/// </summary>
|
||||
public Table PredictResult(Table inputTable, string pmmlPath)
|
||||
{
|
||||
//Get PMML Evaluator instance
|
||||
PMMLEvaluator evaluator = new PMMLEvaluatorFactory().
|
||||
GetPMMLEvaluatorInstance(pmmlPath);
|
||||
|
||||
string[] predictedCategories = null;
|
||||
|
||||
//Predict the value for each record using the PMML Evaluator instance
|
||||
for (int i = 0; i < inputTable.RowCount; i++)
|
||||
{
|
||||
var audit = GetDataObject(inputTable, i);
|
||||
|
||||
//Get result
|
||||
PredictedResult predictedResult = evaluator.GetResult(audit, null);
|
||||
|
||||
if (i == 0)
|
||||
{
|
||||
//Get the predicted propability fields
|
||||
predictedCategories = predictedResult.GetPredictedCategories();
|
||||
//Initialize the output table
|
||||
InitializeTable(inputTable.RowCount, predictedResult.PredictedField, predictedCategories);
|
||||
}
|
||||
|
||||
//Add predicted value
|
||||
outputTable[i, 0] = predictedResult.PredictedValue;
|
||||
|
||||
for (int j = 1; j <= predictedCategories.Length; j++)
|
||||
outputTable[i, j] = predictedResult.GetPredictedProbability(predictedCategories[j - 1]);
|
||||
}
|
||||
return outputTable;
|
||||
}
|
||||
|
||||
#endregion PredictResult
|
||||
|
||||
#region Compare Predicted Results With R
|
||||
|
||||
/// <summary>
|
||||
/// Compare predicted results of PMML execution engine with R results
|
||||
/// </summary>
|
||||
|
||||
public void ComparePredictedResultsWithR(string rOutputDataCSVPath)
|
||||
{
|
||||
//Create instance to hold results of R
|
||||
rResults = new Table(rOutputDataCSVPath, true, ',');
|
||||
string differentIndices = string.Empty;
|
||||
//Pass the Table to the compare method of resultTable
|
||||
bool isDifferent = Compare(rResults, 1, 0, ref differentIndices);
|
||||
#if CONSOLE
|
||||
//Display mismatched index
|
||||
if (isDifferent)
|
||||
{
|
||||
Console.WriteLine("\nDifference in predicted results by R and PMML execution engine");
|
||||
Console.WriteLine("\nDifferent indices are " + differentIndices);
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("\nBoth predicted results by R and PMML execution engine are equal");
|
||||
}
|
||||
#endif
|
||||
//Dispose the R results Table
|
||||
rResults.Dispose();
|
||||
}
|
||||
|
||||
#endregion Compare Predicted Results With R
|
||||
|
||||
#region Initialize OutputTable
|
||||
|
||||
/// <summary>
|
||||
/// Initialize the outputTable
|
||||
/// </summary>
|
||||
/// <param name="rowCount">rowCount of output table</param>
|
||||
/// <param name="predictedfield">predictedfield name</param>
|
||||
/// <param name="predictedCategories">probableFields</param>
|
||||
private void InitializeTable(int rowCount, string predictedfield, string[] predictedCategories)
|
||||
{
|
||||
//Create instance to hold evaluated results
|
||||
outputTable = new Table(rowCount, predictedCategories.Length + 1);
|
||||
//Add predicted column names
|
||||
outputTable.ColumnNames[0] = "Predicted_" + predictedfield;
|
||||
outputTable.ColumnNames[1] = "AuditLowriskProbability";
|
||||
outputTable.ColumnNames[2] = "AuditHighriskProbability";
|
||||
}
|
||||
|
||||
#endregion Initialize OutputTable
|
||||
|
||||
#region GetDataObject
|
||||
|
||||
/// <summary>
|
||||
/// Returns the row as anonymous object
|
||||
/// </summary>
|
||||
/// <param name="inputTable"> input Table values</param>
|
||||
/// <param name="row">input row</param>
|
||||
/// <returns>Anonymous object</returns>
|
||||
public Dictionary<string, object> GetDataObject(Table inputTable, int row)
|
||||
{
|
||||
Dictionary<string, object> audit = new Dictionary<string, object>();
|
||||
for (int i = 0; i < inputTable.ColumnCount; i++)
|
||||
{
|
||||
audit.Add(inputTable.ColumnNames[i], inputTable[row, inputTable.ColumnNames[i]]);
|
||||
}
|
||||
return audit;
|
||||
}
|
||||
|
||||
#endregion GetDataObject
|
||||
|
||||
#region Compare
|
||||
|
||||
/// <summary>
|
||||
/// Compares the result of 2 Tables based on column index.
|
||||
/// </summary>
|
||||
/// <param name="rOutput">R output table</param>
|
||||
/// <param name="rColumnIndex">R's Column to be compared</param>
|
||||
/// <param name="predictedColumnIndex">predicted result's column index</param>
|
||||
/// <param name="differentIndices"> different indices</param>
|
||||
public bool Compare(Table table, int rColumnIndex, int predictedColumnIndex, ref string differentIndices)
|
||||
{
|
||||
bool isDifferent = false;
|
||||
//Compare predicted values
|
||||
for (int i = 0; i < table.RowCount; i++)
|
||||
{
|
||||
//Compare Results based on column index
|
||||
if (outputTable[i, predictedColumnIndex].ToString() != table[i, rColumnIndex].ToString())
|
||||
{
|
||||
differentIndices += ", " + i;
|
||||
isDifferent = true;
|
||||
}
|
||||
}
|
||||
return isDifferent;
|
||||
}
|
||||
|
||||
#endregion Compare
|
||||
}
|
||||
}
|
|
@ -0,0 +1,127 @@
|
|||
# Copyright Syncfusion Inc. 2001 - 2016. All rights reserved.
|
||||
# Use of this code is subject to the terms of our license.
|
||||
# A copy of the current license can be obtained at any time by e-mailing
|
||||
# licensing@syncfusion.com. Any infringement will be prosecuted under
|
||||
# applicable laws.
|
||||
|
||||
|
||||
# If you are not familiar with R you can obtain a quick introduction by downloading
|
||||
# R Succinctly for free from Syncfusion - http://www.syncfusion.com/resources/techportal/ebooks/rsuccinctly
|
||||
# R Succinctly is also included with this installation and is available here
|
||||
# Installed Drive :\Program Files (x86)\Syncfusion\Essential Studio\XX.X.X.XX\Infrastructure\EBooks\R_Succintly.pdf OF R Succinctly
|
||||
# Uncomment below lines to install necessary packages if not installed already
|
||||
# install.packages("pmml")
|
||||
# install.packages("gmodels")
|
||||
# install.packages("ROCR")
|
||||
# install.packages("caret")
|
||||
# install.packages("e1071")
|
||||
|
||||
# Load below packages
|
||||
library(pmml)
|
||||
library(gmodels)
|
||||
library(ROCR)
|
||||
library(caret)
|
||||
library(e1071)
|
||||
|
||||
# Here we directly load the audit dataset installed with the "pmml" package.
|
||||
data(audit)
|
||||
|
||||
# rename column names in audit dataset from pmml package
|
||||
auditOriginal <- setNames(audit, c("ID", "Age", "Employment", "Education", "Marital", "Occupation", "Income", "Sex", "Deductions", "Hours",
|
||||
"Accounts", "Adjustment", "Adjusted"))
|
||||
|
||||
# Omit rows with missing values
|
||||
auditOriginal = na.omit(auditOriginal)
|
||||
|
||||
# Code below demonstrates loading the same dataset from a CSV file shipped with our installer.
|
||||
# Please check installed samples (Data) location to set actual working directory
|
||||
# Uncomment below lines and comment out the code to read data from CSV file.
|
||||
# setwd("C:/actual_data_location")
|
||||
# audit= read.csv("Audit.csv")
|
||||
|
||||
# Considering integer variable as factor
|
||||
auditOriginal[, "Adjusted"]=as.factor(auditOriginal[, "Adjusted"])
|
||||
|
||||
# Randomizing data
|
||||
audit<-auditOriginal[sample(nrow(auditOriginal)),]
|
||||
|
||||
# Divide dataset for training and test
|
||||
trainData=audit[1:1487,]
|
||||
testData=audit[1488:1859,]
|
||||
|
||||
# Applying General Regression Model - logit function to predict Adjusted
|
||||
auditFormula = formula(Adjusted ~ Age + Employment + Education + Marital + Occupation + Income + Sex + Deductions + Hours)
|
||||
audit_GLM = glm(auditFormula, trainData, family = binomial(link="logit"))
|
||||
summary(audit_GLM)
|
||||
|
||||
# Display the predicted results and create cross table to check on accuracy
|
||||
# Predict "Adjusted" column probability for test data set
|
||||
auditTestProbabilities = predict(audit_GLM, type = "response",testData)
|
||||
# Display predicted probabilities
|
||||
auditTestProbabilities
|
||||
|
||||
# Categorize the probability for predicted value (0/1)
|
||||
auditTestPrediction = as.character(as.integer(auditTestProbabilities > 0.5))
|
||||
# Display predicted values
|
||||
auditTestPrediction
|
||||
|
||||
# Create cross table to check on accuracy.
|
||||
CrossTable(auditTestPrediction,testData$Adjusted, prop.chisq = FALSE, prop.t = FALSE, prop.r = FALSE,
|
||||
dnn = c('predicted', 'actual'))
|
||||
|
||||
# Generate ROC curve and calculate AUC value to predict the accuracy for Audit test dataset
|
||||
|
||||
# To create visualizations - ROC curve with "ROCR" package two vectors of data are needed,
|
||||
# The first vector must contain the class values - Adjusted column and
|
||||
# The second vector must contain the estimated probability of the positive class(AuditHighriskProbability)
|
||||
pred <- prediction(labels = testData$Adjusted, predictions = auditTestProbabilities)
|
||||
|
||||
# Using the perf performance object, we can visualize the ROC curve with R's plot() function
|
||||
perf <- performance(pred, measure = "tpr", x.measure = "fpr")
|
||||
|
||||
# Plot the ROC curve for the visualization
|
||||
plot(perf, main = "ROC curve for Audit Test Dataset", col = "blue", lwd = 3)
|
||||
|
||||
# To indicate reference line in the ROC plot
|
||||
abline(a = 0, b = 1, lwd = 2, lty = 2)
|
||||
|
||||
# We can use the ROCR package to calculate the AUC(Area under the ROC Curve)
|
||||
# To do so, we first need to create another performance object and specify measure = "auc", as shown in the following code:
|
||||
perf.auc <- performance(pred, measure = "auc")
|
||||
|
||||
# perf.auc is an object (specifically known as an S4 object) we need to use a special type of notation to access the values stored within.
|
||||
# S4 objects hold information in positions known as slots
|
||||
# The str() function can be used to see all slots for an object
|
||||
str(perf.auc)
|
||||
|
||||
# To access the AUC value, which is stored as a list in the y.values slot, we can use the @ notation along with the unlist() function, which simplifies lists to a vector of numeric values
|
||||
# Below AUC value is under the "outstanding" category
|
||||
unlist(perf.auc@y.values)
|
||||
|
||||
# View Specificity, Sensitivity and Accuracy information using confusionMatrix function from "caret" package
|
||||
confusionMatrix(auditTestPrediction,testData$Adjusted, positive = "1")
|
||||
|
||||
# PMML generation
|
||||
pmmlFile = pmml(audit_GLM , data=trainData)
|
||||
write(toString(pmmlFile) , file="Audit.pmml")
|
||||
saveXML(pmmlFile , file="Audit.pmml")
|
||||
|
||||
# The code below is used for evaluation purpose.
|
||||
# The model is applied for original audit data set and predicted results are saved in "ROutput.csv"
|
||||
# "ROutput.csv" file used for comparing the R results with PMML Evaluation engine results
|
||||
|
||||
# Applying General Regression model to entire dataset and save the results in a CSV file
|
||||
auditEntireProbabilities = predict(audit_GLM, type = "response",auditOriginal)
|
||||
|
||||
# Categorize the probability for predicted value (0/1)
|
||||
auditEntirePrediction = as.character(as.integer(auditEntireProbabilities > 0.5))
|
||||
|
||||
# Save predicted value in a data frame
|
||||
auditProbabilities = cbind(1 - auditEntireProbabilities , auditEntireProbabilities)
|
||||
result = data.frame(auditEntirePrediction , auditProbabilities)
|
||||
names(result) = c("Predicted_Adjusted" , "AuditLowriskProbability" , "AuditHighriskProbability")
|
||||
|
||||
# Write the results in a CSV file
|
||||
write.csv(result, "ROutput.csv" , quote=F)
|
||||
|
||||
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -0,0 +1,244 @@
|
|||
<?xml version="1.0"?>
|
||||
<PMML version="4.3" xmlns="http://www.dmg.org/PMML-4_3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.dmg.org/PMML-4_3 http://www.dmg.org/pmml/v4-3/pmml-4-3.xsd">
|
||||
<Header copyright="Copyright (c) 2017 Syncfusion" description="Generalized Linear Regression Model">
|
||||
<Extension name="user" value="Syncfusion" extender="Rattle/PMML"/>
|
||||
<Application name="Rattle/PMML" version="1.4"/>
|
||||
<Timestamp>2017-11-08 10:08:24</Timestamp>
|
||||
</Header>
|
||||
<DataDictionary numberOfFields="10">
|
||||
<DataField name="Adjusted" optype="categorical" dataType="string">
|
||||
<Value value="0"/>
|
||||
<Value value="1"/>
|
||||
</DataField>
|
||||
<DataField name="Age" optype="continuous" dataType="double"/>
|
||||
<DataField name="Employment" optype="categorical" dataType="string">
|
||||
<Value value="Consultant"/>
|
||||
<Value value="Private"/>
|
||||
<Value value="PSFederal"/>
|
||||
<Value value="PSLocal"/>
|
||||
<Value value="PSState"/>
|
||||
<Value value="SelfEmp"/>
|
||||
<Value value="Volunteer"/>
|
||||
</DataField>
|
||||
<DataField name="Education" optype="categorical" dataType="string">
|
||||
<Value value="Associate"/>
|
||||
<Value value="Bachelor"/>
|
||||
<Value value="College"/>
|
||||
<Value value="Doctorate"/>
|
||||
<Value value="HSgrad"/>
|
||||
<Value value="Master"/>
|
||||
<Value value="Preschool"/>
|
||||
<Value value="Professional"/>
|
||||
<Value value="Vocational"/>
|
||||
<Value value="Yr10"/>
|
||||
<Value value="Yr11"/>
|
||||
<Value value="Yr12"/>
|
||||
<Value value="Yr1t4"/>
|
||||
<Value value="Yr5t6"/>
|
||||
<Value value="Yr7t8"/>
|
||||
<Value value="Yr9"/>
|
||||
</DataField>
|
||||
<DataField name="Marital" optype="categorical" dataType="string">
|
||||
<Value value="Absent"/>
|
||||
<Value value="Divorced"/>
|
||||
<Value value="Married"/>
|
||||
<Value value="Married-spouse-absent"/>
|
||||
<Value value="Unmarried"/>
|
||||
<Value value="Widowed"/>
|
||||
</DataField>
|
||||
<DataField name="Occupation" optype="categorical" dataType="string">
|
||||
<Value value="Cleaner"/>
|
||||
<Value value="Clerical"/>
|
||||
<Value value="Executive"/>
|
||||
<Value value="Farming"/>
|
||||
<Value value="Home"/>
|
||||
<Value value="Machinist"/>
|
||||
<Value value="Military"/>
|
||||
<Value value="Professional"/>
|
||||
<Value value="Protective"/>
|
||||
<Value value="Repair"/>
|
||||
<Value value="Sales"/>
|
||||
<Value value="Service"/>
|
||||
<Value value="Support"/>
|
||||
<Value value="Transport"/>
|
||||
</DataField>
|
||||
<DataField name="Income" optype="continuous" dataType="double"/>
|
||||
<DataField name="Sex" optype="categorical" dataType="string">
|
||||
<Value value="Female"/>
|
||||
<Value value="Male"/>
|
||||
</DataField>
|
||||
<DataField name="Deductions" optype="continuous" dataType="double"/>
|
||||
<DataField name="Hours" optype="continuous" dataType="double"/>
|
||||
</DataDictionary>
|
||||
<GeneralRegressionModel modelName="General_Regression_Model" modelType="generalizedLinear" functionName="classification" algorithmName="glm" distribution="binomial" linkFunction="logit">
|
||||
<MiningSchema>
|
||||
<MiningField name="Adjusted" usageType="predicted"/>
|
||||
<MiningField name="Age" usageType="active"/>
|
||||
<MiningField name="Employment" usageType="active"/>
|
||||
<MiningField name="Education" usageType="active"/>
|
||||
<MiningField name="Marital" usageType="active"/>
|
||||
<MiningField name="Occupation" usageType="active"/>
|
||||
<MiningField name="Income" usageType="active"/>
|
||||
<MiningField name="Sex" usageType="active"/>
|
||||
<MiningField name="Deductions" usageType="active"/>
|
||||
<MiningField name="Hours" usageType="active"/>
|
||||
</MiningSchema>
|
||||
<Output>
|
||||
<OutputField name="Probability_1" targetField="Adjusted" feature="probability" value="1"/>
|
||||
<OutputField name="Predicted_Adjusted" feature="predictedValue"/>
|
||||
</Output>
|
||||
<ParameterList>
|
||||
<Parameter name="p0" label="(Intercept)"/>
|
||||
<Parameter name="p1" label="Age"/>
|
||||
<Parameter name="p2" label="EmploymentPrivate"/>
|
||||
<Parameter name="p3" label="EmploymentPSFederal"/>
|
||||
<Parameter name="p4" label="EmploymentPSLocal"/>
|
||||
<Parameter name="p5" label="EmploymentPSState"/>
|
||||
<Parameter name="p6" label="EmploymentSelfEmp"/>
|
||||
<Parameter name="p7" label="EmploymentVolunteer"/>
|
||||
<Parameter name="p8" label="EducationBachelor"/>
|
||||
<Parameter name="p9" label="EducationCollege"/>
|
||||
<Parameter name="p10" label="EducationDoctorate"/>
|
||||
<Parameter name="p11" label="EducationHSgrad"/>
|
||||
<Parameter name="p12" label="EducationMaster"/>
|
||||
<Parameter name="p13" label="EducationPreschool"/>
|
||||
<Parameter name="p14" label="EducationProfessional"/>
|
||||
<Parameter name="p15" label="EducationVocational"/>
|
||||
<Parameter name="p16" label="EducationYr10"/>
|
||||
<Parameter name="p17" label="EducationYr11"/>
|
||||
<Parameter name="p18" label="EducationYr12"/>
|
||||
<Parameter name="p19" label="EducationYr1t4"/>
|
||||
<Parameter name="p20" label="EducationYr5t6"/>
|
||||
<Parameter name="p21" label="EducationYr7t8"/>
|
||||
<Parameter name="p22" label="EducationYr9"/>
|
||||
<Parameter name="p23" label="MaritalDivorced"/>
|
||||
<Parameter name="p24" label="MaritalMarried"/>
|
||||
<Parameter name="p25" label="MaritalMarried-spouse-absent"/>
|
||||
<Parameter name="p26" label="MaritalUnmarried"/>
|
||||
<Parameter name="p27" label="MaritalWidowed"/>
|
||||
<Parameter name="p28" label="OccupationClerical"/>
|
||||
<Parameter name="p29" label="OccupationExecutive"/>
|
||||
<Parameter name="p30" label="OccupationFarming"/>
|
||||
<Parameter name="p31" label="OccupationHome"/>
|
||||
<Parameter name="p32" label="OccupationMachinist"/>
|
||||
<Parameter name="p33" label="OccupationMilitary"/>
|
||||
<Parameter name="p34" label="OccupationProfessional"/>
|
||||
<Parameter name="p35" label="OccupationProtective"/>
|
||||
<Parameter name="p36" label="OccupationRepair"/>
|
||||
<Parameter name="p37" label="OccupationSales"/>
|
||||
<Parameter name="p38" label="OccupationService"/>
|
||||
<Parameter name="p39" label="OccupationSupport"/>
|
||||
<Parameter name="p40" label="OccupationTransport"/>
|
||||
<Parameter name="p41" label="Income"/>
|
||||
<Parameter name="p42" label="SexMale"/>
|
||||
<Parameter name="p43" label="Deductions"/>
|
||||
<Parameter name="p44" label="Hours"/>
|
||||
</ParameterList>
|
||||
<FactorList>
|
||||
<Predictor name="Employment"/>
|
||||
<Predictor name="Education"/>
|
||||
<Predictor name="Marital"/>
|
||||
<Predictor name="Occupation"/>
|
||||
<Predictor name="Sex"/>
|
||||
</FactorList>
|
||||
<CovariateList>
|
||||
<Predictor name="Age"/>
|
||||
<Predictor name="Income"/>
|
||||
<Predictor name="Deductions"/>
|
||||
<Predictor name="Hours"/>
|
||||
</CovariateList>
|
||||
<PPMatrix>
|
||||
<PPCell value="1" predictorName="Age" parameterName="p1"/>
|
||||
<PPCell value="Private" predictorName="Employment" parameterName="p2"/>
|
||||
<PPCell value="PSFederal" predictorName="Employment" parameterName="p3"/>
|
||||
<PPCell value="PSLocal" predictorName="Employment" parameterName="p4"/>
|
||||
<PPCell value="PSState" predictorName="Employment" parameterName="p5"/>
|
||||
<PPCell value="SelfEmp" predictorName="Employment" parameterName="p6"/>
|
||||
<PPCell value="Volunteer" predictorName="Employment" parameterName="p7"/>
|
||||
<PPCell value="Bachelor" predictorName="Education" parameterName="p8"/>
|
||||
<PPCell value="College" predictorName="Education" parameterName="p9"/>
|
||||
<PPCell value="Doctorate" predictorName="Education" parameterName="p10"/>
|
||||
<PPCell value="HSgrad" predictorName="Education" parameterName="p11"/>
|
||||
<PPCell value="Master" predictorName="Education" parameterName="p12"/>
|
||||
<PPCell value="Preschool" predictorName="Education" parameterName="p13"/>
|
||||
<PPCell value="Professional" predictorName="Education" parameterName="p14"/>
|
||||
<PPCell value="Vocational" predictorName="Education" parameterName="p15"/>
|
||||
<PPCell value="Yr10" predictorName="Education" parameterName="p16"/>
|
||||
<PPCell value="Yr11" predictorName="Education" parameterName="p17"/>
|
||||
<PPCell value="Yr12" predictorName="Education" parameterName="p18"/>
|
||||
<PPCell value="Yr1t4" predictorName="Education" parameterName="p19"/>
|
||||
<PPCell value="Yr5t6" predictorName="Education" parameterName="p20"/>
|
||||
<PPCell value="Yr7t8" predictorName="Education" parameterName="p21"/>
|
||||
<PPCell value="Yr9" predictorName="Education" parameterName="p22"/>
|
||||
<PPCell value="Divorced" predictorName="Marital" parameterName="p23"/>
|
||||
<PPCell value="Married" predictorName="Marital" parameterName="p24"/>
|
||||
<PPCell value="Married-spouse-absent" predictorName="Marital" parameterName="p25"/>
|
||||
<PPCell value="Unmarried" predictorName="Marital" parameterName="p26"/>
|
||||
<PPCell value="Widowed" predictorName="Marital" parameterName="p27"/>
|
||||
<PPCell value="Clerical" predictorName="Occupation" parameterName="p28"/>
|
||||
<PPCell value="Executive" predictorName="Occupation" parameterName="p29"/>
|
||||
<PPCell value="Farming" predictorName="Occupation" parameterName="p30"/>
|
||||
<PPCell value="Home" predictorName="Occupation" parameterName="p31"/>
|
||||
<PPCell value="Machinist" predictorName="Occupation" parameterName="p32"/>
|
||||
<PPCell value="Military" predictorName="Occupation" parameterName="p33"/>
|
||||
<PPCell value="Professional" predictorName="Occupation" parameterName="p34"/>
|
||||
<PPCell value="Protective" predictorName="Occupation" parameterName="p35"/>
|
||||
<PPCell value="Repair" predictorName="Occupation" parameterName="p36"/>
|
||||
<PPCell value="Sales" predictorName="Occupation" parameterName="p37"/>
|
||||
<PPCell value="Service" predictorName="Occupation" parameterName="p38"/>
|
||||
<PPCell value="Support" predictorName="Occupation" parameterName="p39"/>
|
||||
<PPCell value="Transport" predictorName="Occupation" parameterName="p40"/>
|
||||
<PPCell value="1" predictorName="Income" parameterName="p41"/>
|
||||
<PPCell value="Male" predictorName="Sex" parameterName="p42"/>
|
||||
<PPCell value="1" predictorName="Deductions" parameterName="p43"/>
|
||||
<PPCell value="1" predictorName="Hours" parameterName="p44"/>
|
||||
</PPMatrix>
|
||||
<ParamMatrix>
|
||||
<PCell targetCategory="1" parameterName="p0" df="1" beta="-24.9217664266807"/>
|
||||
<PCell targetCategory="1" parameterName="p1" df="1" beta="0.11398904298605"/>
|
||||
<PCell targetCategory="1" parameterName="p2" df="1" beta="2.41687945474241"/>
|
||||
<PCell targetCategory="1" parameterName="p3" df="1" beta="2.95765191021177"/>
|
||||
<PCell targetCategory="1" parameterName="p4" df="1" beta="3.4582770894875"/>
|
||||
<PCell targetCategory="1" parameterName="p5" df="1" beta="3.1667247281843"/>
|
||||
<PCell targetCategory="1" parameterName="p6" df="1" beta="3.79679233954838"/>
|
||||
<PCell targetCategory="1" parameterName="p7" df="1" beta="-18.8327089089332"/>
|
||||
<PCell targetCategory="1" parameterName="p8" df="1" beta="1.24457994389116"/>
|
||||
<PCell targetCategory="1" parameterName="p9" df="1" beta="-2.50835662204695"/>
|
||||
<PCell targetCategory="1" parameterName="p10" df="1" beta="1.87710692389584"/>
|
||||
<PCell targetCategory="1" parameterName="p11" df="1" beta="-3.11554708703706"/>
|
||||
<PCell targetCategory="1" parameterName="p12" df="1" beta="1.70794633711763"/>
|
||||
<PCell targetCategory="1" parameterName="p13" df="1" beta="-6.18447684043286"/>
|
||||
<PCell targetCategory="1" parameterName="p14" df="1" beta="4.19512126289029"/>
|
||||
<PCell targetCategory="1" parameterName="p15" df="1" beta="-1.4859817624874"/>
|
||||
<PCell targetCategory="1" parameterName="p16" df="1" beta="-3.58211361795354"/>
|
||||
<PCell targetCategory="1" parameterName="p17" df="1" beta="-19.3272385025478"/>
|
||||
<PCell targetCategory="1" parameterName="p18" df="1" beta="0.416317973426322"/>
|
||||
<PCell targetCategory="1" parameterName="p19" df="1" beta="-20.270179575446"/>
|
||||
<PCell targetCategory="1" parameterName="p20" df="1" beta="-18.7916832454563"/>
|
||||
<PCell targetCategory="1" parameterName="p21" df="1" beta="-16.1194122470576"/>
|
||||
<PCell targetCategory="1" parameterName="p22" df="1" beta="-24.1164323432004"/>
|
||||
<PCell targetCategory="1" parameterName="p23" df="1" beta="-2.02786449010369"/>
|
||||
<PCell targetCategory="1" parameterName="p24" df="1" beta="8.61737832284864"/>
|
||||
<PCell targetCategory="1" parameterName="p25" df="1" beta="-15.5459591408944"/>
|
||||
<PCell targetCategory="1" parameterName="p26" df="1" beta="1.49888723434621"/>
|
||||
<PCell targetCategory="1" parameterName="p27" df="1" beta="-25.0881888771411"/>
|
||||
<PCell targetCategory="1" parameterName="p28" df="1" beta="3.94788869705806"/>
|
||||
<PCell targetCategory="1" parameterName="p29" df="1" beta="5.18310430996772"/>
|
||||
<PCell targetCategory="1" parameterName="p30" df="1" beta="-0.68284522300847"/>
|
||||
<PCell targetCategory="1" parameterName="p31" df="1" beta="-1.72529225894007"/>
|
||||
<PCell targetCategory="1" parameterName="p32" df="1" beta="-16.3480035316266"/>
|
||||
<PCell targetCategory="1" parameterName="p33" df="1" beta="-5.86411015097126"/>
|
||||
<PCell targetCategory="1" parameterName="p34" df="1" beta="4.93985330940277"/>
|
||||
<PCell targetCategory="1" parameterName="p35" df="1" beta="1.82582786735218"/>
|
||||
<PCell targetCategory="1" parameterName="p36" df="1" beta="-0.371429538742514"/>
|
||||
<PCell targetCategory="1" parameterName="p37" df="1" beta="2.53624851594612"/>
|
||||
<PCell targetCategory="1" parameterName="p38" df="1" beta="-18.3934652416506"/>
|
||||
<PCell targetCategory="1" parameterName="p39" df="1" beta="4.34806845026564"/>
|
||||
<PCell targetCategory="1" parameterName="p40" df="1" beta="-1.66010494002974"/>
|
||||
<PCell targetCategory="1" parameterName="p41" df="1" beta="7.94646704240503e-06"/>
|
||||
<PCell targetCategory="1" parameterName="p42" df="1" beta="-0.539268105380176"/>
|
||||
<PCell targetCategory="1" parameterName="p43" df="1" beta="0.0045386083915094"/>
|
||||
<PCell targetCategory="1" parameterName="p44" df="1" beta="0.146374393466741"/>
|
||||
</ParamMatrix>
|
||||
</GeneralRegressionModel>
|
||||
</PMML>
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -0,0 +1,190 @@
|
|||
#region Copyright Syncfusion Inc. 2001-2018.
|
||||
// Copyright Syncfusion Inc. 2001-2018. All rights reserved.
|
||||
// Use of this code is subject to the terms of our license.
|
||||
// A copy of the current license can be obtained at any time by e-mailing
|
||||
// licensing@syncfusion.com. Any infringement will be prosecuted under
|
||||
// applicable laws.
|
||||
#endregion
|
||||
using Syncfusion.PMML;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
namespace AuditLogitClassification
|
||||
{
|
||||
/// <summary>
|
||||
/// Console program to demonstrate PMML execution engine
|
||||
/// </summary>
|
||||
public class Program
|
||||
{
|
||||
//Create Table instance for input, output and R Result
|
||||
public Table inputTable = null;
|
||||
|
||||
private Table outputTable = null;
|
||||
private Table rResults = null;
|
||||
|
||||
#if CONSOLE
|
||||
|
||||
private static void Main(string[] args)
|
||||
{
|
||||
//Create instance
|
||||
Program program = new Program();
|
||||
//Load input csv
|
||||
program.inputTable = new Table("../../Model/Audit.csv", true, ',');
|
||||
//Invoke PredictResult
|
||||
program.outputTable = program.PredictResult(program.inputTable,
|
||||
"../../Model/Audit.pmml");
|
||||
//Compare predicted results of PMML execution engine with R Results
|
||||
//Dispose the inputTable values
|
||||
program.inputTable.Dispose();
|
||||
program.ComparePredictedResultsWithR("../../Model/ROutput.csv");
|
||||
//Write the Result as CSV Table
|
||||
program.outputTable.WriteToCSV("../../Model/PredictedOutput.csv", true, ',');
|
||||
//Dispose the output Table
|
||||
program.outputTable.Dispose();
|
||||
//Display the result saved location
|
||||
Console.WriteLine("\nResult saved in : " + Path.GetFullPath("../../Model/PredictedOutput.csv"));
|
||||
Console.ReadKey();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#region PredictResult
|
||||
|
||||
/// <summary>
|
||||
/// Predicts the results for given PMML and CSV file and serialize the results in a CSV file
|
||||
/// </summary>
|
||||
public Table PredictResult(Table inputTable, string pmmlPath)
|
||||
{
|
||||
//Get PMML Evaluator instance
|
||||
PMMLEvaluator evaluator = new PMMLEvaluatorFactory().
|
||||
GetPMMLEvaluatorInstance(pmmlPath);
|
||||
|
||||
string[] predictedCategories = null;
|
||||
|
||||
//Predict the value for each record using the PMML Evaluator instance
|
||||
for (int i = 0; i < inputTable.RowCount; i++)
|
||||
{
|
||||
var audit = GetDataObject(inputTable, i);
|
||||
|
||||
//Get result
|
||||
PredictedResult predictedResult = evaluator.GetResult(audit, null);
|
||||
|
||||
if (i == 0)
|
||||
{
|
||||
//Get the predicted propability fields
|
||||
predictedCategories = predictedResult.GetPredictedCategories();
|
||||
//Initialize the output table
|
||||
InitializeTable(inputTable.RowCount, predictedResult.PredictedField, predictedCategories);
|
||||
}
|
||||
|
||||
//Add predicted value
|
||||
outputTable[i, 0] = predictedResult.PredictedValue;
|
||||
|
||||
for (int j = 1; j <= predictedCategories.Length; j++)
|
||||
outputTable[i, j] = predictedResult.GetPredictedProbability(predictedCategories[j - 1]);
|
||||
}
|
||||
return outputTable;
|
||||
}
|
||||
|
||||
#endregion PredictResult
|
||||
|
||||
#region Compare Predicted Results With R
|
||||
|
||||
/// <summary>
|
||||
/// Compare predicted results of PMML execution engine with R results
|
||||
/// </summary>
|
||||
|
||||
public void ComparePredictedResultsWithR(string rOutputDataCSVPath)
|
||||
{
|
||||
//Create instance to hold results of R
|
||||
rResults = new Table(rOutputDataCSVPath, true, ',');
|
||||
string differentIndices = string.Empty;
|
||||
//Pass the Table to the compare method of resultTable
|
||||
bool isDifferent = Compare(rResults, 1, 0, ref differentIndices);
|
||||
//Display mismatched index
|
||||
#if CONSOLE
|
||||
if (isDifferent)
|
||||
{
|
||||
Console.WriteLine("\nDifference in predicted results by R and PMML execution engine");
|
||||
Console.WriteLine("\nDifferent indices are " + differentIndices);
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("\nBoth predicted results by R and PMML execution engine are equal");
|
||||
}
|
||||
//Dispose the R results Table
|
||||
#endif
|
||||
rResults.Dispose();
|
||||
}
|
||||
|
||||
#endregion Compare Predicted Results With R
|
||||
|
||||
#region Initialize OutputTable
|
||||
|
||||
/// <summary>
|
||||
/// Initialize the outputTable
|
||||
/// </summary>
|
||||
/// <param name="rowCount">rowCount of output table</param>
|
||||
/// <param name="predictedfield">predictedfield name</param>
|
||||
/// <param name="predictedCategories">probableFields</param>
|
||||
private void InitializeTable(int rowCount, string predictedfield, string[] predictedCategories)
|
||||
{
|
||||
//Create instance to hold evaluated results
|
||||
outputTable = new Table(rowCount, predictedCategories.Length + 1);
|
||||
//Add predicted column names
|
||||
outputTable.ColumnNames[0] = "Predicted_" + predictedfield;
|
||||
outputTable.ColumnNames[1] = "AuditLowriskProbability";
|
||||
outputTable.ColumnNames[2] = "AuditHighriskProbability";
|
||||
}
|
||||
|
||||
#endregion Initialize OutputTable
|
||||
|
||||
#region GetDataObject
|
||||
|
||||
/// <summary>
|
||||
/// Returns the row as anonymous object
|
||||
/// </summary>
|
||||
/// <param name="inputTable"> input Table values</param>
|
||||
/// <param name="row">input row</param>
|
||||
/// <returns>Anonymous object</returns>
|
||||
public Dictionary<string, object> GetDataObject(Table inputTable, int row)
|
||||
{
|
||||
Dictionary<string, object> audit = new Dictionary<string, object>();
|
||||
for (int i = 0; i < inputTable.ColumnCount; i++)
|
||||
{
|
||||
audit.Add(inputTable.ColumnNames[i], inputTable[row, inputTable.ColumnNames[i]]);
|
||||
}
|
||||
return audit;
|
||||
}
|
||||
|
||||
#endregion GetDataObject
|
||||
|
||||
#region Compare
|
||||
|
||||
/// <summary>
|
||||
/// Compares the result of 2 Tables based on column index.
|
||||
/// </summary>
|
||||
/// <param name="rOutput">R output table</param>
|
||||
/// <param name="rColumnIndex">R's Column to be compared</param>
|
||||
/// <param name="predictedColumnIndex">predicted result's column index</param>
|
||||
/// <param name="differentIndices"> different indices</param>
|
||||
public bool Compare(Table table, int rColumnIndex, int predictedColumnIndex, ref string differentIndices)
|
||||
{
|
||||
bool isDifferent = false;
|
||||
//Compare predicted values
|
||||
for (int i = 0; i < table.RowCount; i++)
|
||||
{
|
||||
//Compare Results based on column index
|
||||
if (outputTable[i, predictedColumnIndex].ToString() != table[i, rColumnIndex].ToString())
|
||||
{
|
||||
differentIndices += ", " + i;
|
||||
isDifferent = true;
|
||||
}
|
||||
}
|
||||
return isDifferent;
|
||||
}
|
||||
|
||||
#endregion Compare
|
||||
}
|
||||
}
|
|
@ -0,0 +1,74 @@
|
|||
# Copyright Syncfusion Inc. 2001 - 2016. All rights reserved.
|
||||
# Use of this code is subject to the terms of our license.
|
||||
# A copy of the current license can be obtained at any time by e-mailing
|
||||
# licensing@syncfusion.com. Any infringement will be prosecuted under
|
||||
# applicable laws.
|
||||
|
||||
|
||||
# If you are not familiar with R you can obtain a quick introduction by downloading
|
||||
# R Succinctly for free from Syncfusion - http://www.syncfusion.com/resources/techportal/ebooks/rsuccinctly
|
||||
# R Succinctly is also included with this installation and is available here
|
||||
# Installed Drive :\Program Files (x86)\Syncfusion\Essential Studio\XX.X.X.XX\Infrastructure\EBooks\R_Succintly.pdf OF R Succinctly
|
||||
# Uncomment below lines to install necessary packages if not installed already
|
||||
# install.packages("pmml")
|
||||
# install.packages("gmodels")
|
||||
# install.packages("e1071")
|
||||
|
||||
# Load below packages
|
||||
library(pmml)
|
||||
library(gmodels)
|
||||
library(e1071)
|
||||
|
||||
# Here we directly load the audit dataset installed with the "pmml" package.
|
||||
data(audit)
|
||||
|
||||
# rename column names in audit dataset from pmml package
|
||||
auditOriginal <- setNames(audit, c("ID", "Age", "Employment", "Education", "Marital", "Occupation", "Income", "Sex", "Deductions", "Hours",
|
||||
"Accounts", "Adjustment", "Adjusted"))
|
||||
|
||||
# Omit rows with missing values
|
||||
auditOriginal = na.omit(auditOriginal)
|
||||
|
||||
# Code below demonstrates loading the same dataset from a CSV file shipped with our installer.
|
||||
# Please check installed samples (Data) location to set actual working directory
|
||||
# Uncomment below lines and comment out the code to read data from CSV file.
|
||||
# setwd("C:/actual_data_location")
|
||||
# audit= read.csv("Audit.csv")
|
||||
|
||||
# Randomizing data
|
||||
audit<-auditOriginal[sample(nrow(auditOriginal)),]
|
||||
|
||||
# Divide dataset for training and test
|
||||
trainData=audit[1:1487,]
|
||||
testData=audit[1488:1859,]
|
||||
|
||||
# Applying General Regression Model - logit function to predict Adjusted
|
||||
auditFormula = formula(Adjusted ~Age+ Employment + Education + Marital + Occupation + Income + Sex + Deductions + Hours)
|
||||
audit_GLM = glm(auditFormula, trainData, family = binomial(link="logit"))
|
||||
summary(audit_GLM)
|
||||
|
||||
# Display the predicted results and create cross table to check on accuracy
|
||||
# Predict "Adjusted" column probability for test data set
|
||||
auditTestProbabilities = predict(audit_GLM, type = "response",testData)
|
||||
# Display predicted probabilities
|
||||
auditTestProbabilities
|
||||
|
||||
# PMML generation
|
||||
pmmlFile<-pmml(audit_GLM, data=trainData)
|
||||
write(toString(pmmlFile), file="Audit.pmml")
|
||||
saveXML(pmmlFile, file="Audit.pmml")
|
||||
|
||||
# The code below is used for evaluation purpose.
|
||||
# The model is applied for original audit data set and predicted results are saved in "ROutput.csv"
|
||||
# "ROutput.csv" file used for comparing the R results with PMML Evaluation engine results
|
||||
|
||||
# Applying General Regression model to entire dataset and save the results in a CSV file
|
||||
auditEntireProbabilities = predict(audit_GLM, type = "response",auditOriginal)
|
||||
|
||||
# Save predicted value in a data frame
|
||||
result = data.frame(auditEntireProbabilities)
|
||||
names(result) = c("Predicted_Adjusted")
|
||||
|
||||
# Write the results in a CSV file
|
||||
write.csv(result,"ROutput.csv",quote=F)
|
||||
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -0,0 +1,240 @@
|
|||
<?xml version="1.0"?>
|
||||
<PMML version="4.3" xmlns="http://www.dmg.org/PMML-4_3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.dmg.org/PMML-4_3 http://www.dmg.org/pmml/v4-3/pmml-4-3.xsd">
|
||||
<Header copyright="Copyright (c) 2017 Syncfusion" description="Generalized Linear Regression Model">
|
||||
<Extension name="user" value="Syncfusion" extender="Rattle/PMML"/>
|
||||
<Application name="Rattle/PMML" version="1.4"/>
|
||||
<Timestamp>2017-11-07 17:30:31</Timestamp>
|
||||
</Header>
|
||||
<DataDictionary numberOfFields="10">
|
||||
<DataField name="Adjusted" optype="continuous" dataType="double"/>
|
||||
<DataField name="Age" optype="continuous" dataType="double"/>
|
||||
<DataField name="Employment" optype="categorical" dataType="string">
|
||||
<Value value="Consultant"/>
|
||||
<Value value="Private"/>
|
||||
<Value value="PSFederal"/>
|
||||
<Value value="PSLocal"/>
|
||||
<Value value="PSState"/>
|
||||
<Value value="SelfEmp"/>
|
||||
<Value value="Volunteer"/>
|
||||
</DataField>
|
||||
<DataField name="Education" optype="categorical" dataType="string">
|
||||
<Value value="Associate"/>
|
||||
<Value value="Bachelor"/>
|
||||
<Value value="College"/>
|
||||
<Value value="Doctorate"/>
|
||||
<Value value="HSgrad"/>
|
||||
<Value value="Master"/>
|
||||
<Value value="Preschool"/>
|
||||
<Value value="Professional"/>
|
||||
<Value value="Vocational"/>
|
||||
<Value value="Yr10"/>
|
||||
<Value value="Yr11"/>
|
||||
<Value value="Yr12"/>
|
||||
<Value value="Yr1t4"/>
|
||||
<Value value="Yr5t6"/>
|
||||
<Value value="Yr7t8"/>
|
||||
<Value value="Yr9"/>
|
||||
</DataField>
|
||||
<DataField name="Marital" optype="categorical" dataType="string">
|
||||
<Value value="Absent"/>
|
||||
<Value value="Divorced"/>
|
||||
<Value value="Married"/>
|
||||
<Value value="Married-spouse-absent"/>
|
||||
<Value value="Unmarried"/>
|
||||
<Value value="Widowed"/>
|
||||
</DataField>
|
||||
<DataField name="Occupation" optype="categorical" dataType="string">
|
||||
<Value value="Cleaner"/>
|
||||
<Value value="Clerical"/>
|
||||
<Value value="Executive"/>
|
||||
<Value value="Farming"/>
|
||||
<Value value="Home"/>
|
||||
<Value value="Machinist"/>
|
||||
<Value value="Military"/>
|
||||
<Value value="Professional"/>
|
||||
<Value value="Protective"/>
|
||||
<Value value="Repair"/>
|
||||
<Value value="Sales"/>
|
||||
<Value value="Service"/>
|
||||
<Value value="Support"/>
|
||||
<Value value="Transport"/>
|
||||
</DataField>
|
||||
<DataField name="Income" optype="continuous" dataType="double"/>
|
||||
<DataField name="Sex" optype="categorical" dataType="string">
|
||||
<Value value="Female"/>
|
||||
<Value value="Male"/>
|
||||
</DataField>
|
||||
<DataField name="Deductions" optype="continuous" dataType="double"/>
|
||||
<DataField name="Hours" optype="continuous" dataType="double"/>
|
||||
</DataDictionary>
|
||||
<GeneralRegressionModel modelName="General_Regression_Model" modelType="generalizedLinear" functionName="regression" algorithmName="glm" distribution="binomial" linkFunction="logit">
|
||||
<MiningSchema>
|
||||
<MiningField name="Adjusted" usageType="predicted"/>
|
||||
<MiningField name="Age" usageType="active"/>
|
||||
<MiningField name="Employment" usageType="active"/>
|
||||
<MiningField name="Education" usageType="active"/>
|
||||
<MiningField name="Marital" usageType="active"/>
|
||||
<MiningField name="Occupation" usageType="active"/>
|
||||
<MiningField name="Income" usageType="active"/>
|
||||
<MiningField name="Sex" usageType="active"/>
|
||||
<MiningField name="Deductions" usageType="active"/>
|
||||
<MiningField name="Hours" usageType="active"/>
|
||||
</MiningSchema>
|
||||
<Output>
|
||||
<OutputField name="Predicted_Adjusted" feature="predictedValue"/>
|
||||
</Output>
|
||||
<ParameterList>
|
||||
<Parameter name="p0" label="(Intercept)"/>
|
||||
<Parameter name="p1" label="Age"/>
|
||||
<Parameter name="p2" label="EmploymentPrivate"/>
|
||||
<Parameter name="p3" label="EmploymentPSFederal"/>
|
||||
<Parameter name="p4" label="EmploymentPSLocal"/>
|
||||
<Parameter name="p5" label="EmploymentPSState"/>
|
||||
<Parameter name="p6" label="EmploymentSelfEmp"/>
|
||||
<Parameter name="p7" label="EmploymentVolunteer"/>
|
||||
<Parameter name="p8" label="EducationBachelor"/>
|
||||
<Parameter name="p9" label="EducationCollege"/>
|
||||
<Parameter name="p10" label="EducationDoctorate"/>
|
||||
<Parameter name="p11" label="EducationHSgrad"/>
|
||||
<Parameter name="p12" label="EducationMaster"/>
|
||||
<Parameter name="p13" label="EducationPreschool"/>
|
||||
<Parameter name="p14" label="EducationProfessional"/>
|
||||
<Parameter name="p15" label="EducationVocational"/>
|
||||
<Parameter name="p16" label="EducationYr10"/>
|
||||
<Parameter name="p17" label="EducationYr11"/>
|
||||
<Parameter name="p18" label="EducationYr12"/>
|
||||
<Parameter name="p19" label="EducationYr1t4"/>
|
||||
<Parameter name="p20" label="EducationYr5t6"/>
|
||||
<Parameter name="p21" label="EducationYr7t8"/>
|
||||
<Parameter name="p22" label="EducationYr9"/>
|
||||
<Parameter name="p23" label="MaritalDivorced"/>
|
||||
<Parameter name="p24" label="MaritalMarried"/>
|
||||
<Parameter name="p25" label="MaritalMarried-spouse-absent"/>
|
||||
<Parameter name="p26" label="MaritalUnmarried"/>
|
||||
<Parameter name="p27" label="MaritalWidowed"/>
|
||||
<Parameter name="p28" label="OccupationClerical"/>
|
||||
<Parameter name="p29" label="OccupationExecutive"/>
|
||||
<Parameter name="p30" label="OccupationFarming"/>
|
||||
<Parameter name="p31" label="OccupationHome"/>
|
||||
<Parameter name="p32" label="OccupationMachinist"/>
|
||||
<Parameter name="p33" label="OccupationMilitary"/>
|
||||
<Parameter name="p34" label="OccupationProfessional"/>
|
||||
<Parameter name="p35" label="OccupationProtective"/>
|
||||
<Parameter name="p36" label="OccupationRepair"/>
|
||||
<Parameter name="p37" label="OccupationSales"/>
|
||||
<Parameter name="p38" label="OccupationService"/>
|
||||
<Parameter name="p39" label="OccupationSupport"/>
|
||||
<Parameter name="p40" label="OccupationTransport"/>
|
||||
<Parameter name="p41" label="Income"/>
|
||||
<Parameter name="p42" label="SexMale"/>
|
||||
<Parameter name="p43" label="Deductions"/>
|
||||
<Parameter name="p44" label="Hours"/>
|
||||
</ParameterList>
|
||||
<FactorList>
|
||||
<Predictor name="Employment"/>
|
||||
<Predictor name="Education"/>
|
||||
<Predictor name="Marital"/>
|
||||
<Predictor name="Occupation"/>
|
||||
<Predictor name="Sex"/>
|
||||
</FactorList>
|
||||
<CovariateList>
|
||||
<Predictor name="Age"/>
|
||||
<Predictor name="Income"/>
|
||||
<Predictor name="Deductions"/>
|
||||
<Predictor name="Hours"/>
|
||||
</CovariateList>
|
||||
<PPMatrix>
|
||||
<PPCell value="1" predictorName="Age" parameterName="p1"/>
|
||||
<PPCell value="Private" predictorName="Employment" parameterName="p2"/>
|
||||
<PPCell value="PSFederal" predictorName="Employment" parameterName="p3"/>
|
||||
<PPCell value="PSLocal" predictorName="Employment" parameterName="p4"/>
|
||||
<PPCell value="PSState" predictorName="Employment" parameterName="p5"/>
|
||||
<PPCell value="SelfEmp" predictorName="Employment" parameterName="p6"/>
|
||||
<PPCell value="Volunteer" predictorName="Employment" parameterName="p7"/>
|
||||
<PPCell value="Bachelor" predictorName="Education" parameterName="p8"/>
|
||||
<PPCell value="College" predictorName="Education" parameterName="p9"/>
|
||||
<PPCell value="Doctorate" predictorName="Education" parameterName="p10"/>
|
||||
<PPCell value="HSgrad" predictorName="Education" parameterName="p11"/>
|
||||
<PPCell value="Master" predictorName="Education" parameterName="p12"/>
|
||||
<PPCell value="Preschool" predictorName="Education" parameterName="p13"/>
|
||||
<PPCell value="Professional" predictorName="Education" parameterName="p14"/>
|
||||
<PPCell value="Vocational" predictorName="Education" parameterName="p15"/>
|
||||
<PPCell value="Yr10" predictorName="Education" parameterName="p16"/>
|
||||
<PPCell value="Yr11" predictorName="Education" parameterName="p17"/>
|
||||
<PPCell value="Yr12" predictorName="Education" parameterName="p18"/>
|
||||
<PPCell value="Yr1t4" predictorName="Education" parameterName="p19"/>
|
||||
<PPCell value="Yr5t6" predictorName="Education" parameterName="p20"/>
|
||||
<PPCell value="Yr7t8" predictorName="Education" parameterName="p21"/>
|
||||
<PPCell value="Yr9" predictorName="Education" parameterName="p22"/>
|
||||
<PPCell value="Divorced" predictorName="Marital" parameterName="p23"/>
|
||||
<PPCell value="Married" predictorName="Marital" parameterName="p24"/>
|
||||
<PPCell value="Married-spouse-absent" predictorName="Marital" parameterName="p25"/>
|
||||
<PPCell value="Unmarried" predictorName="Marital" parameterName="p26"/>
|
||||
<PPCell value="Widowed" predictorName="Marital" parameterName="p27"/>
|
||||
<PPCell value="Clerical" predictorName="Occupation" parameterName="p28"/>
|
||||
<PPCell value="Executive" predictorName="Occupation" parameterName="p29"/>
|
||||
<PPCell value="Farming" predictorName="Occupation" parameterName="p30"/>
|
||||
<PPCell value="Home" predictorName="Occupation" parameterName="p31"/>
|
||||
<PPCell value="Machinist" predictorName="Occupation" parameterName="p32"/>
|
||||
<PPCell value="Military" predictorName="Occupation" parameterName="p33"/>
|
||||
<PPCell value="Professional" predictorName="Occupation" parameterName="p34"/>
|
||||
<PPCell value="Protective" predictorName="Occupation" parameterName="p35"/>
|
||||
<PPCell value="Repair" predictorName="Occupation" parameterName="p36"/>
|
||||
<PPCell value="Sales" predictorName="Occupation" parameterName="p37"/>
|
||||
<PPCell value="Service" predictorName="Occupation" parameterName="p38"/>
|
||||
<PPCell value="Support" predictorName="Occupation" parameterName="p39"/>
|
||||
<PPCell value="Transport" predictorName="Occupation" parameterName="p40"/>
|
||||
<PPCell value="1" predictorName="Income" parameterName="p41"/>
|
||||
<PPCell value="Male" predictorName="Sex" parameterName="p42"/>
|
||||
<PPCell value="1" predictorName="Deductions" parameterName="p43"/>
|
||||
<PPCell value="1" predictorName="Hours" parameterName="p44"/>
|
||||
</PPMatrix>
|
||||
<ParamMatrix>
|
||||
<PCell parameterName="p0" df="1" beta="-19.8844016643017"/>
|
||||
<PCell parameterName="p1" df="1" beta="0.0876322209343854"/>
|
||||
<PCell parameterName="p2" df="1" beta="1.55207385982048"/>
|
||||
<PCell parameterName="p3" df="1" beta="1.81631553114794"/>
|
||||
<PCell parameterName="p4" df="1" beta="2.24444287399612"/>
|
||||
<PCell parameterName="p5" df="1" beta="1.52374901152432"/>
|
||||
<PCell parameterName="p6" df="1" beta="2.02903897038269"/>
|
||||
<PCell parameterName="p7" df="1" beta="-19.525188445115"/>
|
||||
<PCell parameterName="p8" df="1" beta="1.53746822364198"/>
|
||||
<PCell parameterName="p9" df="1" beta="-1.51158384610751"/>
|
||||
<PCell parameterName="p10" df="1" beta="1.91018151822226"/>
|
||||
<PCell parameterName="p11" df="1" beta="-2.56204536077167"/>
|
||||
<PCell parameterName="p12" df="1" beta="1.54808709872643"/>
|
||||
<PCell parameterName="p13" df="1" beta="-1.09677086079088"/>
|
||||
<PCell parameterName="p14" df="1" beta="3.70528943759944"/>
|
||||
<PCell parameterName="p15" df="1" beta="-0.768470341378808"/>
|
||||
<PCell parameterName="p16" df="1" beta="-18.2461152797016"/>
|
||||
<PCell parameterName="p17" df="1" beta="-18.3426220434904"/>
|
||||
<PCell parameterName="p18" df="1" beta="0.958873975496607"/>
|
||||
<PCell parameterName="p19" df="1" beta="-19.9052891077836"/>
|
||||
<PCell parameterName="p20" df="1" beta="-18.8604618504479"/>
|
||||
<PCell parameterName="p21" df="1" beta="-16.3180963039868"/>
|
||||
<PCell parameterName="p22" df="1" beta="-20.445139931598"/>
|
||||
<PCell parameterName="p23" df="1" beta="-1.50228353044729"/>
|
||||
<PCell parameterName="p24" df="1" beta="7.63015739058558"/>
|
||||
<PCell parameterName="p25" df="1" beta="-15.1995517467022"/>
|
||||
<PCell parameterName="p26" df="1" beta="-14.999508961005"/>
|
||||
<PCell parameterName="p27" df="1" beta="-19.8683741998288"/>
|
||||
<PCell parameterName="p28" df="1" beta="3.10844872676852"/>
|
||||
<PCell parameterName="p29" df="1" beta="4.6341442748623"/>
|
||||
<PCell parameterName="p30" df="1" beta="0.110776941512912"/>
|
||||
<PCell parameterName="p31" df="1" beta="-4.35489600250972"/>
|
||||
<PCell parameterName="p32" df="1" beta="-16.1250270551448"/>
|
||||
<PCell parameterName="p33" df="1" beta="-8.15304780607929"/>
|
||||
<PCell parameterName="p34" df="1" beta="4.55506250372595"/>
|
||||
<PCell parameterName="p35" df="1" beta="2.2104899853198"/>
|
||||
<PCell parameterName="p36" df="1" beta="0.261795032255297"/>
|
||||
<PCell parameterName="p37" df="1" beta="2.36592186713347"/>
|
||||
<PCell parameterName="p38" df="1" beta="-17.3799893703496"/>
|
||||
<PCell parameterName="p39" df="1" beta="3.51562678154425"/>
|
||||
<PCell parameterName="p40" df="1" beta="-1.41436568989102"/>
|
||||
<PCell parameterName="p41" df="1" beta="5.94423431031975e-06"/>
|
||||
<PCell parameterName="p42" df="1" beta="0.180308166151458"/>
|
||||
<PCell parameterName="p43" df="1" beta="0.00338565157473663"/>
|
||||
<PCell parameterName="p44" df="1" beta="0.0836911058907245"/>
|
||||
</ParamMatrix>
|
||||
</GeneralRegressionModel>
|
||||
</PMML>
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -0,0 +1,191 @@
|
|||
#region Copyright Syncfusion Inc. 2001-2018.
|
||||
// Copyright Syncfusion Inc. 2001-2018. All rights reserved.
|
||||
// Use of this code is subject to the terms of our license.
|
||||
// A copy of the current license can be obtained at any time by e-mailing
|
||||
// licensing@syncfusion.com. Any infringement will be prosecuted under
|
||||
// applicable laws.
|
||||
#endregion
|
||||
using Syncfusion.PMML;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
namespace AuditLogitRegression
|
||||
{
|
||||
/// <summary>
|
||||
/// Console program to demonstrate PMML execution engine
|
||||
/// </summary>
|
||||
public class Program
|
||||
{
|
||||
//Create Table instance for input, output and R Result
|
||||
public Table inputTable = null;
|
||||
|
||||
private Table outputTable = null;
|
||||
private Table rResults = null;
|
||||
|
||||
#if CONSOLE
|
||||
|
||||
private static void Main(string[] args)
|
||||
{
|
||||
//Create instance
|
||||
Program program = new Program();
|
||||
//Load input csv
|
||||
program.inputTable = new Table("../../Model/Audit.csv", true, ',');
|
||||
//Invoke PredictResult
|
||||
program.outputTable = program.PredictResult(program.inputTable,
|
||||
"../../Model/Audit.pmml");
|
||||
//Dispose the inputTable values
|
||||
program.inputTable.Dispose();
|
||||
//Compare predicted results of PMML execution engine with R Results
|
||||
program.ComparePredictedResultsWithR("../../Model/ROutput.csv");
|
||||
//Write the Result as CSV Table
|
||||
program.outputTable.WriteToCSV("../../Model/PredictedOutput.csv", true, ',');
|
||||
//Dispose the output Table
|
||||
program.outputTable.Dispose();
|
||||
//Display the result saved location
|
||||
Console.WriteLine("\nResult saved in : " + Path.GetFullPath("../../Model/PredictedOutput.csv"));
|
||||
Console.ReadKey();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#region PredictResult
|
||||
|
||||
/// <summary>
|
||||
/// Predicts the results for given PMML and CSV file and serialize the results in a CSV file
|
||||
/// </summary>
|
||||
public Table PredictResult(Table inputTable, string pmmlPath)
|
||||
{
|
||||
//Get PMML Evaluator instance
|
||||
PMMLEvaluator evaluator = new PMMLEvaluatorFactory().
|
||||
GetPMMLEvaluatorInstance(pmmlPath);
|
||||
|
||||
string[] predictedCategories = null;
|
||||
|
||||
//Predict the value for each record using the PMML Evaluator instance
|
||||
for (int i = 0; i < inputTable.RowCount; i++)
|
||||
{
|
||||
var audit = GetDataObject(inputTable, i);
|
||||
|
||||
//Get result
|
||||
PredictedResult predictedResult = evaluator.GetResult(audit, null);
|
||||
|
||||
if (i == 0)
|
||||
{
|
||||
//Get the predicted propability fields
|
||||
predictedCategories = predictedResult.GetPredictedCategories();
|
||||
//Initialize the output table
|
||||
InitializeTable(inputTable.RowCount, predictedResult.PredictedField, predictedCategories);
|
||||
}
|
||||
|
||||
//Add predicted value
|
||||
outputTable[i, 0] = predictedResult.PredictedValue;
|
||||
|
||||
}
|
||||
return outputTable;
|
||||
}
|
||||
|
||||
#endregion PredictResult
|
||||
|
||||
#region Compare Predicted Results With R
|
||||
|
||||
/// <summary>
|
||||
/// Compare predicted results of PMML execution engine with R results
|
||||
/// </summary>
|
||||
|
||||
public void ComparePredictedResultsWithR(string rOutputDataCSVPath)
|
||||
{
|
||||
//Create instance to hold results of R
|
||||
rResults = new Table(rOutputDataCSVPath, true, ',');
|
||||
string differentIndices = string.Empty;
|
||||
//Pass the Table to the compare method of resultTable
|
||||
bool isDifferent = Compare(rResults, 1, 0, ref differentIndices);
|
||||
//Display mismatched index
|
||||
#if CONSOLE
|
||||
if (isDifferent)
|
||||
{
|
||||
Console.WriteLine("\nDifference in predicted results by R and PMML execution engine");
|
||||
Console.WriteLine("\nDifferent indices are " + differentIndices);
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("\nBoth predicted results by R and PMML execution engine are equal");
|
||||
}
|
||||
#endif
|
||||
//Dispose the R results Table
|
||||
rResults.Dispose();
|
||||
|
||||
}
|
||||
|
||||
#endregion Compare Predicted Results With R
|
||||
|
||||
#region Initialize OutputTable
|
||||
|
||||
/// <summary>
|
||||
/// Initialize the outputTable
|
||||
/// </summary>
|
||||
/// <param name="rowCount">rowCount of output table</param>
|
||||
/// <param name="predictedfield">predictedfield name</param>
|
||||
/// <param name="predictedCategories">probableFields</param>
|
||||
private void InitializeTable(int rowCount, string predictedfield, string[] predictedCategories)
|
||||
{
|
||||
//Create instance to hold evaluated results
|
||||
outputTable = new Table(rowCount, predictedCategories.Length + 1);
|
||||
//Add predicted column names
|
||||
outputTable.ColumnNames[0] = "Predicted_" + predictedfield;
|
||||
}
|
||||
|
||||
#endregion Initialize OutputTable
|
||||
|
||||
#region GetDataObject
|
||||
|
||||
/// <summary>
|
||||
/// Returns the row as anonymous object
|
||||
/// </summary>
|
||||
/// <param name="inputTable"> input Table values</param>
|
||||
/// <param name="row">input row</param>
|
||||
/// <returns>Anonymous object</returns>
|
||||
public Dictionary<string, object> GetDataObject(Table inputTable, int row)
|
||||
{
|
||||
Dictionary<string, object> audit = new Dictionary<string, object>();
|
||||
for (int i = 0; i < inputTable.ColumnCount; i++)
|
||||
{
|
||||
audit.Add(inputTable.ColumnNames[i], inputTable[row, inputTable.ColumnNames[i]]);
|
||||
}
|
||||
return audit;
|
||||
}
|
||||
|
||||
#endregion GetDataObject
|
||||
|
||||
#region Compare
|
||||
|
||||
/// <summary>
|
||||
/// Compares the result of 2 Tables based on column index.
|
||||
/// </summary>
|
||||
/// <param name="rOutput">R output table</param>
|
||||
/// <param name="rColumnIndex">R's Column to be compared</param>
|
||||
/// <param name="predictedColumnIndex">predicted result's column index</param>
|
||||
/// <param name="differentIndices"> different indices</param>
|
||||
/// <returns>IsDifferent</returns>
|
||||
public bool Compare(Table table, int rColumnIndex, int predictedColumnIndex, ref string differentIndices)
|
||||
{
|
||||
bool isDifferent = false;
|
||||
//Compare predicted values
|
||||
for (int i = 0; i < table.RowCount; i++)
|
||||
{
|
||||
//Compare Results based on column index
|
||||
double predictedC = Math.Round(Convert.ToDouble(outputTable[i, predictedColumnIndex]), 2);
|
||||
double predictedR = Math.Round(Convert.ToDouble(table[i, rColumnIndex]), 2);
|
||||
if (predictedC != predictedR)
|
||||
{
|
||||
differentIndices += ", " + i;
|
||||
isDifferent = true;
|
||||
}
|
||||
}
|
||||
return isDifferent;
|
||||
}
|
||||
|
||||
#endregion Compare
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,127 @@
|
|||
# Copyright Syncfusion Inc. 2001 - 2016. All rights reserved.
|
||||
# Use of this code is subject to the terms of our license.
|
||||
# A copy of the current license can be obtained at any time by e-mailing
|
||||
# licensing@syncfusion.com. Any infringement will be prosecuted under
|
||||
# applicable laws.
|
||||
|
||||
|
||||
# If you are not familiar with R you can obtain a quick introduction by downloading
|
||||
# R Succinctly for free from Syncfusion - http://www.syncfusion.com/resources/techportal/ebooks/rsuccinctly
|
||||
# R Succinctly is also included with this installation and is available here
|
||||
# Installed Drive :\Program Files (x86)\Syncfusion\Essential Studio\XX.X.X.XX\Infrastructure\EBooks\R_Succintly.pdf OF R Succinctly
|
||||
# Uncomment below lines to install necessary packages if not installed already
|
||||
# install.packages("pmml")
|
||||
# install.packages("gmodels")
|
||||
# install.packages("ROCR")
|
||||
# install.packages("caret")
|
||||
# install.packages("e1071")
|
||||
|
||||
# Load below packages
|
||||
library(pmml)
|
||||
library(gmodels)
|
||||
library(ROCR)
|
||||
library(caret)
|
||||
library(e1071)
|
||||
|
||||
# Here we directly load the audit dataset installed with the "pmml" package.
|
||||
data(audit)
|
||||
|
||||
# rename column names in audit dataset from pmml package
|
||||
auditOriginal <- setNames(audit, c("ID", "Age", "Employment", "Education", "Marital", "Occupation", "Income", "Sex", "Deductions", "Hours",
|
||||
"Accounts", "Adjustment", "Adjusted"))
|
||||
|
||||
# Omit rows with missing values
|
||||
auditOriginal = na.omit(auditOriginal)
|
||||
|
||||
# Code below demonstrates loading the same dataset from a CSV file shipped with our installer.
|
||||
# Please check installed samples (Data) location to set actual working directory
|
||||
# Uncomment below lines and comment out the code to read data from CSV file.
|
||||
# setwd("C:/actual_data_location")
|
||||
# audit= read.csv("Audit.csv")
|
||||
|
||||
# Considering integer variable as factor
|
||||
auditOriginal[, "Adjusted"]=as.factor(auditOriginal[, "Adjusted"])
|
||||
|
||||
# Randomizing data
|
||||
audit<-auditOriginal[sample(nrow(auditOriginal)),]
|
||||
|
||||
# Divide dataset for training and test
|
||||
trainData=audit[1:1487,]
|
||||
testData=audit[1488:1859,]
|
||||
|
||||
# Applying General Regression Model - probit function to predict Adjusted
|
||||
auditFormula = formula(Adjusted ~ Age + Employment + Education + Marital + Occupation + Income + Sex + Deductions + Hours)
|
||||
audit_GLM = glm(auditFormula, trainData, family = quasibinomial(link="probit"))
|
||||
summary(audit_GLM)
|
||||
|
||||
# Display the predicted results and create cross table to check on accuracy
|
||||
# Predict "Adjusted" column probability for test data set
|
||||
auditTestProbabilities = predict(audit_GLM, type = "response",testData)
|
||||
# Display predicted probabilities
|
||||
auditTestProbabilities
|
||||
|
||||
# Categorize the probability for predicted value (0/1)
|
||||
auditTestPrediction = as.character(as.integer(auditTestProbabilities > 0.5))
|
||||
# Display predicted values
|
||||
auditTestPrediction
|
||||
|
||||
# Create cross table to check on accuracy.
|
||||
CrossTable(auditTestPrediction,testData$Adjusted, prop.chisq = FALSE, prop.t = FALSE, prop.r = FALSE,
|
||||
dnn = c('predicted', 'actual'))
|
||||
|
||||
# Generate ROC curve and calculate AUC value to predict the accuracy for Audit test dataset
|
||||
|
||||
# To create visualizations - ROC curve with "ROCR" package two vectors of data are needed,
|
||||
# The first vector must contain the class values - Adjusted column and
|
||||
# The second vector must contain the estimated probability of the positive class(AuditHighriskProbability)
|
||||
pred <- prediction(labels = testData$Adjusted, predictions = auditTestProbabilities)
|
||||
|
||||
# Using the perf performance object, we can visualize the ROC curve with R's plot() function
|
||||
perf <- performance(pred, measure = "tpr", x.measure = "fpr")
|
||||
|
||||
# Plot the ROC curve for the visualization
|
||||
plot(perf, main = "ROC curve for Audit Test Dataset", col = "blue", lwd = 3)
|
||||
|
||||
# To indicate reference line in the ROC plot
|
||||
abline(a = 0, b = 1, lwd = 2, lty = 2)
|
||||
|
||||
# We can use the ROCR package to calculate the AUC(Area under the ROC Curve)
|
||||
# To do so, we first need to create another performance object and specify measure = "auc", as shown in the following code:
|
||||
perf.auc <- performance(pred, measure = "auc")
|
||||
|
||||
# perf.auc is an object (specifically known as an S4 object) we need to use a special type of notation to access the values stored within.
|
||||
# S4 objects hold information in positions known as slots
|
||||
# The str() function can be used to see all slots for an object
|
||||
str(perf.auc)
|
||||
|
||||
# To access the AUC value, which is stored as a list in the y.values slot, we can use the @ notation along with the unlist() function, which simplifies lists to a vector of numeric values
|
||||
# Below AUC value is under the "outstanding" category
|
||||
unlist(perf.auc@y.values)
|
||||
|
||||
# View Specificity, Sensitivity and Accuracy information using confusionMatrix function from "caret" package
|
||||
confusionMatrix(auditTestPrediction,testData$Adjusted, positive = "1")
|
||||
|
||||
# PMML generation
|
||||
pmmlFile = pmml(audit_GLM , data=trainData)
|
||||
write(toString(pmmlFile) , file="Audit.pmml")
|
||||
saveXML(pmmlFile , file="Audit.pmml")
|
||||
|
||||
# The code below is used for evaluation purpose.
|
||||
# The model is applied for original audit data set and predicted results are saved in "ROutput.csv"
|
||||
# "ROutput.csv" file used for comparing the R results with PMML Evaluation engine results
|
||||
|
||||
# Applying General Regression model to entire dataset and save the results in a CSV file
|
||||
auditEntireProbabilities = predict(audit_GLM, type = "response",auditOriginal)
|
||||
|
||||
# Categorize the probability for predicted value (0/1)
|
||||
auditEntirePrediction = as.character(as.integer(auditEntireProbabilities > 0.5))
|
||||
|
||||
# Save predicted value in a data frame
|
||||
auditProbabilities = cbind(1 - auditEntireProbabilities , auditEntireProbabilities)
|
||||
result = data.frame(auditEntirePrediction , auditProbabilities)
|
||||
names(result) = c("Predicted_Adjusted" , "AuditLowriskProbability" , "AuditHighriskProbability")
|
||||
|
||||
# Write the results in a CSV file
|
||||
write.csv(result, "ROutput.csv" , quote=F)
|
||||
|
||||
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -0,0 +1,243 @@
|
|||
<?xml version="1.0"?>
|
||||
<PMML version="4.3" xmlns="http://www.dmg.org/PMML-4_3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.dmg.org/PMML-4_3 http://www.dmg.org/pmml/v4-3/pmml-4-3.xsd">
|
||||
<Header copyright="Copyright (c) 2017 Syncfusion" description="Generalized Linear Regression Model">
|
||||
<Extension name="user" value="Syncfusion" extender="Rattle/PMML"/>
|
||||
<Application name="Rattle/PMML" version="1.4"/>
|
||||
<Timestamp>2017-11-07 17:44:10</Timestamp>
|
||||
</Header>
|
||||
<DataDictionary numberOfFields="10">
|
||||
<DataField name="Adjusted" optype="categorical" dataType="string">
|
||||
<Value value="0"/>
|
||||
<Value value="1"/>
|
||||
</DataField>
|
||||
<DataField name="Age" optype="continuous" dataType="double"/>
|
||||
<DataField name="Employment" optype="categorical" dataType="string">
|
||||
<Value value="Consultant"/>
|
||||
<Value value="Private"/>
|
||||
<Value value="PSFederal"/>
|
||||
<Value value="PSLocal"/>
|
||||
<Value value="PSState"/>
|
||||
<Value value="SelfEmp"/>
|
||||
<Value value="Volunteer"/>
|
||||
</DataField>
|
||||
<DataField name="Education" optype="categorical" dataType="string">
|
||||
<Value value="Associate"/>
|
||||
<Value value="Bachelor"/>
|
||||
<Value value="College"/>
|
||||
<Value value="Doctorate"/>
|
||||
<Value value="HSgrad"/>
|
||||
<Value value="Master"/>
|
||||
<Value value="Preschool"/>
|
||||
<Value value="Professional"/>
|
||||
<Value value="Vocational"/>
|
||||
<Value value="Yr10"/>
|
||||
<Value value="Yr11"/>
|
||||
<Value value="Yr12"/>
|
||||
<Value value="Yr1t4"/>
|
||||
<Value value="Yr5t6"/>
|
||||
<Value value="Yr7t8"/>
|
||||
<Value value="Yr9"/>
|
||||
</DataField>
|
||||
<DataField name="Marital" optype="categorical" dataType="string">
|
||||
<Value value="Absent"/>
|
||||
<Value value="Divorced"/>
|
||||
<Value value="Married"/>
|
||||
<Value value="Married-spouse-absent"/>
|
||||
<Value value="Unmarried"/>
|
||||
<Value value="Widowed"/>
|
||||
</DataField>
|
||||
<DataField name="Occupation" optype="categorical" dataType="string">
|
||||
<Value value="Cleaner"/>
|
||||
<Value value="Clerical"/>
|
||||
<Value value="Executive"/>
|
||||
<Value value="Farming"/>
|
||||
<Value value="Home"/>
|
||||
<Value value="Machinist"/>
|
||||
<Value value="Military"/>
|
||||
<Value value="Professional"/>
|
||||
<Value value="Protective"/>
|
||||
<Value value="Repair"/>
|
||||
<Value value="Sales"/>
|
||||
<Value value="Service"/>
|
||||
<Value value="Support"/>
|
||||
<Value value="Transport"/>
|
||||
</DataField>
|
||||
<DataField name="Income" optype="continuous" dataType="double"/>
|
||||
<DataField name="Sex" optype="categorical" dataType="string">
|
||||
<Value value="Female"/>
|
||||
<Value value="Male"/>
|
||||
</DataField>
|
||||
<DataField name="Deductions" optype="continuous" dataType="double"/>
|
||||
<DataField name="Hours" optype="continuous" dataType="double"/>
|
||||
</DataDictionary>
|
||||
<GeneralRegressionModel modelName="General_Regression_Model" modelType="generalizedLinear" functionName="regression" algorithmName="glm" linkFunction="probit">
|
||||
<MiningSchema>
|
||||
<MiningField name="Adjusted" usageType="predicted"/>
|
||||
<MiningField name="Age" usageType="active"/>
|
||||
<MiningField name="Employment" usageType="active"/>
|
||||
<MiningField name="Education" usageType="active"/>
|
||||
<MiningField name="Marital" usageType="active"/>
|
||||
<MiningField name="Occupation" usageType="active"/>
|
||||
<MiningField name="Income" usageType="active"/>
|
||||
<MiningField name="Sex" usageType="active"/>
|
||||
<MiningField name="Deductions" usageType="active"/>
|
||||
<MiningField name="Hours" usageType="active"/>
|
||||
</MiningSchema>
|
||||
<Output>
|
||||
<OutputField name="Predicted_Adjusted" feature="predictedValue"/>
|
||||
</Output>
|
||||
<ParameterList>
|
||||
<Parameter name="p0" label="(Intercept)"/>
|
||||
<Parameter name="p1" label="Age"/>
|
||||
<Parameter name="p2" label="EmploymentPrivate"/>
|
||||
<Parameter name="p3" label="EmploymentPSFederal"/>
|
||||
<Parameter name="p4" label="EmploymentPSLocal"/>
|
||||
<Parameter name="p5" label="EmploymentPSState"/>
|
||||
<Parameter name="p6" label="EmploymentSelfEmp"/>
|
||||
<Parameter name="p7" label="EmploymentVolunteer"/>
|
||||
<Parameter name="p8" label="EducationBachelor"/>
|
||||
<Parameter name="p9" label="EducationCollege"/>
|
||||
<Parameter name="p10" label="EducationDoctorate"/>
|
||||
<Parameter name="p11" label="EducationHSgrad"/>
|
||||
<Parameter name="p12" label="EducationMaster"/>
|
||||
<Parameter name="p13" label="EducationPreschool"/>
|
||||
<Parameter name="p14" label="EducationProfessional"/>
|
||||
<Parameter name="p15" label="EducationVocational"/>
|
||||
<Parameter name="p16" label="EducationYr10"/>
|
||||
<Parameter name="p17" label="EducationYr11"/>
|
||||
<Parameter name="p18" label="EducationYr12"/>
|
||||
<Parameter name="p19" label="EducationYr1t4"/>
|
||||
<Parameter name="p20" label="EducationYr5t6"/>
|
||||
<Parameter name="p21" label="EducationYr7t8"/>
|
||||
<Parameter name="p22" label="EducationYr9"/>
|
||||
<Parameter name="p23" label="MaritalDivorced"/>
|
||||
<Parameter name="p24" label="MaritalMarried"/>
|
||||
<Parameter name="p25" label="MaritalMarried-spouse-absent"/>
|
||||
<Parameter name="p26" label="MaritalUnmarried"/>
|
||||
<Parameter name="p27" label="MaritalWidowed"/>
|
||||
<Parameter name="p28" label="OccupationClerical"/>
|
||||
<Parameter name="p29" label="OccupationExecutive"/>
|
||||
<Parameter name="p30" label="OccupationFarming"/>
|
||||
<Parameter name="p31" label="OccupationHome"/>
|
||||
<Parameter name="p32" label="OccupationMachinist"/>
|
||||
<Parameter name="p33" label="OccupationMilitary"/>
|
||||
<Parameter name="p34" label="OccupationProfessional"/>
|
||||
<Parameter name="p35" label="OccupationProtective"/>
|
||||
<Parameter name="p36" label="OccupationRepair"/>
|
||||
<Parameter name="p37" label="OccupationSales"/>
|
||||
<Parameter name="p38" label="OccupationService"/>
|
||||
<Parameter name="p39" label="OccupationSupport"/>
|
||||
<Parameter name="p40" label="OccupationTransport"/>
|
||||
<Parameter name="p41" label="Income"/>
|
||||
<Parameter name="p42" label="SexMale"/>
|
||||
<Parameter name="p43" label="Deductions"/>
|
||||
<Parameter name="p44" label="Hours"/>
|
||||
</ParameterList>
|
||||
<FactorList>
|
||||
<Predictor name="Employment"/>
|
||||
<Predictor name="Education"/>
|
||||
<Predictor name="Marital"/>
|
||||
<Predictor name="Occupation"/>
|
||||
<Predictor name="Sex"/>
|
||||
</FactorList>
|
||||
<CovariateList>
|
||||
<Predictor name="Age"/>
|
||||
<Predictor name="Income"/>
|
||||
<Predictor name="Deductions"/>
|
||||
<Predictor name="Hours"/>
|
||||
</CovariateList>
|
||||
<PPMatrix>
|
||||
<PPCell value="1" predictorName="Age" parameterName="p1"/>
|
||||
<PPCell value="Private" predictorName="Employment" parameterName="p2"/>
|
||||
<PPCell value="PSFederal" predictorName="Employment" parameterName="p3"/>
|
||||
<PPCell value="PSLocal" predictorName="Employment" parameterName="p4"/>
|
||||
<PPCell value="PSState" predictorName="Employment" parameterName="p5"/>
|
||||
<PPCell value="SelfEmp" predictorName="Employment" parameterName="p6"/>
|
||||
<PPCell value="Volunteer" predictorName="Employment" parameterName="p7"/>
|
||||
<PPCell value="Bachelor" predictorName="Education" parameterName="p8"/>
|
||||
<PPCell value="College" predictorName="Education" parameterName="p9"/>
|
||||
<PPCell value="Doctorate" predictorName="Education" parameterName="p10"/>
|
||||
<PPCell value="HSgrad" predictorName="Education" parameterName="p11"/>
|
||||
<PPCell value="Master" predictorName="Education" parameterName="p12"/>
|
||||
<PPCell value="Preschool" predictorName="Education" parameterName="p13"/>
|
||||
<PPCell value="Professional" predictorName="Education" parameterName="p14"/>
|
||||
<PPCell value="Vocational" predictorName="Education" parameterName="p15"/>
|
||||
<PPCell value="Yr10" predictorName="Education" parameterName="p16"/>
|
||||
<PPCell value="Yr11" predictorName="Education" parameterName="p17"/>
|
||||
<PPCell value="Yr12" predictorName="Education" parameterName="p18"/>
|
||||
<PPCell value="Yr1t4" predictorName="Education" parameterName="p19"/>
|
||||
<PPCell value="Yr5t6" predictorName="Education" parameterName="p20"/>
|
||||
<PPCell value="Yr7t8" predictorName="Education" parameterName="p21"/>
|
||||
<PPCell value="Yr9" predictorName="Education" parameterName="p22"/>
|
||||
<PPCell value="Divorced" predictorName="Marital" parameterName="p23"/>
|
||||
<PPCell value="Married" predictorName="Marital" parameterName="p24"/>
|
||||
<PPCell value="Married-spouse-absent" predictorName="Marital" parameterName="p25"/>
|
||||
<PPCell value="Unmarried" predictorName="Marital" parameterName="p26"/>
|
||||
<PPCell value="Widowed" predictorName="Marital" parameterName="p27"/>
|
||||
<PPCell value="Clerical" predictorName="Occupation" parameterName="p28"/>
|
||||
<PPCell value="Executive" predictorName="Occupation" parameterName="p29"/>
|
||||
<PPCell value="Farming" predictorName="Occupation" parameterName="p30"/>
|
||||
<PPCell value="Home" predictorName="Occupation" parameterName="p31"/>
|
||||
<PPCell value="Machinist" predictorName="Occupation" parameterName="p32"/>
|
||||
<PPCell value="Military" predictorName="Occupation" parameterName="p33"/>
|
||||
<PPCell value="Professional" predictorName="Occupation" parameterName="p34"/>
|
||||
<PPCell value="Protective" predictorName="Occupation" parameterName="p35"/>
|
||||
<PPCell value="Repair" predictorName="Occupation" parameterName="p36"/>
|
||||
<PPCell value="Sales" predictorName="Occupation" parameterName="p37"/>
|
||||
<PPCell value="Service" predictorName="Occupation" parameterName="p38"/>
|
||||
<PPCell value="Support" predictorName="Occupation" parameterName="p39"/>
|
||||
<PPCell value="Transport" predictorName="Occupation" parameterName="p40"/>
|
||||
<PPCell value="1" predictorName="Income" parameterName="p41"/>
|
||||
<PPCell value="Male" predictorName="Sex" parameterName="p42"/>
|
||||
<PPCell value="1" predictorName="Deductions" parameterName="p43"/>
|
||||
<PPCell value="1" predictorName="Hours" parameterName="p44"/>
|
||||
</PPMatrix>
|
||||
<ParamMatrix>
|
||||
<PCell parameterName="p0" df="1" beta="-11.0458363299373"/>
|
||||
<PCell parameterName="p1" df="1" beta="0.0424090994332"/>
|
||||
<PCell parameterName="p2" df="1" beta="1.05917394718979"/>
|
||||
<PCell parameterName="p3" df="1" beta="0.533367229832231"/>
|
||||
<PCell parameterName="p4" df="1" beta="1.09979433985518"/>
|
||||
<PCell parameterName="p5" df="1" beta="1.47536848440153"/>
|
||||
<PCell parameterName="p6" df="1" beta="1.21818988174378"/>
|
||||
<PCell parameterName="p7" df="1" beta="-4.90630325359739"/>
|
||||
<PCell parameterName="p8" df="1" beta="0.685385169751532"/>
|
||||
<PCell parameterName="p9" df="1" beta="-1.09568179596492"/>
|
||||
<PCell parameterName="p10" df="1" beta="1.09706390434223"/>
|
||||
<PCell parameterName="p11" df="1" beta="-1.6442923697572"/>
|
||||
<PCell parameterName="p12" df="1" beta="1.02755405580061"/>
|
||||
<PCell parameterName="p13" df="1" beta="0.550278686421587"/>
|
||||
<PCell parameterName="p14" df="1" beta="2.06320407632045"/>
|
||||
<PCell parameterName="p15" df="1" beta="-0.651128464159783"/>
|
||||
<PCell parameterName="p16" df="1" beta="-1.57810492961292"/>
|
||||
<PCell parameterName="p17" df="1" beta="-5.97605688345455"/>
|
||||
<PCell parameterName="p18" df="1" beta="0.251142343524816"/>
|
||||
<PCell parameterName="p19" df="1" beta="-6.09377397399622"/>
|
||||
<PCell parameterName="p20" df="1" beta="-5.82961510076022"/>
|
||||
<PCell parameterName="p21" df="1" beta="-5.85464490757321"/>
|
||||
<PCell parameterName="p22" df="1" beta="-7.18549413788513"/>
|
||||
<PCell parameterName="p23" df="1" beta="-0.748414904576139"/>
|
||||
<PCell parameterName="p24" df="1" beta="4.31138240524499"/>
|
||||
<PCell parameterName="p25" df="1" beta="-3.80275996981634"/>
|
||||
<PCell parameterName="p26" df="1" beta="1.01452799417589"/>
|
||||
<PCell parameterName="p27" df="1" beta="-3.78197841978997"/>
|
||||
<PCell parameterName="p28" df="1" beta="1.99210723796236"/>
|
||||
<PCell parameterName="p29" df="1" beta="2.45283077235277"/>
|
||||
<PCell parameterName="p30" df="1" beta="-0.196944690182496"/>
|
||||
<PCell parameterName="p31" df="1" beta="0.945179430752159"/>
|
||||
<PCell parameterName="p32" df="1" beta="-4.59016679148137"/>
|
||||
<PCell parameterName="p33" df="1" beta="1.65184158729838"/>
|
||||
<PCell parameterName="p34" df="1" beta="2.15593687951665"/>
|
||||
<PCell parameterName="p35" df="1" beta="1.37009892870546"/>
|
||||
<PCell parameterName="p36" df="1" beta="-0.0832981819521296"/>
|
||||
<PCell parameterName="p37" df="1" beta="1.13798399535871"/>
|
||||
<PCell parameterName="p38" df="1" beta="-6.61720082165706"/>
|
||||
<PCell parameterName="p39" df="1" beta="2.28312399437246"/>
|
||||
<PCell parameterName="p40" df="1" beta="-0.63259432783262"/>
|
||||
<PCell parameterName="p41" df="1" beta="5.10767550536656e-06"/>
|
||||
<PCell parameterName="p42" df="1" beta="0.196792605081456"/>
|
||||
<PCell parameterName="p43" df="1" beta="0.00190618404925525"/>
|
||||
<PCell parameterName="p44" df="1" beta="0.0501225178066986"/>
|
||||
</ParamMatrix>
|
||||
</GeneralRegressionModel>
|
||||
</PMML>
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -0,0 +1,191 @@
|
|||
#region Copyright Syncfusion Inc. 2001-2018.
|
||||
// Copyright Syncfusion Inc. 2001-2018. All rights reserved.
|
||||
// Use of this code is subject to the terms of our license.
|
||||
// A copy of the current license can be obtained at any time by e-mailing
|
||||
// licensing@syncfusion.com. Any infringement will be prosecuted under
|
||||
// applicable laws.
|
||||
#endregion
|
||||
using Syncfusion.PMML;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
namespace AuditQuasibinomialProbitRegression
|
||||
{
|
||||
/// <summary>
|
||||
/// Console program to demonstrate PMML execution engine
|
||||
/// </summary>
|
||||
public class Program
|
||||
{
|
||||
//Create Table instance for input, output and R Result
|
||||
public Table inputTable = null;
|
||||
|
||||
private Table outputTable = null;
|
||||
private Table rResults = null;
|
||||
|
||||
#if CONSOLE
|
||||
|
||||
private static void Main(string[] args)
|
||||
{
|
||||
//Create instance
|
||||
Program program = new Program();
|
||||
//Load input csv
|
||||
program.inputTable = new Table("../../Model/Audit.csv", true, ',');
|
||||
//Invoke PredictResult
|
||||
program.outputTable = program.PredictResult(program.inputTable,
|
||||
"../../Model/Audit.pmml");
|
||||
//Compare predicted results of PMML execution engine with R Results
|
||||
//Dispose the inputTable values
|
||||
program.inputTable.Dispose();
|
||||
program.ComparePredictedResultsWithR("../../Model/ROutput.csv");
|
||||
//Write the Result as CSV Table
|
||||
program.outputTable.WriteToCSV("../../Model/PredictedOutput.csv", true, ',');
|
||||
//Dispose the output Table
|
||||
program.outputTable.Dispose();
|
||||
//Display the result saved location
|
||||
Console.WriteLine("\nResult saved in : " + Path.GetFullPath("../../Model/PredictedOutput.csv"));
|
||||
Console.ReadKey();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#region PredictResult
|
||||
|
||||
/// <summary>
|
||||
/// Predicts the results for given PMML and CSV file and serialize the results in a CSV file
|
||||
/// </summary>
|
||||
public Table PredictResult(Table inputTable, string pmmlPath)
|
||||
{
|
||||
//Get PMML Evaluator instance
|
||||
PMMLEvaluator evaluator = new PMMLEvaluatorFactory().
|
||||
GetPMMLEvaluatorInstance(pmmlPath);
|
||||
|
||||
string[] predictedCategories = null;
|
||||
|
||||
//Predict the value for each record using the PMML Evaluator instance
|
||||
for (int i = 0; i < inputTable.RowCount; i++)
|
||||
{
|
||||
var audit = GetDataObject(inputTable, i);
|
||||
|
||||
//Get result
|
||||
PredictedResult predictedResult = evaluator.GetResult(audit, null);
|
||||
|
||||
if (i == 0)
|
||||
{
|
||||
//Get the predicted propability fields
|
||||
predictedCategories = predictedResult.GetPredictedCategories();
|
||||
//Initialize the output table
|
||||
InitializeTable(inputTable.RowCount, predictedResult.PredictedField, predictedCategories);
|
||||
}
|
||||
|
||||
//Add predicted value
|
||||
outputTable[i, 0] = predictedResult.PredictedValue;
|
||||
|
||||
for (int j = 1; j <= predictedCategories.Length; j++)
|
||||
outputTable[i, j] = predictedResult.GetPredictedProbability(predictedCategories[j - 1]);
|
||||
}
|
||||
return outputTable;
|
||||
}
|
||||
|
||||
#endregion PredictResult
|
||||
|
||||
#region Compare Predicted Results With R
|
||||
|
||||
/// <summary>
|
||||
/// Compare predicted results of PMML execution engine with R results
|
||||
/// </summary>
|
||||
|
||||
public void ComparePredictedResultsWithR(string rOutputDataCSVPath)
|
||||
{
|
||||
//Create instance to hold results of R
|
||||
rResults = new Table(rOutputDataCSVPath, true, ',');
|
||||
string differentIndices = string.Empty;
|
||||
//Pass the Table to the compare method of resultTable
|
||||
bool isDifferent = Compare(rResults, 1, 0, ref differentIndices);
|
||||
#if CONSOLE
|
||||
//Display mismatched index
|
||||
if (isDifferent)
|
||||
{
|
||||
Console.WriteLine("\nDifference in predicted results by R and PMML execution engine");
|
||||
Console.WriteLine("\nDifferent indices are " + differentIndices);
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("\nBoth predicted results by R and PMML execution engine are equal");
|
||||
}
|
||||
#endif
|
||||
//Dispose the R results Table
|
||||
rResults.Dispose();
|
||||
}
|
||||
|
||||
#endregion Compare Predicted Results With R
|
||||
|
||||
#region Initialize OutputTable
|
||||
|
||||
/// <summary>
|
||||
/// Initialize the outputTable
|
||||
/// </summary>
|
||||
/// <param name="rowCount">rowCount of output table</param>
|
||||
/// <param name="predictedfield">predictedfield name</param>
|
||||
/// <param name="predictedCategories">probableFields</param>
|
||||
private void InitializeTable(int rowCount, string predictedfield, string[] predictedCategories)
|
||||
{
|
||||
//Create instance to hold evaluated results
|
||||
outputTable = new Table(rowCount, predictedCategories.Length + 1);
|
||||
//Add predicted column names
|
||||
outputTable.ColumnNames[0] = "Predicted_" + predictedfield;
|
||||
//outputTable.ColumnNames[1] = "AuditLowriskProbability";
|
||||
//outputTable.ColumnNames[2] = "AuditHighriskProbability";
|
||||
}
|
||||
|
||||
#endregion Initialize OutputTable
|
||||
|
||||
#region GetDataObject
|
||||
|
||||
/// <summary>
|
||||
/// Returns the row as anonymous object
|
||||
/// </summary>
|
||||
/// <param name="inputTable"> input Table values</param>
|
||||
/// <param name="row">input row</param>
|
||||
/// <returns>Anonymous object</returns>
|
||||
public Dictionary<string, object> GetDataObject(Table inputTable, int row)
|
||||
{
|
||||
Dictionary<string, object> audit = new Dictionary<string, object>();
|
||||
for (int i = 0; i < inputTable.ColumnCount; i++)
|
||||
{
|
||||
audit.Add(inputTable.ColumnNames[i], inputTable[row, inputTable.ColumnNames[i]]);
|
||||
}
|
||||
return audit;
|
||||
}
|
||||
|
||||
#endregion GetDataObject
|
||||
|
||||
#region Compare
|
||||
|
||||
/// <summary>
|
||||
/// Compares the result of 2 Tables based on column index.
|
||||
/// </summary>
|
||||
/// <param name="rOutput">R output table</param>
|
||||
/// <param name="rColumnIndex">R's Column to be compared</param>
|
||||
/// <param name="predictedColumnIndex">predicted result's column index</param>
|
||||
/// <param name="differentIndices"> different indices</param>
|
||||
public bool Compare(Table table, int rColumnIndex, int predictedColumnIndex, ref string differentIndices)
|
||||
{
|
||||
bool isDifferent = false;
|
||||
//Compare predicted values
|
||||
for (int i = 0; i < table.RowCount; i++)
|
||||
{
|
||||
double predictedC = Math.Round(Convert.ToDouble(outputTable[i, predictedColumnIndex]));
|
||||
//Compare Results based on column index
|
||||
if (predictedC .ToString() != table[i, rColumnIndex].ToString())
|
||||
{
|
||||
differentIndices += ", " + i;
|
||||
isDifferent = true;
|
||||
}
|
||||
}
|
||||
return isDifferent;
|
||||
}
|
||||
|
||||
#endregion Compare
|
||||
}
|
||||
}
|
|
@ -0,0 +1,132 @@
|
|||
# Copyright Syncfusion Inc. 2001 - 2016. All rights reserved.
|
||||
# Use of this code is subject to the terms of our license.
|
||||
# A copy of the current license can be obtained at any time by e-mailing
|
||||
# licensing@syncfusion.com. Any infringement will be prosecuted under
|
||||
# applicable laws.
|
||||
|
||||
|
||||
# If you are not familiar with R you can obtain a quick introduction by downloading
|
||||
# R Succinctly for free from Syncfusion - http://www.syncfusion.com/resources/techportal/ebooks/rsuccinctly
|
||||
# R Succinctly is also included with this installation and is available here
|
||||
# Installed Drive :\Program Files (x86)\Syncfusion\Essential Studio\XX.X.X.XX\Infrastructure\EBooks\R_Succintly.pdf OF R Succinctly
|
||||
# Uncomment below lines to install necessary packages if not installed already
|
||||
# install.packages("pmml")
|
||||
# install.packages("gmodels")
|
||||
# install.packages("TH.data")
|
||||
# install.packages("ROCR")
|
||||
# install.packages("caret")
|
||||
# install.packages("e1071")
|
||||
|
||||
# Load below packages
|
||||
library(pmml)
|
||||
library(gmodels)
|
||||
library(TH.data)# This package is specifically loaded for GBSG2 dataset shipped within it.
|
||||
library(ROCR)
|
||||
library(caret)
|
||||
library(e1071)
|
||||
|
||||
# Here we directly load the breastcancer dataset installed with the "TH.data" package.
|
||||
data(GBSG2)
|
||||
|
||||
# rename column names in GBSG2 dataset from TH.data package
|
||||
breastCancerOriginal <- setNames(GBSG2, c("Hormonal_Therapy", "Age", "Menopausal_Status", "Tumor_Size", "Tumor_Grade", "Positive_Nodes",
|
||||
"Progesterone", "Estrogen_Receptor","Survival_Time", "Indicator"))
|
||||
|
||||
# Omit rows with missing values
|
||||
breastCancerOriginal = na.omit(breastCancerOriginal)
|
||||
|
||||
# Convert ordered factor to normal factor
|
||||
breastCancerOriginal$Tumor_Grade<-factor(breastCancerOriginal$Tumor_Grade, ordered = FALSE)
|
||||
|
||||
# Code below demonstrates loading the same dataset from a CSV file shipped with our installer.
|
||||
# Uncomment below lines and comment out the code above to read from CSV file.
|
||||
# Please check samples (Data) location to set actual working directory
|
||||
# setwd("C:/actual_data_location")
|
||||
# breastCancer= read.csv("BreastCancer.csv")
|
||||
|
||||
# Considering integer variable as factor
|
||||
breastCancerOriginal[, "Indicator"]=as.factor(breastCancerOriginal[, "Indicator"])
|
||||
|
||||
# Randomizing data
|
||||
breastCancer<-breastCancerOriginal[sample(nrow(breastCancerOriginal)),]
|
||||
|
||||
# Divide dataset for training and test
|
||||
trainData<-breastCancer[1:549,]
|
||||
testData<-breastCancer[550:686,]
|
||||
|
||||
# Applying General Regression Model - probit function to predict cens
|
||||
breastCancerFormula = formula(Indicator ~ Hormonal_Therapy + Age + Menopausal_Status + Tumor_Size + Tumor_Grade + Positive_Nodes + Progesterone +
|
||||
Estrogen_Receptor + Survival_Time)
|
||||
breastCancer_GLM = glm(breastCancerFormula ,trainData, family = binomial(link="probit"))
|
||||
summary(breastCancer_GLM)
|
||||
|
||||
# Display the predicted results and create cross table to check on accuracy
|
||||
# Predict "cens" column probability for test data set
|
||||
breastCancerTestProbabilities = predict(breastCancer_GLM, type = "response",testData)
|
||||
# Display predicted probabilities
|
||||
breastCancerTestProbabilities
|
||||
|
||||
# Categorize the probability for predicted value (0/1)
|
||||
breastCancerTestPrediction = as.character(as.integer(breastCancerTestProbabilities > 0.5))
|
||||
# Display predicted values
|
||||
breastCancerTestPrediction
|
||||
|
||||
# Create cross table to check on accuracy.
|
||||
CrossTable(breastCancerTestPrediction,testData$Indicator, prop.chisq = FALSE, prop.t = FALSE, prop.r = FALSE,
|
||||
dnn = c('predicted', 'actual'))
|
||||
|
||||
# Generate ROC curve and calculate AUC value to predict the accuracy for BreastCancer test dataset
|
||||
|
||||
# To create visualizations - ROC curve with "ROCR" package two vectors of data are needed,
|
||||
# The first vector must contain the class values - cens column and
|
||||
# The second vector must contain the estimated probability of the positive class(Probability_1)
|
||||
pred <- prediction(labels = testData$Indicator, predictions = breastCancerTestProbabilities)
|
||||
|
||||
# Using the perf performance object, we can visualize the ROC curve with R's plot() function
|
||||
perf <- performance(pred, measure = "tpr", x.measure = "fpr")
|
||||
|
||||
# Plot the ROC curve for the visualization
|
||||
plot(perf, main = "ROC curve for BreastCancer Test Dataset", col = "blue", lwd = 3)
|
||||
|
||||
# To indicate reference line in the ROC plot
|
||||
abline(a = 0, b = 1, lwd = 2, lty = 2)
|
||||
|
||||
# We can use the ROCR package to calculate the AUC(Area under the ROC Curve)
|
||||
# To do so, we first need to create another performance object and specify measure = "auc", as shown in the following code:
|
||||
perf.auc <- performance(pred, measure = "auc")
|
||||
|
||||
# perf.auc is an object (specifically known as an S4 object) we need to use a special type of notation to access the values stored within.
|
||||
# S4 objects hold information in positions known as slots
|
||||
# The str() function can be used to see all slots for an object
|
||||
str(perf.auc)
|
||||
|
||||
# To access the AUC value, which is stored as a list in the y.values slot, we can use the @ notation along with the unlist() function, which simplifies lists to a vector of numeric values
|
||||
# Below AUC value is under the "excellent/good" category
|
||||
unlist(perf.auc@y.values)
|
||||
|
||||
# View Specificity, Sensitivity and Accuracy information using confusionMatrix function from "caret" package
|
||||
confusionMatrix(breastCancerTestPrediction,testData$Indicator, positive = "1")
|
||||
|
||||
# PMML generation
|
||||
pmmlFile = pmml(breastCancer_GLM,data=trainData)
|
||||
write(toString(pmmlFile),file="BreastCancer.pmml")
|
||||
saveXML(pmmlFile,file="BreastCancer.pmml")
|
||||
|
||||
# The code below is used for evaluation purpose.
|
||||
# The model is applied for original breastCancer data set and predicted results are saved in "ROutput.csv"
|
||||
# "ROutput.csv" file used for comparing the R results with PMML Evaluation engine results
|
||||
|
||||
# Applying General Regression model to entire dataset and save the results in a CSV file
|
||||
breastCancerEntireProbabilities = predict(breastCancer_GLM, type = "response",breastCancerOriginal)
|
||||
|
||||
# Categorize the probability for predicted value (0/1)
|
||||
breastCancerEntirePrediction = as.character(as.integer(breastCancerEntireProbabilities > 0.5))
|
||||
|
||||
# Save predicted value in a data frame
|
||||
breastCancerProbabilities = cbind(1 -breastCancerEntireProbabilities,breastCancerEntireProbabilities)
|
||||
result = data.frame(breastCancerEntirePrediction, breastCancerProbabilities )
|
||||
names(result) = c("Predicted_censored", "CensoredProbability", "NonCensoredProbability")
|
||||
|
||||
# Write the results in a CSV file
|
||||
write.csv(result,"ROutput.csv",quote=F)
|
||||
|
|
@ -0,0 +1,687 @@
|
|||
Hormonal_Therapy,Age,Menopausal_Status,Tumor_Size,Tumor_Grade,Positive_Nodes,Progesterone,Estrogen_Receptor,Survival_Time,Indicator
|
||||
no,70,Post,21,II,3,48,66,1814,1
|
||||
yes,56,Post,12,II,7,61,77,2018,1
|
||||
yes,58,Post,35,II,9,52,271,712,1
|
||||
yes,59,Post,17,II,4,60,29,1807,1
|
||||
no,73,Post,35,II,1,26,65,772,1
|
||||
no,32,Pre,57,III,24,0,13,448,1
|
||||
yes,59,Post,8,II,2,181,0,2172,0
|
||||
no,65,Post,16,II,1,192,25,2161,0
|
||||
no,80,Post,39,II,30,0,59,471,1
|
||||
no,66,Post,18,II,7,0,3,2014,0
|
||||
yes,68,Post,40,II,9,16,20,577,1
|
||||
yes,71,Post,21,II,9,0,0,184,1
|
||||
yes,59,Post,58,II,1,154,101,1840,0
|
||||
no,50,Post,27,III,1,16,12,1842,0
|
||||
yes,70,Post,22,II,3,113,139,1821,0
|
||||
no,54,Post,30,II,1,135,6,1371,1
|
||||
no,39,Pre,35,I,4,79,28,707,1
|
||||
yes,66,Post,23,II,1,112,225,1743,0
|
||||
yes,69,Post,25,I,1,131,196,1781,0
|
||||
no,55,Post,65,I,4,312,76,865,1
|
||||
no,56,Post,22,II,1,28,23,1684,1
|
||||
no,57,Post,21,II,2,184,294,1701,0
|
||||
no,65,Post,25,III,1,0,0,1701,0
|
||||
yes,70,Post,15,II,3,89,151,1693,0
|
||||
no,65,Post,70,III,26,2,64,379,1
|
||||
no,44,Pre,23,II,2,299,35,1105,1
|
||||
yes,59,Post,23,III,3,8,0,548,1
|
||||
no,43,Pre,35,II,4,37,5,1296,1
|
||||
yes,53,Post,58,II,1,0,0,1483,0
|
||||
no,32,Pre,25,II,2,36,10,1570,0
|
||||
no,45,Pre,45,III,2,0,0,1469,0
|
||||
no,36,Pre,44,III,2,6,5,1472,0
|
||||
yes,57,Post,35,III,1,1490,209,1342,0
|
||||
no,55,Post,25,I,2,26,53,1349,0
|
||||
no,34,Pre,15,II,5,103,118,1162,1
|
||||
yes,58,Post,35,II,2,38,18,1342,0
|
||||
no,62,Post,22,II,12,0,8,797,1
|
||||
no,64,Post,25,I,9,67,86,1232,0
|
||||
no,53,Post,23,II,3,13,7,1230,0
|
||||
no,53,Post,13,II,8,423,175,1205,0
|
||||
no,65,Post,52,III,7,25,155,1090,0
|
||||
no,45,Pre,38,II,38,160,5,1095,0
|
||||
no,58,Post,42,III,1,0,0,449,1
|
||||
yes,68,Post,23,II,1,27,5,972,0
|
||||
yes,67,Post,25,II,1,15,55,825,0
|
||||
no,59,Post,25,I,2,33,51,2438,0
|
||||
no,65,Post,20,II,1,6,6,2233,0
|
||||
yes,34,Pre,30,III,12,0,5,286,1
|
||||
yes,65,Post,18,II,5,133,175,1861,0
|
||||
no,61,Post,30,II,9,41,51,1080,1
|
||||
yes,61,Post,25,II,1,21,172,1521,1
|
||||
no,46,Post,25,II,1,2,0,1693,0
|
||||
no,63,Post,25,II,1,86,366,1528,1
|
||||
yes,45,Pre,19,II,7,19,0,169,1
|
||||
no,46,Pre,35,II,7,67,44,272,1
|
||||
no,63,Post,40,II,3,5,8,731,1
|
||||
yes,53,Pre,21,II,9,29,9,2059,0
|
||||
yes,43,Post,40,I,4,233,19,1853,0
|
||||
no,31,Pre,23,II,4,20,0,1854,0
|
||||
yes,71,Post,15,II,9,85,9,1645,0
|
||||
yes,59,Post,28,II,18,0,7,544,1
|
||||
no,62,Post,15,II,4,22,70,1666,0
|
||||
no,54,Post,30,II,2,31,11,353,1
|
||||
no,46,Pre,25,II,13,82,20,1791,0
|
||||
yes,53,Post,25,II,2,9,1,1685,0
|
||||
no,45,Pre,10,II,1,14,3,191,1
|
||||
no,48,Pre,30,II,4,19,4,370,1
|
||||
no,32,Pre,20,II,5,55,41,173,1
|
||||
no,30,Pre,12,II,11,4,3,242,1
|
||||
no,53,Post,16,III,1,1,1,420,1
|
||||
no,42,Pre,12,II,6,388,30,438,1
|
||||
no,48,Pre,35,II,1,41,61,1624,0
|
||||
yes,54,Post,30,II,6,15,81,1036,1
|
||||
no,56,Post,25,II,11,0,36,359,1
|
||||
no,51,Pre,25,II,16,91,31,171,1
|
||||
no,68,Post,18,II,14,0,2,959,1
|
||||
no,46,Pre,21,II,3,73,13,1351,0
|
||||
no,41,Pre,15,II,4,11,11,486,1
|
||||
no,48,Pre,16,III,10,0,0,525,1
|
||||
no,55,Pre,23,II,3,295,34,762,1
|
||||
no,52,Pre,36,II,6,6,16,175,1
|
||||
no,36,Pre,8,III,1,10,0,1195,0
|
||||
no,44,Pre,25,III,6,5,2,338,1
|
||||
no,47,Post,20,III,6,408,36,1125,0
|
||||
yes,47,Post,40,III,6,187,24,916,0
|
||||
yes,59,Post,23,II,1,13,20,972,0
|
||||
no,65,Post,10,II,3,42,59,867,0
|
||||
no,42,Pre,25,II,7,0,2,249,1
|
||||
no,63,Post,32,II,16,7,132,281,1
|
||||
no,40,Pre,22,II,2,13,18,758,0
|
||||
yes,62,Post,50,II,11,1,2,377,1
|
||||
no,55,Post,40,I,2,64,81,1976,0
|
||||
yes,47,Pre,45,II,2,264,59,2539,0
|
||||
no,63,Post,23,II,3,22,32,2467,0
|
||||
no,69,Post,20,II,2,154,191,876,1
|
||||
no,43,Pre,21,II,1,206,87,2132,0
|
||||
no,59,Post,24,II,14,2,22,426,1
|
||||
no,75,Post,50,II,1,170,317,554,1
|
||||
yes,41,Pre,40,II,4,100,100,1246,1
|
||||
no,47,Pre,36,III,2,154,99,1926,0
|
||||
no,43,Pre,80,II,20,2,25,1207,1
|
||||
no,42,Pre,30,III,4,65,81,1852,0
|
||||
no,46,Pre,35,I,5,100,0,1174,1
|
||||
no,65,Post,58,II,11,390,119,1250,0
|
||||
no,59,Post,30,II,3,0,2,530,1
|
||||
no,48,Pre,70,II,7,8,0,1502,0
|
||||
no,44,Pre,27,II,3,525,61,1364,0
|
||||
no,53,Post,25,II,13,77,131,1170,1
|
||||
no,53,Post,25,II,2,54,58,1729,0
|
||||
no,60,Pre,23,II,3,136,507,1642,0
|
||||
no,64,Post,24,II,2,206,304,1218,1
|
||||
no,56,Post,8,II,1,110,0,1358,0
|
||||
no,66,Post,30,II,16,0,508,360,1
|
||||
no,50,Pre,30,II,1,183,243,550,1
|
||||
yes,63,Post,22,II,9,64,19,857,0
|
||||
no,61,Post,60,II,51,45,38,768,0
|
||||
no,46,Pre,26,I,3,33,68,858,0
|
||||
yes,63,Post,23,II,3,3,2,770,0
|
||||
no,49,Pre,55,II,7,0,0,679,1
|
||||
no,33,Pre,35,III,1,26,0,1164,1
|
||||
no,50,Post,52,II,1,0,0,350,1
|
||||
no,45,Pre,29,II,1,0,0,578,1
|
||||
no,51,Pre,20,II,1,0,0,1460,1
|
||||
no,39,Pre,30,III,1,0,0,1434,0
|
||||
yes,56,Post,40,II,3,0,3,1763,1
|
||||
no,60,Post,15,II,2,84,93,889,1
|
||||
yes,47,Pre,35,III,17,14,3,357,1
|
||||
no,58,Post,50,II,7,77,77,547,1
|
||||
yes,56,Pre,21,II,3,111,20,1722,0
|
||||
yes,54,Post,21,II,1,7,139,2372,0
|
||||
yes,56,Post,40,II,3,0,59,2030,1
|
||||
no,57,Post,26,II,1,166,521,1002,1
|
||||
no,53,Post,10,II,1,17,61,1280,1
|
||||
no,31,Pre,60,II,7,542,77,338,1
|
||||
yes,41,Pre,80,II,1,0,0,533,1
|
||||
yes,66,Post,33,II,3,0,0,168,0
|
||||
yes,37,Pre,25,II,1,235,38,1169,0
|
||||
no,66,Post,15,II,1,252,185,1675,1
|
||||
no,48,Pre,45,III,1,0,0,1862,0
|
||||
no,44,Pre,21,II,3,1600,70,629,0
|
||||
no,51,Pre,50,II,9,0,0,1167,0
|
||||
no,57,Post,20,II,3,39,83,495,1
|
||||
no,65,Post,17,I,1,935,200,967,0
|
||||
yes,40,Pre,30,II,2,320,30,1720,0
|
||||
yes,62,Post,19,II,1,35,1060,598,1
|
||||
yes,64,Post,30,III,12,0,0,392,1
|
||||
no,46,Pre,12,II,3,175,80,1502,0
|
||||
yes,62,Post,25,II,1,35,185,229,0
|
||||
no,44,Pre,30,II,7,110,20,310,0
|
||||
no,69,Post,27,I,3,140,350,1296,0
|
||||
no,48,Pre,15,II,6,0,110,488,0
|
||||
no,47,Post,12,II,2,0,50,942,0
|
||||
yes,64,Post,26,II,5,370,220,570,0
|
||||
no,58,Post,52,III,5,0,0,1177,0
|
||||
yes,65,Post,30,II,5,85,365,1113,0
|
||||
no,40,Pre,40,II,5,50,75,288,1
|
||||
yes,62,Post,21,II,2,0,0,723,0
|
||||
no,55,Post,20,III,16,0,0,403,1
|
||||
no,62,Post,25,III,5,0,0,1225,1
|
||||
no,29,Pre,12,II,4,32,150,338,1
|
||||
no,38,Pre,18,III,5,141,105,1337,1
|
||||
no,52,Pre,20,I,1,78,14,1420,1
|
||||
no,47,Post,55,II,18,29,87,2048,0
|
||||
no,53,Pre,75,III,19,375,107,600,1
|
||||
no,37,Pre,15,I,1,162,22,1765,0
|
||||
no,63,Post,60,II,15,180,12,491,1
|
||||
no,63,Post,45,III,7,20,93,305,1
|
||||
no,59,Post,22,II,2,23,235,1582,0
|
||||
no,48,Pre,30,II,15,250,45,1771,0
|
||||
no,33,Pre,15,III,33,66,8,960,1
|
||||
no,38,Pre,57,III,9,18,62,571,1
|
||||
no,32,Pre,28,II,12,33,107,675,0
|
||||
no,31,Pre,28,II,2,349,189,285,1
|
||||
no,53,Post,48,II,7,254,117,1472,0
|
||||
no,47,Pre,30,II,1,422,89,1279,1
|
||||
no,40,Pre,24,I,3,25,11,148,0
|
||||
yes,64,Post,19,II,1,19,9,1863,0
|
||||
yes,49,Post,56,I,3,356,64,1933,0
|
||||
no,53,Post,52,II,9,6,29,358,1
|
||||
yes,70,Post,18,II,1,107,307,734,0
|
||||
yes,61,Post,22,II,2,6,173,2372,1
|
||||
no,43,Pre,30,II,1,22,0,2563,0
|
||||
yes,74,Post,20,II,1,462,240,2372,0
|
||||
yes,58,Post,18,I,2,74,67,1989,1
|
||||
yes,49,Pre,20,II,6,56,98,2015,1
|
||||
yes,61,Post,35,III,2,23,9,1956,0
|
||||
no,66,Post,40,III,16,21,412,945,1
|
||||
yes,66,Post,20,III,3,54,17,2153,0
|
||||
no,59,Post,23,II,2,88,38,838,1
|
||||
no,51,Post,70,III,6,28,5,113,1
|
||||
yes,71,Post,18,II,2,31,9,1833,0
|
||||
no,46,Pre,50,III,10,44,4,1722,0
|
||||
no,52,Pre,40,III,6,32,5,241,1
|
||||
yes,60,Post,16,II,1,184,51,1352,1
|
||||
no,60,Post,50,II,7,65,30,1702,0
|
||||
yes,67,Post,27,II,4,1118,753,1222,0
|
||||
no,54,Post,30,III,3,1,0,1089,0
|
||||
no,55,Post,12,II,1,63,19,1243,0
|
||||
no,38,Pre,20,II,9,24,34,579,1
|
||||
yes,52,Post,25,II,13,31,196,1043,1
|
||||
no,43,Pre,30,II,3,45,11,2234,0
|
||||
no,50,Pre,22,I,1,135,111,2297,0
|
||||
yes,61,Post,25,I,2,32,144,2014,0
|
||||
no,62,Post,20,II,2,7,9,518,1
|
||||
no,46,Pre,30,III,1,36,33,940,0
|
||||
no,50,Pre,25,III,1,20,13,766,0
|
||||
no,52,Post,20,III,10,7,8,251,1
|
||||
no,45,Pre,20,II,2,64,48,1959,0
|
||||
no,52,Post,10,II,3,109,12,1897,0
|
||||
no,51,Post,120,II,12,3,1,160,1
|
||||
no,66,Post,28,II,2,488,298,970,0
|
||||
no,50,Pre,35,I,1,408,44,892,0
|
||||
yes,60,Post,32,I,3,104,203,753,0
|
||||
no,61,Post,20,II,5,25,75,348,1
|
||||
yes,64,Post,45,III,5,1,8,275,1
|
||||
no,64,Post,17,I,1,227,0,1329,1
|
||||
no,51,Post,35,III,1,6,1,1193,1
|
||||
yes,63,Post,30,II,7,0,0,698,1
|
||||
no,62,Post,12,II,7,0,0,436,1
|
||||
yes,65,Post,18,III,1,0,0,552,1
|
||||
yes,67,Post,20,II,1,0,0,564,1
|
||||
no,62,Post,30,II,1,8,371,2239,0
|
||||
yes,48,Pre,25,II,1,235,33,2237,0
|
||||
no,67,Post,25,II,1,6,19,529,1
|
||||
no,46,Pre,11,II,2,0,0,1820,0
|
||||
yes,56,Post,20,I,1,2,334,1756,0
|
||||
yes,72,Post,34,III,36,2,1091,515,1
|
||||
yes,50,Post,70,II,19,10,57,272,1
|
||||
no,58,Post,21,III,2,1,1,891,1
|
||||
no,63,Post,21,II,1,0,378,1356,0
|
||||
no,45,Post,15,II,6,1,162,1352,0
|
||||
no,46,Pre,21,III,1,7,109,1077,0
|
||||
yes,58,Post,18,II,3,64,418,675,1
|
||||
yes,60,Post,39,III,9,0,0,855,0
|
||||
no,53,Post,30,III,1,1,4,740,0
|
||||
yes,63,Post,21,II,1,26,30,2551,0
|
||||
no,60,Post,35,II,12,41,62,754,1
|
||||
no,33,Pre,25,II,8,96,13,819,1
|
||||
yes,63,Post,19,II,5,18,38,1280,1
|
||||
no,70,Post,16,II,2,126,338,2388,0
|
||||
yes,60,Post,30,II,2,92,18,2296,0
|
||||
yes,54,Post,25,II,1,5,57,1884,0
|
||||
yes,64,Post,25,III,3,56,272,1059,1
|
||||
no,57,Post,55,III,6,22,186,859,0
|
||||
yes,50,Post,21,I,1,82,2,1109,0
|
||||
no,53,Post,20,II,1,1,1,1192,1
|
||||
no,77,Post,20,III,4,94,325,1806,1
|
||||
yes,47,Pre,60,II,15,5,38,500,1
|
||||
no,41,Pre,20,II,4,8,38,1589,1
|
||||
yes,47,Pre,30,II,5,12,11,1463,1
|
||||
yes,63,Post,25,II,2,8,195,1826,0
|
||||
no,48,Pre,22,II,4,26,29,1231,0
|
||||
no,40,Pre,15,II,1,204,138,1117,0
|
||||
yes,57,Post,30,II,8,40,40,836,1
|
||||
no,47,Pre,40,II,2,33,59,1222,0
|
||||
no,46,Pre,22,II,4,24,74,663,0
|
||||
yes,58,Post,35,III,7,0,0,722,1
|
||||
yes,51,Pre,25,II,1,167,109,322,0
|
||||
yes,62,Post,23,II,2,0,14,1150,1
|
||||
no,50,Pre,60,III,4,0,0,446,1
|
||||
yes,65,Post,30,II,5,0,36,1855,0
|
||||
yes,59,Post,30,II,8,0,0,238,1
|
||||
no,49,Pre,18,II,2,0,0,1838,0
|
||||
yes,52,Post,25,II,13,0,0,1826,0
|
||||
no,45,Pre,30,II,1,0,0,1093,1
|
||||
no,49,Post,14,II,1,0,0,2051,0
|
||||
no,58,Post,45,III,4,0,0,370,1
|
||||
no,25,Pre,22,II,2,250,87,861,1
|
||||
no,50,Pre,30,III,6,0,0,1587,1
|
||||
no,43,Pre,27,II,1,23,9,552,1
|
||||
no,46,Pre,12,II,1,6,49,2353,0
|
||||
yes,64,Post,24,III,5,366,201,2471,0
|
||||
yes,63,Post,43,II,5,21,174,893,1
|
||||
no,40,Pre,35,II,2,279,99,2093,1
|
||||
yes,57,Post,22,II,4,16,5,2612,0
|
||||
yes,58,Post,56,I,11,51,50,956,1
|
||||
yes,62,Post,25,III,4,12,49,1637,0
|
||||
yes,50,Pre,42,I,2,238,26,2456,0
|
||||
no,49,Post,30,II,4,40,177,2227,0
|
||||
no,64,Post,24,II,2,41,80,1601,1
|
||||
yes,66,Post,15,II,2,15,42,1841,0
|
||||
yes,37,Pre,30,II,4,104,107,2177,0
|
||||
no,60,Post,18,III,2,12,8,2052,0
|
||||
yes,63,Post,23,III,12,3,2,973,0
|
||||
no,51,Pre,12,I,2,55,64,2156,0
|
||||
yes,49,Pre,28,I,4,364,120,1499,0
|
||||
yes,57,Post,7,II,1,1,1,2030,0
|
||||
yes,68,Post,14,II,6,40,68,573,1
|
||||
no,47,Pre,25,II,1,199,134,1666,0
|
||||
no,51,Post,13,II,5,89,134,1979,0
|
||||
yes,49,Pre,19,I,5,69,14,1786,0
|
||||
no,63,Post,28,II,4,258,46,1847,0
|
||||
yes,64,Post,15,II,1,340,71,2009,0
|
||||
no,65,Post,24,II,1,328,115,1926,0
|
||||
yes,63,Post,13,II,1,124,361,1490,0
|
||||
no,33,Pre,23,III,10,2,3,233,1
|
||||
no,44,Pre,35,II,6,26,4,1240,0
|
||||
no,47,Pre,13,II,3,242,14,1751,0
|
||||
no,46,Pre,19,I,11,56,24,1878,0
|
||||
no,52,Pre,26,II,1,258,10,1171,0
|
||||
no,62,Post,55,III,8,3,2,1751,0
|
||||
yes,61,Post,24,II,2,28,50,1756,0
|
||||
no,60,Post,27,II,6,401,159,714,1
|
||||
yes,67,Post,44,II,10,431,267,1505,0
|
||||
no,47,Pre,78,II,14,168,53,776,1
|
||||
no,70,Post,38,III,2,24,15,1443,0
|
||||
no,50,Pre,11,I,1,10,11,1317,0
|
||||
yes,62,Post,20,II,1,11,6,870,0
|
||||
no,58,Post,30,III,13,7,46,859,1
|
||||
no,59,Post,20,II,1,2,4,223,1
|
||||
no,45,Pre,18,I,1,56,40,1212,0
|
||||
no,45,Pre,30,II,3,345,31,1119,0
|
||||
no,41,Pre,34,II,10,25,10,740,0
|
||||
yes,54,Post,29,II,10,26,284,1062,0
|
||||
no,50,Pre,29,I,2,90,30,8,0
|
||||
yes,52,Post,20,II,1,1,8,936,0
|
||||
no,59,Post,45,II,6,739,526,740,0
|
||||
yes,60,Post,24,III,7,10,10,632,1
|
||||
yes,51,Pre,30,III,2,1152,38,1760,0
|
||||
no,56,Post,40,III,1,0,3,1013,0
|
||||
no,48,Pre,20,III,7,0,0,779,0
|
||||
no,49,Pre,45,III,6,0,22,375,1
|
||||
yes,47,Pre,42,II,7,164,204,1323,0
|
||||
no,37,Pre,50,III,2,170,130,1233,0
|
||||
no,54,Pre,35,II,2,145,16,986,0
|
||||
no,49,Pre,35,II,7,3,0,650,0
|
||||
no,54,Post,28,III,4,1,2,628,0
|
||||
no,44,Pre,29,II,1,27,23,1866,0
|
||||
yes,38,Pre,18,II,4,28,5,491,1
|
||||
yes,51,Pre,34,II,3,13,12,1918,1
|
||||
no,59,Post,8,II,5,1,30,72,1
|
||||
yes,52,Post,49,III,6,8,5,1140,1
|
||||
yes,64,Post,32,II,4,402,372,799,1
|
||||
no,55,Post,37,II,1,82,234,1105,1
|
||||
no,61,Post,22,II,2,179,124,548,1
|
||||
yes,44,Pre,28,III,17,2,3,227,1
|
||||
no,38,Pre,24,II,3,13,5,1838,0
|
||||
yes,43,Pre,11,I,1,126,22,1833,0
|
||||
no,65,Post,36,III,2,9,7,550,1
|
||||
yes,59,Post,48,III,1,5,17,426,1
|
||||
no,38,Pre,31,I,10,365,206,1834,0
|
||||
no,47,Pre,25,II,3,18,42,1604,0
|
||||
no,59,Post,35,II,5,5,125,772,0
|
||||
yes,47,Post,30,I,9,114,26,1146,1
|
||||
no,36,Pre,25,II,2,70,22,371,1
|
||||
no,47,Pre,24,II,20,30,8,883,1
|
||||
no,38,Pre,23,III,3,14,6,1735,0
|
||||
yes,50,Post,23,II,8,98,30,554,1
|
||||
no,44,Pre,5,II,10,11,10,790,1
|
||||
no,54,Post,22,II,2,211,129,1340,0
|
||||
no,52,Pre,30,II,12,11,20,490,1
|
||||
no,34,Pre,3,III,1,14,11,1557,0
|
||||
no,64,Post,33,III,3,20,14,594,1
|
||||
yes,54,Post,19,III,9,9,2,828,0
|
||||
no,65,Post,27,II,4,148,191,594,1
|
||||
no,49,Pre,24,II,11,106,62,841,0
|
||||
yes,70,Post,17,I,1,142,329,695,0
|
||||
yes,47,Pre,30,I,3,195,45,2556,0
|
||||
no,51,Pre,20,II,1,77,89,1753,1
|
||||
no,63,Post,15,III,5,0,0,417,1
|
||||
no,36,Pre,30,III,2,0,0,956,1
|
||||
yes,63,Post,34,II,12,223,236,1846,0
|
||||
no,47,Pre,70,II,5,796,24,1703,0
|
||||
no,51,Pre,21,III,1,0,0,1720,0
|
||||
yes,62,Post,30,II,1,88,544,1355,0
|
||||
no,56,Post,40,III,3,0,0,1603,0
|
||||
no,62,Post,33,I,5,239,76,476,1
|
||||
yes,61,Post,30,II,8,472,293,1350,0
|
||||
yes,55,Post,15,III,3,97,194,1341,0
|
||||
yes,56,Post,11,II,1,270,369,2449,0
|
||||
no,69,Post,22,II,8,282,191,2286,1
|
||||
no,57,Post,25,II,3,48,65,456,1
|
||||
no,27,Pre,22,II,1,56,99,536,1
|
||||
no,38,Pre,25,II,1,102,11,612,1
|
||||
no,42,Pre,25,III,2,11,10,2034,1
|
||||
no,69,Post,19,I,3,73,386,1990,1
|
||||
no,61,Post,50,II,4,10,10,2456,1
|
||||
no,53,Pre,13,III,3,10,20,2205,0
|
||||
no,50,Pre,25,III,1,24,85,544,1
|
||||
no,52,Pre,27,II,5,0,8,336,1
|
||||
no,47,Pre,38,II,2,58,10,2057,0
|
||||
no,65,Post,27,II,19,23,13,575,1
|
||||
no,48,Pre,38,II,3,92,41,2011,0
|
||||
no,61,Post,38,II,17,46,52,537,1
|
||||
yes,47,Pre,12,II,1,110,14,2217,0
|
||||
no,46,Post,20,II,11,680,152,1814,1
|
||||
yes,59,Post,15,II,1,30,122,890,1
|
||||
yes,60,Post,22,III,1,218,442,1114,0
|
||||
no,65,Post,33,II,6,11,28,974,0
|
||||
yes,44,Pre,28,II,1,0,0,296,0
|
||||
yes,45,Pre,100,II,6,178,77,2320,0
|
||||
no,58,Post,35,I,6,130,162,795,1
|
||||
no,51,Post,40,II,8,132,64,867,1
|
||||
no,49,Pre,15,II,1,111,19,1703,0
|
||||
no,43,Pre,30,II,2,32,16,670,1
|
||||
no,37,Pre,35,II,7,53,19,981,1
|
||||
no,51,Pre,30,II,2,505,270,1094,0
|
||||
yes,48,Pre,35,II,1,340,32,755,1
|
||||
no,54,Post,21,II,7,6,8,1388,1
|
||||
no,64,Post,21,III,1,4,3,1387,1
|
||||
no,44,Pre,55,III,4,8,8,535,1
|
||||
no,67,Post,30,II,2,5,14,1653,0
|
||||
no,63,Post,24,II,3,46,25,1904,0
|
||||
yes,42,Pre,28,III,4,27,22,1868,0
|
||||
yes,60,Post,12,I,2,402,90,1767,0
|
||||
no,39,Pre,20,II,1,38,110,855,1
|
||||
no,53,Post,16,II,1,16,120,1157,1
|
||||
yes,38,Pre,61,II,8,624,569,1869,0
|
||||
no,61,Post,40,I,15,185,206,1152,0
|
||||
no,47,Pre,15,II,1,38,0,1401,0
|
||||
no,52,Post,25,III,3,10,15,918,0
|
||||
no,67,Post,65,II,8,0,0,745,1
|
||||
yes,61,Post,25,II,18,595,419,1283,0
|
||||
yes,57,Post,15,II,3,44,78,1481,1
|
||||
yes,42,Pre,9,I,8,77,40,1807,0
|
||||
yes,39,Pre,20,III,1,2,2,542,1
|
||||
no,34,Pre,50,III,7,4,1,1441,0
|
||||
yes,52,Pre,50,II,7,45,39,1277,0
|
||||
yes,53,Pre,45,II,4,395,44,1486,0
|
||||
no,49,Pre,20,I,3,151,16,273,0
|
||||
yes,46,Pre,23,III,8,2,1,177,1
|
||||
no,36,Pre,36,II,1,76,14,545,1
|
||||
no,39,Pre,28,II,3,5,4,1185,0
|
||||
no,46,Pre,28,III,16,12,8,631,0
|
||||
no,47,Pre,70,II,1,51,28,995,0
|
||||
no,46,Pre,45,I,9,239,58,1088,0
|
||||
no,47,Pre,35,II,1,48,68,877,0
|
||||
no,57,Post,18,II,6,74,124,798,0
|
||||
yes,60,Post,25,II,7,116,435,2380,0
|
||||
yes,64,Post,36,II,2,122,198,1679,1
|
||||
yes,54,Post,40,III,4,3,2,498,1
|
||||
no,54,Post,27,II,5,138,23,2138,0
|
||||
no,46,Pre,35,II,6,405,27,2175,0
|
||||
no,49,Pre,17,II,2,324,94,2271,0
|
||||
no,50,Pre,18,III,1,1,4,17,0
|
||||
yes,55,Post,15,II,3,16,14,964,1
|
||||
yes,45,Pre,23,II,4,1,4,540,1
|
||||
no,51,Post,30,III,10,15,103,747,1
|
||||
no,43,Pre,25,II,11,1,1,650,1
|
||||
yes,59,Post,30,II,13,7,81,410,1
|
||||
no,59,Post,27,III,20,9,2,624,1
|
||||
no,47,Pre,28,III,7,16,92,1560,0
|
||||
no,48,Pre,35,III,10,2,222,455,1
|
||||
no,47,Pre,16,II,2,128,18,1629,0
|
||||
no,49,Post,21,II,5,80,152,1730,0
|
||||
yes,65,Post,25,III,2,17,14,1483,0
|
||||
no,60,Post,21,II,1,58,701,687,1
|
||||
no,52,Post,35,III,1,8,5,308,1
|
||||
no,48,Post,22,II,4,14,0,563,1
|
||||
yes,62,Post,20,II,1,100,100,46,0
|
||||
no,46,Post,20,II,2,32,29,2144,0
|
||||
no,59,Post,21,II,4,0,75,344,1
|
||||
yes,69,Post,21,III,1,51,749,945,0
|
||||
yes,68,Post,45,I,3,31,145,1905,0
|
||||
yes,74,Post,35,II,11,10,472,855,1
|
||||
no,45,Pre,50,I,2,132,200,2370,0
|
||||
no,43,Pre,55,II,1,23,45,853,0
|
||||
no,44,Pre,28,III,4,350,127,692,0
|
||||
yes,44,Pre,24,III,5,187,62,475,1
|
||||
yes,72,Post,17,II,1,229,533,2195,0
|
||||
yes,80,Post,7,II,7,2380,972,758,0
|
||||
yes,49,Pre,100,II,35,84,24,648,1
|
||||
no,57,Post,12,I,1,84,24,761,0
|
||||
no,60,Post,32,III,8,162,315,596,0
|
||||
no,76,Post,37,III,24,11,0,195,1
|
||||
yes,57,Post,35,II,4,18,0,473,1
|
||||
yes,75,Post,16,I,1,250,533,747,0
|
||||
yes,62,Post,22,II,1,263,34,2659,0
|
||||
yes,46,Pre,60,II,19,2,16,1977,1
|
||||
yes,53,Post,17,II,1,25,30,2401,0
|
||||
no,43,Pre,20,II,3,980,45,1499,0
|
||||
no,51,Post,32,III,10,0,0,1856,0
|
||||
no,41,Pre,30,III,11,6,5,595,1
|
||||
no,63,Post,45,III,2,530,328,2148,0
|
||||
yes,41,Pre,20,III,3,13,1,2126,0
|
||||
yes,74,Post,30,III,12,432,246,1975,1
|
||||
yes,57,Post,30,II,1,17,83,1641,1
|
||||
yes,44,Pre,20,II,6,150,67,1717,0
|
||||
yes,48,Pre,24,II,1,211,187,1858,0
|
||||
no,47,Pre,15,III,1,139,36,2049,0
|
||||
yes,70,Post,25,II,4,34,273,1502,1
|
||||
no,49,Pre,14,II,1,160,12,1922,0
|
||||
yes,49,Post,24,II,2,120,117,1818,0
|
||||
yes,58,Post,35,II,11,2,76,1100,0
|
||||
no,59,Post,30,II,1,87,8,1499,0
|
||||
no,60,Post,35,II,2,5,4,359,1
|
||||
yes,63,Post,30,I,5,144,221,1645,0
|
||||
no,44,Pre,15,II,1,175,88,1356,0
|
||||
yes,79,Post,23,I,1,60,80,1632,0
|
||||
no,47,Pre,25,I,1,38,44,967,0
|
||||
yes,61,Post,30,II,1,24,38,1091,0
|
||||
yes,64,Post,35,II,3,47,64,918,1
|
||||
yes,51,Pre,21,II,1,3,2,557,1
|
||||
no,44,Pre,22,II,2,107,94,1219,1
|
||||
yes,60,Post,25,I,3,78,363,2170,0
|
||||
yes,55,Post,50,II,1,14,203,729,1
|
||||
no,70,Post,80,III,8,0,0,1449,1
|
||||
no,65,Post,20,I,2,912,606,991,1
|
||||
no,53,Pre,20,II,2,89,36,481,1
|
||||
yes,54,Post,25,III,3,1,83,1655,0
|
||||
no,65,Post,25,II,2,86,135,857,1
|
||||
yes,62,Post,30,II,2,5,104,369,1
|
||||
yes,48,Pre,30,I,3,133,129,1627,0
|
||||
yes,48,Post,35,I,2,845,105,1578,0
|
||||
no,42,Pre,40,II,10,130,51,732,1
|
||||
no,48,Pre,30,II,16,29,43,460,1
|
||||
no,66,Post,25,I,2,22,121,1208,0
|
||||
yes,63,Post,25,II,13,26,348,730,1
|
||||
no,64,Post,35,I,4,858,15,722,0
|
||||
yes,68,Post,35,II,2,3,99,717,0
|
||||
no,44,Pre,40,II,4,364,159,651,0
|
||||
no,43,Pre,27,II,2,91,117,637,0
|
||||
no,67,Post,35,II,3,19,38,615,0
|
||||
yes,37,Pre,20,II,9,0,0,42,0
|
||||
no,54,Post,23,III,10,13,6,307,1
|
||||
no,52,Post,17,II,4,558,522,983,1
|
||||
no,43,Pre,80,III,11,9,1,120,1
|
||||
no,56,Post,31,II,1,45,286,1525,1
|
||||
no,42,Post,21,I,4,147,95,1680,0
|
||||
no,56,Post,16,II,10,4,2,1730,1
|
||||
no,61,Post,36,II,6,107,158,805,1
|
||||
no,67,Post,17,II,4,390,386,2388,0
|
||||
yes,63,Post,21,I,2,16,241,559,1
|
||||
yes,66,Post,20,II,9,1,11,1977,0
|
||||
no,37,Pre,25,III,1,13,1,476,1
|
||||
yes,71,Post,16,II,1,98,306,1514,0
|
||||
no,43,Pre,28,I,1,437,33,1617,0
|
||||
no,64,Post,22,III,1,8,11,1094,1
|
||||
yes,64,Post,27,II,3,186,139,784,1
|
||||
no,46,Pre,32,II,5,9,13,181,1
|
||||
no,45,Pre,50,II,7,20,23,415,1
|
||||
yes,67,Post,24,II,4,96,90,1120,1
|
||||
no,37,Pre,25,III,8,9,0,316,1
|
||||
no,65,Post,22,I,6,386,31,637,1
|
||||
no,21,Pre,15,II,3,24,25,247,1
|
||||
yes,54,Post,21,II,7,25,88,888,0
|
||||
no,46,Pre,45,II,8,2,4,622,1
|
||||
yes,63,Post,18,II,1,48,18,806,0
|
||||
yes,46,Post,31,III,1,6,3,1163,0
|
||||
no,58,Post,31,II,2,240,394,1721,0
|
||||
no,48,Pre,15,II,2,166,128,741,0
|
||||
no,41,Pre,23,III,2,26,4,372,1
|
||||
no,32,Pre,17,III,1,19,8,1331,0
|
||||
yes,66,Post,42,III,11,412,339,394,1
|
||||
no,64,Post,14,II,1,199,604,652,0
|
||||
no,50,Pre,13,III,5,8,32,657,0
|
||||
no,47,Pre,23,III,2,18,9,567,0
|
||||
yes,60,Post,15,I,7,14,8,429,0
|
||||
no,49,Pre,23,II,2,98,31,566,0
|
||||
yes,57,Post,60,III,18,11,13,15,0
|
||||
no,57,Post,50,III,13,22,47,98,1
|
||||
yes,67,Post,15,I,1,208,257,368,0
|
||||
yes,58,Post,25,I,1,241,28,432,0
|
||||
no,61,Post,25,II,2,406,174,319,0
|
||||
no,65,Post,22,II,8,4,2,65,0
|
||||
no,44,Pre,70,II,19,28,31,16,0
|
||||
no,61,Post,18,III,4,8,10,29,0
|
||||
no,62,Post,22,II,7,76,153,18,0
|
||||
no,51,Pre,50,II,5,360,57,17,0
|
||||
yes,47,Post,23,III,5,0,0,308,1
|
||||
no,44,Pre,15,II,1,0,0,1965,0
|
||||
yes,61,Post,35,III,16,10,13,548,1
|
||||
no,48,Pre,21,III,8,0,0,293,1
|
||||
yes,51,Pre,16,II,5,167,15,2017,0
|
||||
no,66,Post,22,II,4,11,22,1093,0
|
||||
no,45,Pre,14,III,1,5,43,792,0
|
||||
no,66,Post,21,II,1,9,898,586,1
|
||||
yes,69,Post,40,III,1,3,9,1434,0
|
||||
no,49,Pre,20,II,7,63,27,67,0
|
||||
no,62,Post,12,II,5,142,91,623,0
|
||||
yes,33,Pre,19,II,2,0,0,2128,0
|
||||
no,46,Pre,30,II,2,26,223,1965,0
|
||||
no,47,Pre,20,II,1,48,26,2161,0
|
||||
yes,35,Pre,35,II,4,0,0,1183,1
|
||||
no,34,Pre,40,III,1,0,37,1108,1
|
||||
no,38,Pre,24,I,1,138,82,2065,0
|
||||
no,54,Post,27,III,1,27,792,1598,0
|
||||
no,31,Pre,55,II,3,28,89,491,1
|
||||
no,41,Pre,25,II,5,6,9,1366,1
|
||||
no,43,Pre,55,II,1,4,124,424,0
|
||||
yes,52,Post,35,II,21,11,57,859,1
|
||||
yes,65,Post,25,III,18,0,0,180,1
|
||||
no,47,Post,45,II,2,345,42,1625,0
|
||||
no,65,Post,10,I,2,213,209,1938,0
|
||||
yes,53,Post,37,II,5,345,47,1343,1
|
||||
no,45,Pre,15,II,3,28,27,646,1
|
||||
no,53,Pre,19,III,1,74,534,2192,0
|
||||
yes,50,Post,25,II,3,0,496,502,1
|
||||
no,54,Post,50,III,6,7,0,1675,0
|
||||
yes,64,Post,40,II,23,16,22,1363,1
|
||||
no,29,Pre,15,III,12,18,40,420,1
|
||||
no,48,Pre,60,I,4,312,20,982,1
|
||||
no,40,Pre,30,III,3,2,16,1459,0
|
||||
no,65,Post,35,II,1,7,74,1192,0
|
||||
no,50,Post,40,II,1,80,21,1264,0
|
||||
no,55,Post,34,II,6,109,477,1095,0
|
||||
yes,51,Post,42,II,7,58,75,1078,0
|
||||
yes,59,Post,12,III,1,1,3,737,0
|
||||
yes,51,Post,4,I,4,638,232,461,0
|
||||
no,35,Pre,22,II,13,16,25,465,1
|
||||
no,48,Pre,52,II,11,0,0,842,1
|
||||
no,48,Post,40,II,1,10,72,918,0
|
||||
yes,62,Post,39,II,4,73,235,374,1
|
||||
no,47,Pre,40,II,1,44,11,1089,0
|
||||
no,51,Post,19,II,2,92,245,1527,0
|
||||
no,42,Pre,40,II,10,256,0,285,1
|
||||
no,63,Post,27,II,1,0,0,1306,1
|
||||
yes,62,Post,20,II,7,0,0,797,1
|
||||
no,57,Post,15,II,1,91,125,1441,0
|
||||
no,25,Pre,29,II,3,0,0,343,1
|
||||
yes,35,Pre,30,III,4,49,288,936,0
|
||||
no,51,Pre,30,II,1,119,44,195,0
|
||||
no,51,Post,25,II,2,0,80,503,1
|
||||
yes,47,Pre,30,II,10,0,0,827,1
|
||||
yes,34,Pre,30,II,2,210,49,1427,0
|
||||
no,68,Post,30,II,1,20,312,854,0
|
||||
yes,64,Post,30,III,12,550,263,177,1
|
||||
no,42,Pre,55,III,7,20,20,281,1
|
||||
no,37,Pre,35,III,1,242,67,205,1
|
||||
yes,65,Post,45,II,17,27,32,751,0
|
||||
no,62,Post,27,II,13,197,79,629,1
|
||||
no,36,Pre,24,III,2,0,0,526,0
|
||||
no,49,Pre,22,III,3,0,0,463,0
|
||||
no,45,Post,30,I,2,197,49,529,0
|
||||
no,38,Pre,22,II,10,48,78,623,0
|
||||
no,55,Post,40,II,13,0,0,546,0
|
||||
yes,57,Post,17,II,3,502,145,213,0
|
||||
no,47,Pre,40,II,1,0,90,276,0
|
||||
yes,51,Post,22,II,4,250,81,2010,0
|
||||
yes,45,Pre,13,III,4,21,27,2009,0
|
||||
no,41,Pre,10,I,2,241,214,1984,0
|
||||
no,39,Pre,32,II,9,1,8,1981,0
|
||||
no,53,Post,26,III,8,1,1,624,1
|
||||
no,59,Post,35,II,4,1,1,742,1
|
||||
yes,53,Post,10,II,2,217,20,1818,0
|
||||
yes,60,Post,100,II,10,102,88,1493,1
|
||||
no,50,Pre,29,I,2,323,60,1432,0
|
||||
no,51,Pre,18,I,1,94,60,801,1
|
||||
no,51,Pre,25,II,2,20,11,1182,0
|
||||
no,43,Pre,18,II,1,10,41,71,0
|
||||
yes,55,Post,20,I,4,10,128,114,0
|
||||
yes,52,Post,20,II,3,0,15,63,0
|
||||
yes,57,Post,32,II,2,43,287,1722,0
|
||||
yes,46,Pre,18,II,1,120,628,1692,0
|
||||
no,45,Pre,25,III,1,0,4,177,0
|
||||
no,43,Pre,32,II,1,171,43,57,0
|
||||
yes,64,Post,26,II,2,1356,1144,1152,0
|
||||
no,62,Post,35,II,1,2,70,733,0
|
||||
yes,37,Pre,22,I,3,23,64,1459,1
|
||||
no,64,Post,21,II,3,403,253,2237,0
|
||||
no,45,Pre,60,II,3,74,212,933,0
|
||||
no,48,Pre,18,I,1,137,73,2056,0
|
||||
yes,50,Post,50,II,6,1,2,1729,0
|
||||
yes,32,Pre,20,II,6,8,3,2024,0
|
||||
no,49,Pre,19,II,2,388,137,2039,1
|
||||
yes,33,Pre,28,III,1,1,1,2027,0
|
||||
yes,58,Post,35,II,1,6,11,2007,0
|
||||
no,57,Post,25,II,1,26,299,1253,1
|
||||
no,45,Pre,35,II,2,26,36,1789,0
|
||||
no,66,Post,30,I,5,100,288,1707,0
|
||||
no,52,Pre,37,II,3,66,104,1714,0
|
||||
yes,49,Pre,25,II,3,152,25,1717,0
|
||||
no,49,Post,22,II,1,14,41,329,1
|
||||
no,48,Post,45,I,1,312,236,1624,0
|
||||
yes,62,Post,60,II,1,56,17,1600,0
|
||||
no,60,Post,35,II,3,115,300,385,1
|
||||
no,45,Pre,10,II,1,82,8,1475,0
|
||||
no,60,Post,37,I,1,296,35,1435,0
|
||||
no,42,Pre,60,II,15,7,5,541,0
|
||||
yes,57,Post,36,III,1,170,192,1329,0
|
||||
yes,53,Post,27,III,12,44,42,1357,0
|
||||
no,56,Post,55,III,3,46,31,1343,0
|
||||
no,46,Pre,23,II,2,120,41,748,1
|
||||
no,49,Post,30,II,2,254,353,1090,1
|
||||
yes,56,Post,32,II,2,53,174,1219,0
|
||||
no,59,Post,24,II,1,860,413,553,0
|
||||
yes,56,Post,42,I,5,113,700,662,1
|
||||
no,46,Pre,32,II,1,108,52,969,0
|
||||
yes,61,Post,27,II,5,141,346,974,0
|
||||
no,40,Pre,40,II,6,227,10,866,1
|
||||
yes,60,Post,40,II,6,8,11,504,1
|
||||
no,49,Pre,30,III,3,1,84,721,0
|
||||
yes,53,Post,25,III,17,0,0,186,0
|
||||
no,51,Pre,25,III,5,43,0,769,1
|
||||
no,52,Post,23,II,3,15,34,727,1
|
||||
no,55,Post,23,II,9,116,15,1701,1
|
|
|
@ -0,0 +1,102 @@
|
|||
<?xml version="1.0"?>
|
||||
<PMML version="4.3" xmlns="http://www.dmg.org/PMML-4_3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.dmg.org/PMML-4_3 http://www.dmg.org/pmml/v4-3/pmml-4-3.xsd">
|
||||
<Header copyright="Copyright (c) 2017 Syncfusion" description="Generalized Linear Regression Model">
|
||||
<Extension name="user" value="Syncfusion" extender="Rattle/PMML"/>
|
||||
<Application name="Rattle/PMML" version="1.4"/>
|
||||
<Timestamp>2017-11-07 16:37:40</Timestamp>
|
||||
</Header>
|
||||
<DataDictionary numberOfFields="10">
|
||||
<DataField name="Indicator" optype="categorical" dataType="string">
|
||||
<Value value="0"/>
|
||||
<Value value="1"/>
|
||||
</DataField>
|
||||
<DataField name="Hormonal_Therapy" optype="categorical" dataType="string">
|
||||
<Value value="no"/>
|
||||
<Value value="yes"/>
|
||||
</DataField>
|
||||
<DataField name="Age" optype="continuous" dataType="double"/>
|
||||
<DataField name="Menopausal_Status" optype="categorical" dataType="string">
|
||||
<Value value="Pre"/>
|
||||
<Value value="Post"/>
|
||||
</DataField>
|
||||
<DataField name="Tumor_Size" optype="continuous" dataType="double"/>
|
||||
<DataField name="Tumor_Grade" optype="categorical" dataType="string">
|
||||
<Value value="I"/>
|
||||
<Value value="II"/>
|
||||
<Value value="III"/>
|
||||
</DataField>
|
||||
<DataField name="Positive_Nodes" optype="continuous" dataType="double"/>
|
||||
<DataField name="Progesterone" optype="continuous" dataType="double"/>
|
||||
<DataField name="Estrogen_Receptor" optype="continuous" dataType="double"/>
|
||||
<DataField name="Survival_Time" optype="continuous" dataType="double"/>
|
||||
</DataDictionary>
|
||||
<GeneralRegressionModel modelName="General_Regression_Model" modelType="generalizedLinear" functionName="classification" algorithmName="glm" distribution="binomial" linkFunction="probit">
|
||||
<MiningSchema>
|
||||
<MiningField name="Indicator" usageType="predicted"/>
|
||||
<MiningField name="Hormonal_Therapy" usageType="active"/>
|
||||
<MiningField name="Age" usageType="active"/>
|
||||
<MiningField name="Menopausal_Status" usageType="active"/>
|
||||
<MiningField name="Tumor_Size" usageType="active"/>
|
||||
<MiningField name="Tumor_Grade" usageType="active"/>
|
||||
<MiningField name="Positive_Nodes" usageType="active"/>
|
||||
<MiningField name="Progesterone" usageType="active"/>
|
||||
<MiningField name="Estrogen_Receptor" usageType="active"/>
|
||||
<MiningField name="Survival_Time" usageType="active"/>
|
||||
</MiningSchema>
|
||||
<Output>
|
||||
<OutputField name="Probability_1" targetField="Indicator" feature="probability" value="1"/>
|
||||
<OutputField name="Predicted_Indicator" feature="predictedValue"/>
|
||||
</Output>
|
||||
<ParameterList>
|
||||
<Parameter name="p0" label="(Intercept)"/>
|
||||
<Parameter name="p1" label="Hormonal_Therapyyes"/>
|
||||
<Parameter name="p2" label="Age"/>
|
||||
<Parameter name="p3" label="Menopausal_StatusPost"/>
|
||||
<Parameter name="p4" label="Tumor_Size"/>
|
||||
<Parameter name="p5" label="Tumor_GradeII"/>
|
||||
<Parameter name="p6" label="Tumor_GradeIII"/>
|
||||
<Parameter name="p7" label="Positive_Nodes"/>
|
||||
<Parameter name="p8" label="Progesterone"/>
|
||||
<Parameter name="p9" label="Estrogen_Receptor"/>
|
||||
<Parameter name="p10" label="Survival_Time"/>
|
||||
</ParameterList>
|
||||
<FactorList>
|
||||
<Predictor name="Hormonal_Therapy"/>
|
||||
<Predictor name="Menopausal_Status"/>
|
||||
<Predictor name="Tumor_Grade"/>
|
||||
</FactorList>
|
||||
<CovariateList>
|
||||
<Predictor name="Age"/>
|
||||
<Predictor name="Tumor_Size"/>
|
||||
<Predictor name="Positive_Nodes"/>
|
||||
<Predictor name="Progesterone"/>
|
||||
<Predictor name="Estrogen_Receptor"/>
|
||||
<Predictor name="Survival_Time"/>
|
||||
</CovariateList>
|
||||
<PPMatrix>
|
||||
<PPCell value="yes" predictorName="Hormonal_Therapy" parameterName="p1"/>
|
||||
<PPCell value="1" predictorName="Age" parameterName="p2"/>
|
||||
<PPCell value="Post" predictorName="Menopausal_Status" parameterName="p3"/>
|
||||
<PPCell value="1" predictorName="Tumor_Size" parameterName="p4"/>
|
||||
<PPCell value="II" predictorName="Tumor_Grade" parameterName="p5"/>
|
||||
<PPCell value="III" predictorName="Tumor_Grade" parameterName="p6"/>
|
||||
<PPCell value="1" predictorName="Positive_Nodes" parameterName="p7"/>
|
||||
<PPCell value="1" predictorName="Progesterone" parameterName="p8"/>
|
||||
<PPCell value="1" predictorName="Estrogen_Receptor" parameterName="p9"/>
|
||||
<PPCell value="1" predictorName="Survival_Time" parameterName="p10"/>
|
||||
</PPMatrix>
|
||||
<ParamMatrix>
|
||||
<PCell targetCategory="1" parameterName="p0" df="1" beta="0.447381757561033"/>
|
||||
<PCell targetCategory="1" parameterName="p1" df="1" beta="-0.0356079759067629"/>
|
||||
<PCell targetCategory="1" parameterName="p2" df="1" beta="-0.00618613367144703"/>
|
||||
<PCell targetCategory="1" parameterName="p3" df="1" beta="0.368885795346473"/>
|
||||
<PCell targetCategory="1" parameterName="p4" df="1" beta="0.00318474265011374"/>
|
||||
<PCell targetCategory="1" parameterName="p5" df="1" beta="0.4513805723142"/>
|
||||
<PCell targetCategory="1" parameterName="p6" df="1" beta="0.342871375926035"/>
|
||||
<PCell targetCategory="1" parameterName="p7" df="1" beta="0.0269053026364811"/>
|
||||
<PCell targetCategory="1" parameterName="p8" df="1" beta="-0.00127003059657835"/>
|
||||
<PCell targetCategory="1" parameterName="p9" df="1" beta="-1.14657984400916e-05"/>
|
||||
<PCell targetCategory="1" parameterName="p10" df="1" beta="-0.00084727674584732"/>
|
||||
</ParamMatrix>
|
||||
</GeneralRegressionModel>
|
||||
</PMML>
|
|
@ -0,0 +1,687 @@
|
|||
,Predicted_censored,CensoredProbability,NonCensoredProbability
|
||||
1,0,0.731205823273195,0.268794176726805
|
||||
2,0,0.750476030567477,0.249523969432523
|
||||
3,1,0.289636057268241,0.710363942731759
|
||||
4,0,0.718618811283181,0.281381188716819
|
||||
5,1,0.394900920488439,0.605099079511561
|
||||
6,1,0.149210510093392,0.850789489906608
|
||||
7,0,0.869453991485122,0.130546008514878
|
||||
8,0,0.871116964130052,0.128883035869948
|
||||
9,1,0.0960524267889543,0.903947573211046
|
||||
10,0,0.726221182769896,0.273778817230104
|
||||
11,1,0.250953576589669,0.749046423410331
|
||||
12,1,0.172086265038349,0.827913734961651
|
||||
13,0,0.750813941077187,0.249186058922813
|
||||
14,0,0.73184950413253,0.26815049586747
|
||||
15,0,0.769805701270852,0.230194298729148
|
||||
16,0,0.609146363754021,0.390853636245979
|
||||
17,0,0.608137646587893,0.391862353412107
|
||||
18,0,0.757322867989939,0.242677132010061
|
||||
19,0,0.888251333229808,0.111748666770192
|
||||
20,0,0.632829087072529,0.367170912927471
|
||||
21,0,0.671639315180071,0.328360684819929
|
||||
22,0,0.739740508221912,0.260259491778088
|
||||
23,0,0.718251006237204,0.281748993762796
|
||||
24,0,0.732932314794588,0.267067685205412
|
||||
25,1,0.0876899289329275,0.912310071067073
|
||||
26,0,0.713197134753147,0.286802865246853
|
||||
27,1,0.330676413346118,0.669323586653882
|
||||
28,0,0.615343384488721,0.384656615511279
|
||||
29,0,0.555952836994529,0.444047163005471
|
||||
30,0,0.706030475443534,0.293969524556466
|
||||
31,0,0.703899213045483,0.296100786954517
|
||||
32,0,0.689126983322607,0.310873016677393
|
||||
33,0,0.983101891548573,0.0168981084514269
|
||||
34,0,0.714692313746452,0.285307686253548
|
||||
35,0,0.597147371374431,0.402852628625569
|
||||
36,0,0.558430811116346,0.441569188883654
|
||||
37,1,0.273698737632977,0.726301262367023
|
||||
38,0,0.650918632810324,0.349081367189676
|
||||
39,1,0.486037090013287,0.513962909986713
|
||||
40,0,0.641985422770297,0.358014577229703
|
||||
41,1,0.438834688323608,0.561165311676392
|
||||
42,1,0.26343938632208,0.73656061367792
|
||||
43,1,0.280761638916437,0.719238361083563
|
||||
44,1,0.478612470966463,0.521387529033537
|
||||
45,1,0.418626423888273,0.581373576111727
|
||||
46,0,0.93617587373954,0.0638241262604601
|
||||
47,0,0.827289529289871,0.172710470710129
|
||||
48,1,0.235656596030642,0.764343403969358
|
||||
49,0,0.766052802305403,0.233947197694597
|
||||
50,1,0.397328111211499,0.602671888788501
|
||||
51,0,0.639132447898201,0.360867552101799
|
||||
52,0,0.635843220709796,0.364156779290204
|
||||
53,0,0.664075747767087,0.335924252232913
|
||||
54,1,0.252608016094905,0.747391983905095
|
||||
55,1,0.274937491344544,0.725062508655456
|
||||
56,1,0.322676956008702,0.677323043991298
|
||||
57,0,0.825661948888273,0.174338051111727
|
||||
58,0,0.867889934794736,0.132110065205264
|
||||
59,0,0.760648207883361,0.239351792116639
|
||||
60,0,0.662422086582086,0.337577913417914
|
||||
61,1,0.16365965590121,0.83634034409879
|
||||
62,0,0.655718574583138,0.344281425416862
|
||||
63,1,0.228328137523287,0.771671862476713
|
||||
64,0,0.718454620460705,0.281545379539295
|
||||
65,0,0.655973547240862,0.344026452759138
|
||||
66,1,0.308715579678574,0.691284420321426
|
||||
67,1,0.320134557916854,0.679865442083146
|
||||
68,1,0.247579400153827,0.752420599846173
|
||||
69,1,0.201240621569067,0.798759378430933
|
||||
70,1,0.290475101689703,0.709524898310297
|
||||
71,0,0.510223618487471,0.489776381512529
|
||||
72,0,0.754446404441559,0.245553595558442
|
||||
73,1,0.398510212379695,0.601489787620305
|
||||
74,1,0.160545983513166,0.839454016486834
|
||||
75,1,0.202546357697098,0.797453642302902
|
||||
76,1,0.319738806200083,0.680261193799917
|
||||
77,0,0.682868938780508,0.317131061219492
|
||||
78,1,0.353960301588294,0.646039698411706
|
||||
79,1,0.356247488621946,0.643752511378054
|
||||
80,0,0.62102875178024,0.37897124821976
|
||||
81,1,0.242873591642435,0.757126408357565
|
||||
82,0,0.657356963371245,0.342643036628755
|
||||
83,1,0.320478557826292,0.679521442173708
|
||||
84,0,0.647379145607986,0.352620854392014
|
||||
85,1,0.45710581137832,0.54289418862168
|
||||
86,1,0.449501883957011,0.550498116042989
|
||||
87,1,0.42484810095269,0.57515189904731
|
||||
88,1,0.243243987847728,0.756756012152272
|
||||
89,1,0.122652294081364,0.877347705918636
|
||||
90,1,0.453731417293751,0.546268582706249
|
||||
91,1,0.162808880297115,0.837191119702885
|
||||
92,0,0.864159368117018,0.135840631882982
|
||||
93,0,0.957071598909729,0.0429284010902714
|
||||
94,0,0.861404819229917,0.138595180770083
|
||||
95,1,0.492691287060924,0.507308712939076
|
||||
96,0,0.910278882273377,0.0897211177266225
|
||||
97,1,0.160588495282923,0.839411504717077
|
||||
98,1,0.381745619835151,0.618254380164849
|
||||
99,0,0.632816668592703,0.367183331407297
|
||||
100,0,0.877099456288637,0.122900543711363
|
||||
101,1,0.344521432985994,0.655478567014006
|
||||
102,0,0.820962215137454,0.179037784862546
|
||||
103,0,0.762044275818762,0.237955724181238
|
||||
104,0,0.582990333918347,0.417009666081653
|
||||
105,1,0.264398059379232,0.735601940620768
|
||||
106,0,0.606294044266707,0.393705955733293
|
||||
107,0,0.848465550573304,0.151534449426696
|
||||
108,1,0.390290346032146,0.609709653967854
|
||||
109,0,0.677592070039566,0.322407929960434
|
||||
110,0,0.812785142140185,0.187214857859815
|
||||
111,0,0.616046977773142,0.383953022226858
|
||||
112,0,0.624263352293387,0.375736647706613
|
||||
113,1,0.141288981536145,0.858711018463855
|
||||
114,1,0.495731706207101,0.504268293792899
|
||||
115,1,0.364329538055327,0.635670461944673
|
||||
116,1,0.0404703894566668,0.959529610543333
|
||||
117,0,0.671231157002884,0.328768842997116
|
||||
118,1,0.366912223903247,0.633087776096753
|
||||
119,1,0.350548951742642,0.649451048257358
|
||||
120,0,0.615914791013836,0.384085208986164
|
||||
121,1,0.196467593024175,0.803532406975825
|
||||
122,1,0.40132337262749,0.59867662737251
|
||||
123,0,0.713335118005933,0.286664881994067
|
||||
124,0,0.706625565867607,0.293374434132393
|
||||
125,0,0.655444214172949,0.344555785827051
|
||||
126,1,0.445482225877828,0.554517774122172
|
||||
127,1,0.238089866004978,0.761910133995022
|
||||
128,1,0.24374986044869,0.75625013955131
|
||||
129,0,0.825334287787465,0.174665712212536
|
||||
130,0,0.848131034922428,0.151868965077572
|
||||
131,0,0.734646127855811,0.265353872144189
|
||||
132,0,0.516361196856304,0.483638803143697
|
||||
133,0,0.543108605315824,0.456891394684176
|
||||
134,1,0.455889505299038,0.544110494700962
|
||||
135,1,0.330110130677999,0.669889869322001
|
||||
136,1,0.192909302249416,0.807090697750584
|
||||
137,0,0.708349068752973,0.291650931247027
|
||||
138,0,0.790258261770506,0.209741738229494
|
||||
139,0,0.819665710743071,0.180334289256929
|
||||
140,0,0.963403126036823,0.036596873963177
|
||||
141,0,0.501642677514145,0.498357322485855
|
||||
142,1,0.277741354628583,0.722258645371417
|
||||
143,0,0.934971048050515,0.0650289519494851
|
||||
144,0,0.864117684696798,0.135882315303202
|
||||
145,1,0.35470858477045,0.64529141522955
|
||||
146,1,0.207853462252349,0.792146537747651
|
||||
147,0,0.777163709671701,0.222836290328299
|
||||
148,1,0.237482174133729,0.762517825866271
|
||||
149,1,0.305774581172904,0.694225418827096
|
||||
150,0,0.765393358597574,0.234606641402426
|
||||
151,1,0.345942387548265,0.654057612451735
|
||||
152,1,0.393495743842754,0.606504256157246
|
||||
153,1,0.460936022095909,0.539063977904091
|
||||
154,1,0.458889589474637,0.541110410525363
|
||||
155,1,0.498063694133898,0.501936305866102
|
||||
156,1,0.272637328915433,0.727362671084567
|
||||
157,1,0.36069227867055,0.63930772132945
|
||||
158,1,0.165617638810583,0.834382361189417
|
||||
159,0,0.519209737286919,0.480790262713081
|
||||
160,1,0.295819581349368,0.704180418650632
|
||||
161,0,0.714321904759117,0.285678095240883
|
||||
162,0,0.861272211049492,0.138727788950508
|
||||
163,0,0.554364079380934,0.445635920619066
|
||||
164,1,0.410371231535823,0.589628768464177
|
||||
165,0,0.920474344458859,0.0795256555411406
|
||||
166,1,0.203883441186138,0.796116558813862
|
||||
167,1,0.207199538628347,0.792800461371653
|
||||
168,0,0.635236875955489,0.364763124044511
|
||||
169,0,0.763498327794365,0.236501672205635
|
||||
170,1,0.26616361041219,0.73383638958781
|
||||
171,1,0.318644838196867,0.681355161803133
|
||||
172,1,0.309315036941021,0.690684963058979
|
||||
173,1,0.435222212375823,0.564777787624177
|
||||
174,0,0.61414269098453,0.38585730901547
|
||||
175,0,0.813315029065759,0.186684970934241
|
||||
176,1,0.42081369255526,0.57918630744474
|
||||
177,0,0.751484081855103,0.248515918144897
|
||||
178,0,0.912139807489992,0.0878601925100084
|
||||
179,1,0.150040520598496,0.849959479401504
|
||||
180,1,0.45147839345491,0.54852160654509
|
||||
181,0,0.851011926587642,0.148988073412358
|
||||
182,0,0.925673373118306,0.0743266268816939
|
||||
183,0,0.958574655361557,0.0414253446384431
|
||||
184,0,0.893798340402769,0.106201659597231
|
||||
185,0,0.839973148696439,0.160026851303561
|
||||
186,0,0.780869703623528,0.219130296376472
|
||||
187,1,0.316802987679109,0.683197012320891
|
||||
188,0,0.849269759871174,0.150730240128826
|
||||
189,1,0.417805940654359,0.582194059345641
|
||||
190,1,0.136397329869546,0.863602670130454
|
||||
191,0,0.754453608870094,0.245546391129906
|
||||
192,0,0.719365155446314,0.280634844553686
|
||||
193,1,0.304149265532567,0.695850734467433
|
||||
194,0,0.670413493816368,0.329586506183633
|
||||
195,0,0.6106089916757,0.3893910083243
|
||||
196,0,0.926849477650427,0.0731505223495727
|
||||
197,1,0.46915605477493,0.53084394522507
|
||||
198,0,0.556010433936117,0.443989566063883
|
||||
199,1,0.32704483691616,0.67295516308384
|
||||
200,1,0.339282976328162,0.660717023671838
|
||||
201,0,0.873081055353122,0.126918944646878
|
||||
202,0,0.970209179274374,0.0297908207256258
|
||||
203,0,0.88723860853139,0.11276139146861
|
||||
204,1,0.289881637242269,0.710118362757731
|
||||
205,0,0.584882837440423,0.415117162559577
|
||||
206,0,0.534701338750597,0.465298661249403
|
||||
207,1,0.171422360605025,0.828577639394975
|
||||
208,0,0.842251806262465,0.157748193737535
|
||||
209,0,0.754060207775489,0.245939792224511
|
||||
210,1,0.0645321325590152,0.935467867440985
|
||||
211,0,0.671009887556608,0.328990112443392
|
||||
212,0,0.840860676226246,0.159139323773754
|
||||
213,0,0.571537900052714,0.428462099947286
|
||||
214,1,0.223312905803633,0.776687094196367
|
||||
215,1,0.220325173249731,0.779674826750269
|
||||
216,0,0.81935948328396,0.18064051671604
|
||||
217,0,0.514524432627437,0.485475567372563
|
||||
218,1,0.296396170972062,0.703603829027938
|
||||
219,1,0.229271176470064,0.770728823529936
|
||||
220,1,0.367694340508959,0.632305659491041
|
||||
221,1,0.333486799103044,0.666513200896956
|
||||
222,0,0.817243802071867,0.182756197928133
|
||||
223,0,0.935926504546797,0.0640734954532025
|
||||
224,1,0.307252407857018,0.692747592142982
|
||||
225,0,0.799265547784455,0.200734452215545
|
||||
226,0,0.833815043193783,0.166184956806217
|
||||
227,1,0.0961841983028823,0.903815801697118
|
||||
228,1,0.0788200602758919,0.921179939724108
|
||||
229,1,0.434539564308989,0.565460435691011
|
||||
230,0,0.572026065039313,0.427973934960687
|
||||
231,1,0.480129162907536,0.519870837092464
|
||||
232,0,0.626720975402865,0.373279024597135
|
||||
233,1,0.361932070132139,0.638067929867861
|
||||
234,1,0.346681995526636,0.653318004473364
|
||||
235,1,0.372431330123217,0.627568669876783
|
||||
236,0,0.8959250655189,0.1040749344811
|
||||
237,1,0.261352618535291,0.738647381464709
|
||||
238,1,0.431133435143857,0.568866564856143
|
||||
239,0,0.528086285029547,0.471913714970453
|
||||
240,0,0.893949843496147,0.106050156503853
|
||||
241,0,0.853639585179845,0.146360414820155
|
||||
242,0,0.725333627715737,0.274666372284263
|
||||
243,0,0.533294325044486,0.466705674955514
|
||||
244,1,0.350030570104365,0.649969429895635
|
||||
245,0,0.683908868713484,0.316091131286516
|
||||
246,1,0.492361592250918,0.507638407749082
|
||||
247,0,0.787903603328531,0.212096396671469
|
||||
248,1,0.230668843855547,0.769331156144453
|
||||
249,0,0.705564141767196,0.294435858232804
|
||||
250,0,0.674530286279958,0.325469713720042
|
||||
251,0,0.720316005006302,0.279683994993698
|
||||
252,0,0.616704718735766,0.383295281264234
|
||||
253,0,0.684771323816599,0.315228676183401
|
||||
254,1,0.333367979280377,0.666632020719623
|
||||
255,0,0.613611859327942,0.386388140672058
|
||||
256,1,0.421204887180336,0.578795112819664
|
||||
257,1,0.325344761244333,0.674655238755667
|
||||
258,1,0.433284790586944,0.566715209413056
|
||||
259,1,0.49958878273411,0.50041121726589
|
||||
260,1,0.343927832285564,0.656072167714436
|
||||
261,0,0.695709795280237,0.304290204719763
|
||||
262,1,0.164484886966114,0.835515113033886
|
||||
263,0,0.802481117341313,0.197518882658687
|
||||
264,0,0.582142918196821,0.417857081803179
|
||||
265,0,0.5726949826455,0.4273050173545
|
||||
266,0,0.758581001090505,0.241418998909495
|
||||
267,1,0.230322430412296,0.769677569587704
|
||||
268,0,0.571434125857656,0.428565874142344
|
||||
269,0,0.727977527926148,0.272022472073852
|
||||
270,1,0.40181913842241,0.59818086157759
|
||||
271,0,0.906999444024733,0.0930005559752668
|
||||
272,0,0.947617371885409,0.052382628114591
|
||||
273,1,0.371266689978923,0.628733310021077
|
||||
274,0,0.905278779096281,0.0947212209037186
|
||||
275,0,0.880272198762179,0.119727801237821
|
||||
276,1,0.491692100150717,0.508307899849283
|
||||
277,0,0.682807408465835,0.317192591534165
|
||||
278,0,0.981845060858846,0.0181549391411539
|
||||
279,0,0.779950165286839,0.220049834713161
|
||||
280,0,0.658179084984114,0.341820915015886
|
||||
281,0,0.743454224751424,0.256545775248576
|
||||
282,0,0.872940278486478,0.127059721513522
|
||||
283,0,0.803679330336887,0.196320669663113
|
||||
284,1,0.38144650339767,0.61855349660233
|
||||
285,0,0.952875484885338,0.0471245151146615
|
||||
286,0,0.923395457810257,0.0766045421897432
|
||||
287,0,0.786001614795535,0.213998385204465
|
||||
288,1,0.315496096032647,0.684503903967353
|
||||
289,0,0.829273349722068,0.170726650277932
|
||||
290,0,0.746413602848858,0.253586397151142
|
||||
291,0,0.902742722241295,0.0972572777587049
|
||||
292,0,0.793435521075924,0.206564478924076
|
||||
293,0,0.889523776873676,0.110476223126324
|
||||
294,0,0.860119202371371,0.139880797628629
|
||||
295,0,0.69617982758026,0.30382017241974
|
||||
296,1,0.233177377939226,0.766822622060774
|
||||
297,0,0.573079394900566,0.426920605099434
|
||||
298,0,0.855645482391212,0.144354517608788
|
||||
299,0,0.873541846303063,0.126458153696937
|
||||
300,0,0.736682685678041,0.263317314321959
|
||||
301,0,0.626051168939658,0.373948831060342
|
||||
302,0,0.705064055162603,0.294935944837397
|
||||
303,1,0.488895262469697,0.511104737530303
|
||||
304,0,0.725361928386177,0.274638071613823
|
||||
305,1,0.358811047120431,0.641188952879569
|
||||
306,0,0.637705604215778,0.362294395784222
|
||||
307,0,0.823471840960183,0.176528159039817
|
||||
308,1,0.425465716665699,0.574534283334301
|
||||
309,1,0.305577303003135,0.694422696996865
|
||||
310,1,0.211352335498933,0.788647664501067
|
||||
311,0,0.801012507997669,0.198987492002331
|
||||
312,0,0.722396017328028,0.277603982671972
|
||||
313,1,0.358072795284701,0.641927204715299
|
||||
314,1,0.373228533902344,0.626771466097656
|
||||
315,1,0.435330759648327,0.564669240351673
|
||||
316,1,0.418181217354095,0.581818782645905
|
||||
317,0,0.642129589919794,0.357870410080206
|
||||
318,1,0.319592000412713,0.680407999587287
|
||||
319,0,0.991014444119018,0.00898555588098241
|
||||
320,1,0.456726284459247,0.543273715540753
|
||||
321,1,0.466002659697261,0.533997340302739
|
||||
322,1,0.317786753695247,0.682213246304753
|
||||
323,0,0.668969271218037,0.331030728781963
|
||||
324,0,0.687109634928907,0.312890365071093
|
||||
325,0,0.614002006737493,0.385997993262507
|
||||
326,1,0.366587582449444,0.633412417550556
|
||||
327,1,0.312598232250621,0.687401767749379
|
||||
328,0,0.807778106608626,0.192221893391374
|
||||
329,1,0.366402447619705,0.633597552380295
|
||||
330,0,0.81728481257892,0.18271518742108
|
||||
331,1,0.15864248723012,0.84135751276988
|
||||
332,1,0.443056976126781,0.556943023873219
|
||||
333,0,0.558091062846698,0.441908937153302
|
||||
334,1,0.488398302174354,0.511601697825646
|
||||
335,1,0.374065781109891,0.625934218890109
|
||||
336,1,0.202108955076765,0.797891044923235
|
||||
337,0,0.774282074799527,0.225717925200473
|
||||
338,0,0.93391850695649,0.06608149304351
|
||||
339,1,0.327080627324447,0.672919372675553
|
||||
340,1,0.284055052487163,0.715944947512837
|
||||
341,0,0.925029506566686,0.0749704934333141
|
||||
342,0,0.730400759386345,0.269599240613655
|
||||
343,1,0.313207930857478,0.686792069142522
|
||||
344,0,0.613502467659338,0.386497532340662
|
||||
345,1,0.342372539311735,0.657627460688265
|
||||
346,1,0.331340041814668,0.668659958185332
|
||||
347,0,0.781930413841748,0.218069586158252
|
||||
348,1,0.268608564597489,0.731391435402511
|
||||
349,1,0.409778200296275,0.590221799703725
|
||||
350,0,0.635829994823002,0.364170005176998
|
||||
351,1,0.285654733761745,0.714345266238255
|
||||
352,0,0.764462890310545,0.235537109689455
|
||||
353,1,0.337171405266952,0.662828594733048
|
||||
354,1,0.352292243031903,0.647707756968097
|
||||
355,1,0.357286332772845,0.642713667227155
|
||||
356,1,0.452186096845092,0.547813903154908
|
||||
357,0,0.634688824328146,0.365311175671854
|
||||
358,0,0.982850019941233,0.0171499800587666
|
||||
359,0,0.818646560641535,0.181353439358465
|
||||
360,1,0.274787947965927,0.725212052034073
|
||||
361,0,0.537084510491683,0.462915489508317
|
||||
362,0,0.717873870782775,0.282126129217225
|
||||
363,0,0.931711444376276,0.0682885556237244
|
||||
364,0,0.812936860905216,0.187063139094784
|
||||
365,0,0.616046080478963,0.383953919521037
|
||||
366,0,0.632078576917645,0.367921423082355
|
||||
367,0,0.514104520464614,0.485895479535386
|
||||
368,0,0.719435990081674,0.280564009918326
|
||||
369,0,0.636768659786656,0.363231340213344
|
||||
370,0,0.929835336439985,0.0701646635600153
|
||||
371,0,0.879221024658737,0.120778975341263
|
||||
372,1,0.265228667607554,0.734771332392446
|
||||
373,1,0.381208183424642,0.618791816575358
|
||||
374,1,0.451445348864101,0.548554651135899
|
||||
375,0,0.858494787390656,0.141505212609344
|
||||
376,0,0.894818590969358,0.105181409030642
|
||||
377,0,0.82551122117794,0.17448877882206
|
||||
378,0,0.902627490469518,0.0973725095304823
|
||||
379,1,0.462119112119832,0.537880887880168
|
||||
380,1,0.304038188626984,0.695961811373016
|
||||
381,0,0.849380447426252,0.150619552573748
|
||||
382,1,0.172024733635139,0.827975266364861
|
||||
383,0,0.845571282509195,0.154428717490805
|
||||
384,1,0.169864943758776,0.830135056241224
|
||||
385,0,0.916321794009951,0.0836782059900492
|
||||
386,0,0.855333158076426,0.144666841923574
|
||||
387,1,0.441108779699342,0.558891220300658
|
||||
388,0,0.646715601456314,0.353284398543686
|
||||
389,1,0.384937337612508,0.615062662387492
|
||||
390,1,0.324105591575489,0.675894408424511
|
||||
391,0,0.870328625402944,0.129671374597056
|
||||
392,0,0.543865435801454,0.456134564198546
|
||||
393,1,0.347595369320436,0.652404630679564
|
||||
394,0,0.819585169778861,0.180414830221139
|
||||
395,1,0.431085351522812,0.568914648477188
|
||||
396,1,0.471710602693207,0.528289397306793
|
||||
397,0,0.799197881361195,0.200802118638805
|
||||
398,0,0.643294921394207,0.356705078605793
|
||||
399,1,0.497972748472579,0.502027251527421
|
||||
400,0,0.626756921521083,0.373243078478917
|
||||
401,1,0.367945275055564,0.632054724944436
|
||||
402,0,0.657088151302416,0.342911848697583
|
||||
403,0,0.737889224989531,0.262110775010469
|
||||
404,0,0.822682017644063,0.177317982355937
|
||||
405,0,0.934120704450223,0.0658792955497774
|
||||
406,0,0.510307818907712,0.489692181092288
|
||||
407,1,0.4937573485155,0.5062426514845
|
||||
408,0,0.910685828154667,0.089314171845333
|
||||
409,0,0.596190098268863,0.403809901731137
|
||||
410,0,0.70973317615373,0.29026682384627
|
||||
411,1,0.41795724898658,0.58204275101342
|
||||
412,1,0.259720707648866,0.740279292351134
|
||||
413,0,0.666012345223656,0.333987654776344
|
||||
414,0,0.619312232214122,0.380687767785878
|
||||
415,0,0.89129022188004,0.10870977811996
|
||||
416,1,0.443461366989616,0.556538633010384
|
||||
417,0,0.617346285772917,0.382653714227083
|
||||
418,0,0.598907880084102,0.401092119915898
|
||||
419,0,0.835218859571073,0.164781140428927
|
||||
420,0,0.553533025744433,0.446466974255567
|
||||
421,1,0.272239115836231,0.727760884163769
|
||||
422,1,0.397752469503012,0.602247530496988
|
||||
423,0,0.57261163864264,0.42738836135736
|
||||
424,1,0.317256327317458,0.682743672682542
|
||||
425,0,0.520051018582522,0.479948981417478
|
||||
426,0,0.751037642069947,0.248962357930053
|
||||
427,0,0.523291964725158,0.476708035274842
|
||||
428,1,0.358577071254163,0.641422928745837
|
||||
429,0,0.850830517260289,0.149169482739711
|
||||
430,0,0.717422885476502,0.282577114523498
|
||||
431,1,0.274681873734282,0.725318126265718
|
||||
432,0,0.797547784429099,0.202452215570901
|
||||
433,0,0.929273396226107,0.0707266037738925
|
||||
434,0,0.948780240924325,0.0512197590756747
|
||||
435,1,0.291345754106474,0.708654245893526
|
||||
436,1,0.427385650408634,0.572614349591366
|
||||
437,1,0.37949655054101,0.62050344945899
|
||||
438,1,0.289415097049019,0.710584902950981
|
||||
439,1,0.324078469506016,0.675921530493984
|
||||
440,1,0.169746608671991,0.830253391328009
|
||||
441,1,0.18994547258107,0.81005452741893
|
||||
442,0,0.71434127981109,0.28565872018891
|
||||
443,1,0.314462189697528,0.685537810302472
|
||||
444,0,0.796788155588369,0.203211844411631
|
||||
445,0,0.656599573458215,0.343400426541785
|
||||
446,0,0.663998649448039,0.336001350551961
|
||||
447,1,0.372028120755394,0.627971879244606
|
||||
448,1,0.240513270982721,0.759486729017279
|
||||
449,1,0.256684120734542,0.743315879265458
|
||||
450,1,0.220064425507861,0.779935574492139
|
||||
451,0,0.775458112414737,0.224541887585263
|
||||
452,1,0.21627254598199,0.78372745401801
|
||||
453,0,0.533298192460963,0.466701807539037
|
||||
454,0,0.857929645143828,0.142070354856172
|
||||
455,1,0.330273962823397,0.669726037176603
|
||||
456,0,0.963747143396687,0.0362528566033126
|
||||
457,1,0.467175847544632,0.532824152455368
|
||||
458,0,0.624539474219489,0.375460525780511
|
||||
459,1,0.478964531237481,0.521035468762519
|
||||
460,0,0.901307263268192,0.0986927367318076
|
||||
461,0,0.996816660917422,0.00318333908257772
|
||||
462,1,0.122171367473528,0.877828632526472
|
||||
463,0,0.588214814826248,0.411785185173752
|
||||
464,1,0.347975690001082,0.652024309998918
|
||||
465,1,0.101444061141106,0.898555938858894
|
||||
466,1,0.249871149177436,0.750128850822564
|
||||
467,0,0.712933103216068,0.287066896783932
|
||||
468,0,0.949689167807038,0.0503108321929618
|
||||
469,0,0.654283869170431,0.345716130829569
|
||||
470,0,0.860192632899271,0.139807367100729
|
||||
471,0,0.95889850862496,0.0411014913750401
|
||||
472,0,0.639803923085373,0.360196076914627
|
||||
473,1,0.338589727745247,0.661410272254753
|
||||
474,0,0.93702763211122,0.0629723678887805
|
||||
475,0,0.879483312741329,0.120516687258671
|
||||
476,0,0.872998944385218,0.127001055614783
|
||||
477,0,0.659480307582435,0.340519692417565
|
||||
478,0,0.796718121145747,0.203281878854253
|
||||
479,0,0.879962968064907,0.120037031935093
|
||||
480,0,0.909687930131501,0.0903120698684992
|
||||
481,0,0.630308416943522,0.369691583056478
|
||||
482,0,0.877924695818326,0.122075304181674
|
||||
483,0,0.737263051627918,0.262736948372082
|
||||
484,1,0.364952150323863,0.635047849676137
|
||||
485,0,0.638906862325167,0.361093137674833
|
||||
486,1,0.2262696597235,0.7737303402765
|
||||
487,0,0.831015675068575,0.168984324931425
|
||||
488,0,0.748865119521222,0.251134880478778
|
||||
489,0,0.857186813754601,0.142813186245399
|
||||
490,0,0.727385560209069,0.272614439790931
|
||||
491,1,0.491288505893656,0.508711494106344
|
||||
492,1,0.42462157813899,0.57537842186101
|
||||
493,1,0.434204289139367,0.565795710860633
|
||||
494,0,0.662521288837119,0.337478711162881
|
||||
495,0,0.914966565633129,0.0850334343668713
|
||||
496,1,0.329906087992645,0.670093912007355
|
||||
497,0,0.512593552657618,0.487406447342382
|
||||
498,0,0.929650513873862,0.0703494861261378
|
||||
499,1,0.433520936793445,0.566479063206555
|
||||
500,0,0.675319650246236,0.324680349753765
|
||||
501,1,0.435616733371343,0.564383266628657
|
||||
502,1,0.248992051516674,0.751007948483326
|
||||
503,0,0.895770641676688,0.104229358323312
|
||||
504,0,0.960997502132513,0.0390024978674871
|
||||
505,1,0.401490061279648,0.598509938720352
|
||||
506,1,0.241718969872239,0.758281030127761
|
||||
507,0,0.695473758133958,0.304526241866042
|
||||
508,1,0.268888420826689,0.731111579173311
|
||||
509,0,0.855916168337171,0.144083831662829
|
||||
510,1,0.357847977331381,0.642152022668619
|
||||
511,0,0.561237708058636,0.438762291941364
|
||||
512,1,0.453854933414349,0.546145066585651
|
||||
513,1,0.308636972680479,0.691363027319521
|
||||
514,1,0.18285871127563,0.81714128872437
|
||||
515,1,0.186545962384821,0.813454037615179
|
||||
516,0,0.669960555724204,0.330039444275796
|
||||
517,1,0.168056908374923,0.831943091625077
|
||||
518,0,0.620072295801699,0.379927704198301
|
||||
519,0,0.810640203044072,0.189359796955928
|
||||
520,0,0.590821340350264,0.409178659649736
|
||||
521,1,0.364440711432055,0.635559288567945
|
||||
522,0,0.934234968780821,0.065765031219179
|
||||
523,1,0.494051229594554,0.505948770405446
|
||||
524,0,0.707764044604398,0.292235955395602
|
||||
525,1,0.40204226580167,0.59795773419833
|
||||
526,0,0.705423097410691,0.294576902589309
|
||||
527,0,0.948234602656744,0.0517653973432557
|
||||
528,0,0.530692648119046,0.469307351880954
|
||||
529,1,0.459875591482718,0.540124408517282
|
||||
530,1,0.24645051091832,0.75354948908168
|
||||
531,1,0.277368634882604,0.722631365117396
|
||||
532,0,0.528014833189014,0.471985166810986
|
||||
533,1,0.281950324146081,0.718049675853919
|
||||
534,0,0.649747003600529,0.350252996399471
|
||||
535,1,0.255495357048157,0.744504642951843
|
||||
536,1,0.356412704607919,0.643587295392081
|
||||
537,1,0.328823572089301,0.671176427910699
|
||||
538,1,0.427606363920392,0.572393636079608
|
||||
539,0,0.511342916673917,0.488657083326083
|
||||
540,0,0.759936448213963,0.240063551786037
|
||||
541,0,0.554372007673363,0.445627992326637
|
||||
542,1,0.376218457186551,0.623781542813449
|
||||
543,0,0.683890124410739,0.316109875589261
|
||||
544,1,0.388206300915867,0.611793699084133
|
||||
545,1,0.447831725457363,0.552168274542637
|
||||
546,1,0.464268114376689,0.535731885623311
|
||||
547,1,0.450976390190438,0.549023609809562
|
||||
548,1,0.395795208299751,0.604204791700249
|
||||
549,1,0.452905316426448,0.547094683573552
|
||||
550,1,0.077880611103514,0.922119388896486
|
||||
551,1,0.114290404462519,0.885709595537481
|
||||
552,0,0.554897910654053,0.445102089345947
|
||||
553,0,0.557263298802294,0.442736701197706
|
||||
554,1,0.406788350815681,0.593211649184319
|
||||
555,1,0.137706823228117,0.862293176771883
|
||||
556,1,0.0948896195046398,0.90511038049536
|
||||
557,1,0.180914517485975,0.819085482514025
|
||||
558,1,0.151744132360141,0.848255867639859
|
||||
559,1,0.342825170106089,0.657174829893911
|
||||
560,1,0.217814053267822,0.782185946732178
|
||||
561,0,0.832389263659405,0.167610736340595
|
||||
562,1,0.208691272729521,0.791308727270479
|
||||
563,1,0.299031295735374,0.700968704264626
|
||||
564,0,0.882599124514286,0.117400875485714
|
||||
565,1,0.461461360259794,0.538538639740206
|
||||
566,0,0.537650977830592,0.462349022169408
|
||||
567,1,0.331811168236666,0.668188831763334
|
||||
568,0,0.643535569633174,0.356464430366826
|
||||
569,1,0.238670811828945,0.761329188171055
|
||||
570,1,0.364066503457816,0.635933496542184
|
||||
571,0,0.84841805837029,0.15158194162971
|
||||
572,0,0.825601021399541,0.174398978600459
|
||||
573,0,0.883684802791142,0.116315197208858
|
||||
574,0,0.554327109178261,0.445672890821739
|
||||
575,0,0.58120896518664,0.41879103481336
|
||||
576,0,0.946321054455179,0.0536789455448213
|
||||
577,0,0.677004596187487,0.322995403812513
|
||||
578,1,0.304929496786543,0.695070503213457
|
||||
579,0,0.620131998552138,0.379868001447862
|
||||
580,1,0.319507117416943,0.680492882583057
|
||||
581,1,0.199221862183023,0.800778137816977
|
||||
582,1,0.128641467807095,0.871358532192905
|
||||
583,0,0.739382536824694,0.260617463175306
|
||||
584,0,0.9214816284224,0.0785183715775998
|
||||
585,0,0.662777385032299,0.337222614967701
|
||||
586,1,0.434211416671443,0.565788583328557
|
||||
587,0,0.920365176890839,0.0796348231091611
|
||||
588,1,0.257185111208333,0.742814888791667
|
||||
589,0,0.611151731156796,0.388848268843204
|
||||
590,1,0.342030317892613,0.657969682107387
|
||||
591,1,0.273482367936473,0.726517632063527
|
||||
592,0,0.782113661942103,0.217886338057897
|
||||
593,0,0.698410468979269,0.301589531020731
|
||||
594,0,0.506291789911895,0.493708210088104
|
||||
595,0,0.523987724543831,0.476012275456169
|
||||
596,1,0.450082354307495,0.549917645692505
|
||||
597,1,0.401000762194453,0.598999237805547
|
||||
598,1,0.421552305778971,0.578447694221029
|
||||
599,0,0.731714711916863,0.268285288083137
|
||||
600,1,0.245886967801721,0.754113032198279
|
||||
601,1,0.363174662072174,0.636825337927826
|
||||
602,1,0.369309456897192,0.630690543102808
|
||||
603,1,0.25205472036773,0.74794527963227
|
||||
604,0,0.585655310065711,0.414344689934289
|
||||
605,0,0.63569213353246,0.36430786646754
|
||||
606,1,0.319611395913932,0.680388604086068
|
||||
607,0,0.546066090125624,0.453933909874376
|
||||
608,1,0.335326393137986,0.664673606862014
|
||||
609,0,0.636161333437318,0.363838666562682
|
||||
610,1,0.265471713710786,0.734528286289214
|
||||
611,0,0.546685158369133,0.453314841630867
|
||||
612,1,0.348689859156304,0.651310140843696
|
||||
613,1,0.255112619886273,0.744887380113727
|
||||
614,1,0.406598582331959,0.593401417668041
|
||||
615,0,0.749893126490259,0.250106873509741
|
||||
616,1,0.4141484633424,0.5858515366576
|
||||
617,1,0.384178766521513,0.615821233478487
|
||||
618,1,0.264275723620012,0.735724276379988
|
||||
619,1,0.41374177264892,0.58625822735108
|
||||
620,1,0.223722208741903,0.776277791258097
|
||||
621,1,0.296039431646191,0.703960568353809
|
||||
622,1,0.400470607269979,0.599529392730021
|
||||
623,1,0.402986771978141,0.597013228021859
|
||||
624,0,0.504676624514751,0.495323375485249
|
||||
625,1,0.339767626595929,0.660232373404071
|
||||
626,1,0.173107504261258,0.826892495738742
|
||||
627,1,0.422853358479088,0.577146641520912
|
||||
628,1,0.298947940649288,0.701052059350712
|
||||
629,0,0.82309637204937,0.17690362795063
|
||||
630,0,0.865174624247532,0.134825375752468
|
||||
631,0,0.956378139832768,0.0436218601672317
|
||||
632,0,0.751194792457458,0.248805207542542
|
||||
633,1,0.274473960105465,0.725526039894535
|
||||
634,1,0.311432984138997,0.688567015861003
|
||||
635,0,0.79569493779133,0.20430506220867
|
||||
636,1,0.478920481548785,0.521079518451215
|
||||
637,0,0.90987162408253,0.0901283759174704
|
||||
638,0,0.71992539254196,0.28007460745804
|
||||
639,0,0.621837068924636,0.378162931075364
|
||||
640,1,0.259897253423575,0.740102746576425
|
||||
641,1,0.308192313742999,0.691807686257001
|
||||
642,1,0.158359858183399,0.841640141816601
|
||||
643,0,0.685011653986875,0.314988346013125
|
||||
644,0,0.823911151365273,0.176088848634727
|
||||
645,1,0.319753881418086,0.680246118581914
|
||||
646,1,0.310083875875182,0.689916124124818
|
||||
647,0,0.958947397254142,0.0410526027458578
|
||||
648,1,0.34528464585138,0.65471535414862
|
||||
649,0,0.824449078538807,0.175550921461193
|
||||
650,0,0.917849402995521,0.082150597004479
|
||||
651,1,0.497899752420548,0.502100247579452
|
||||
652,0,0.953730526046099,0.046269473953901
|
||||
653,0,0.588166885376082,0.411833114623918
|
||||
654,0,0.798073019611196,0.201926980388804
|
||||
655,0,0.934730203551681,0.0652697964483187
|
||||
656,0,0.853630186584249,0.146369813415751
|
||||
657,0,0.756978130921705,0.243021869078295
|
||||
658,0,0.530499071406782,0.469500928593218
|
||||
659,0,0.777431899765274,0.222568100234726
|
||||
660,0,0.826020390459328,0.173979609540672
|
||||
661,0,0.776854206573572,0.223145793426428
|
||||
662,0,0.823228043960897,0.176771956039103
|
||||
663,1,0.222286860282777,0.777713139717223
|
||||
664,0,0.861123539347689,0.138876460652311
|
||||
665,0,0.640752044926332,0.359247955073668
|
||||
666,1,0.269949013797866,0.730050986202134
|
||||
667,0,0.750107600024518,0.249892399975482
|
||||
668,0,0.841908406464379,0.158091593535621
|
||||
669,1,0.22175350415512,0.77824649584488
|
||||
670,0,0.667005749444706,0.332994250555294
|
||||
671,0,0.500638268426741,0.499361731573259
|
||||
672,0,0.550956107872732,0.449043892127268
|
||||
673,0,0.51809655661669,0.48190344338331
|
||||
674,0,0.554202559146251,0.445797440853749
|
||||
675,0,0.524239954423146,0.475760045576854
|
||||
676,0,0.71208985836627,0.28791014163373
|
||||
677,0,0.503955418455593,0.496044581544407
|
||||
678,0,0.585410030165569,0.414589969834431
|
||||
679,1,0.473326067294239,0.526673932705761
|
||||
680,0,0.532682512079542,0.467317487920458
|
||||
681,1,0.238114809612963,0.761885190387037
|
||||
682,1,0.479953184887017,0.520046815112983
|
||||
683,1,0.119981134703321,0.880018865296679
|
||||
684,0,0.506886094960408,0.493113905039592
|
||||
685,1,0.321136301509421,0.678863698490579
|
||||
686,0,0.63529320868515,0.36470679131485
|
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче