本文整理汇总了C#中IMatrixData.RemoveCategoryRowAt方法的典型用法代码示例。如果您正苦于以下问题:C# IMatrixData.RemoveCategoryRowAt方法的具体用法?C# IMatrixData.RemoveCategoryRowAt怎么用?C# IMatrixData.RemoveCategoryRowAt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IMatrixData
的用法示例。
在下文中一共展示了IMatrixData.RemoveCategoryRowAt方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ProcessDataDelete
private static void ProcessDataDelete(IMatrixData mdata, Parameters param)
{
int groupColInd = param.GetSingleChoiceParam("Category row").Value;
mdata.RemoveCategoryRowAt(groupColInd);
}
示例2: FillMatrixDontKeep
private static void FillMatrixDontKeep(int groupColInd, int validVals, IMatrixData mdata,
Func<IList<double>, double> func)
{
string[][] groupCol = mdata.GetCategoryRowAt(groupColInd);
string[] groupNames = ArrayUtils.UniqueValuesPreserveOrder(groupCol);
int[][] colInds = PerseusPluginUtils.GetExpressionColIndices(groupCol, groupNames);
float[,] newExCols = new float[mdata.RowCount,groupNames.Length];
float[,] newQuality = new float[mdata.RowCount,groupNames.Length];
bool[,] newImputed = new bool[mdata.RowCount,groupNames.Length];
for (int i = 0; i < newExCols.GetLength(0); i++){
for (int j = 0; j < newExCols.GetLength(1); j++){
List<double> vals = new List<double>();
List<bool> imps = new List<bool>();
foreach (int ind in colInds[j]){
double val = mdata[i, ind];
if (!double.IsNaN(val) && !double.IsInfinity(val)){
vals.Add(val);
imps.Add(mdata.IsImputed[i, ind]);
}
}
bool imp = false;
float xy = float.NaN;
if (vals.Count >= validVals){
xy = (float) func(vals);
imp = ArrayUtils.Or(imps);
}
newExCols[i, j] = xy;
newQuality[i, j] = float.NaN;
newImputed[i, j] = imp;
}
}
mdata.ExpressionColumnNames = new List<string>(groupNames);
mdata.ExpressionColumnDescriptions = GetEmpty(groupNames);
mdata.ExpressionValues = newExCols;
mdata.QualityValues = newQuality;
mdata.IsImputed = newImputed;
mdata.RemoveCategoryRowAt(groupColInd);
for (int i = 0; i < mdata.CategoryRowCount; i++){
mdata.SetCategoryRowAt(AverageCategoryRow(mdata.GetCategoryRowAt(i), colInds), i);
}
for (int i = 0; i < mdata.NumericRows.Count; i++){
mdata.NumericRows[i] = AverageNumericRow(mdata.NumericRows[i], colInds);
}
}