本文整理汇总了C#中IMatrixData.SetAnnotationRows方法的典型用法代码示例。如果您正苦于以下问题:C# IMatrixData.SetAnnotationRows方法的具体用法?C# IMatrixData.SetAnnotationRows怎么用?C# IMatrixData.SetAnnotationRows使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IMatrixData
的用法示例。
在下文中一共展示了IMatrixData.SetAnnotationRows方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ProcessData
public void ProcessData(IMatrixData mdata, Parameters param, ref IMatrixData[] supplTables,
ref IDocumentData[] documents, ProcessInfo processInfo)
{
int nameCol = param.GetParam<int>("New column names").Value;
List<string> colNames;
if (nameCol >= 0){
HashSet<string> taken = new HashSet<string>();
colNames = new List<string>();
foreach (string n in mdata.StringColumns[nameCol]){
string n1 = StringUtils.GetNextAvailableName(n, taken);
taken.Add(n1);
colNames.Add(n1);
}
} else{
colNames = new List<string>();
for (int i = 0; i < mdata.RowCount; i++){
colNames.Add("Column" + (i + 1));
}
}
List<string> rowNames = mdata.ColumnNames;
mdata.Values = mdata.Values.Transpose();
if (mdata.IsImputed != null){
mdata.IsImputed = mdata.IsImputed.Transpose();
}
if (mdata.Quality != null){
mdata.Quality = mdata.Quality.Transpose();
}
List<string> stringColumnNames = mdata.StringColumnNames;
List<string> categoryColumnNames = mdata.CategoryColumnNames;
List<string> numericColumnNames = mdata.NumericColumnNames;
List<string> multiNumericColumnNames = mdata.MultiNumericColumnNames;
List<string> stringColumnDescriptions = mdata.StringColumnDescriptions;
List<string> categoryColumnDescriptions = mdata.CategoryColumnDescriptions;
List<string> numericColumnDescriptions = mdata.NumericColumnDescriptions;
List<string> multiNumericColumnDescriptions = mdata.MultiNumericColumnDescriptions;
List<string[]> stringColumns = mdata.StringColumns;
List<string[][]> categoryColumns = GetCategoryColumns(mdata);
List<double[]> numericColumns = mdata.NumericColumns;
List<double[][]> multiNumericColumns = mdata.MultiNumericColumns;
mdata.SetAnnotationColumns(new List<string>(new[]{"Name"}), new List<string>(new[]{"Name"}),
new List<string[]>(new[]{rowNames.ToArray()}), mdata.CategoryRowNames, mdata.CategoryRowDescriptions,
GetCategoryRows(mdata), mdata.NumericRowNames, mdata.NumericRowDescriptions, mdata.NumericRows, new List<string>(),
new List<string>(), new List<double[][]>());
mdata.ColumnNames = colNames;
mdata.SetAnnotationRows(stringColumnNames, stringColumnDescriptions, stringColumns, categoryColumnNames,
categoryColumnDescriptions, categoryColumns, numericColumnNames, numericColumnDescriptions, numericColumns,
multiNumericColumnNames, multiNumericColumnDescriptions, multiNumericColumns);
}