本文整理汇总了C#中IMatrixData.ExtractExpressionColumns方法的典型用法代码示例。如果您正苦于以下问题:C# IMatrixData.ExtractExpressionColumns方法的具体用法?C# IMatrixData.ExtractExpressionColumns怎么用?C# IMatrixData.ExtractExpressionColumns使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IMatrixData
的用法示例。
在下文中一共展示了IMatrixData.ExtractExpressionColumns方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FilterColumns
public static void FilterColumns(IMatrixData mdata, Parameters parameters, int[] cols)
{
bool reduceMatrix = GetReduceMatrix(parameters);
if (reduceMatrix){
mdata.ExtractExpressionColumns(cols);
} else{
Array.Sort(cols);
string[][] row = new string[mdata.ExpressionColumnCount][];
for (int i = 0; i < row.Length; i++){
bool contains = Array.BinarySearch(cols, i) >= 0;
row[i] = contains ? new[]{"Keep"} : new[]{"Discard"};
}
mdata.AddCategoryRow("Filter", "", row);
}
}
示例2: ProcessData
public void ProcessData(IMatrixData data, Parameters param, ref IMatrixData[] supplTables,
ref IDocumentData[] documents, ProcessInfo processInfo)
{
int[] exColInds = param.GetMultiChoiceParam("Expression columns").Value;
int[] numColInds = param.GetMultiChoiceParam("Numerical columns").Value;
int[] multiNumColInds = param.GetMultiChoiceParam("Multi-numerical columns").Value;
int[] catColInds = param.GetMultiChoiceParam("Categorical columns").Value;
int[] textColInds = param.GetMultiChoiceParam("Text columns").Value;
data.ExtractExpressionColumns(exColInds);
data.NumericColumns = ArrayUtils.SubList(data.NumericColumns, numColInds);
data.NumericColumnNames = ArrayUtils.SubList(data.NumericColumnNames, numColInds);
data.NumericColumnDescriptions = ArrayUtils.SubList(data.NumericColumnDescriptions, numColInds);
data.MultiNumericColumns = ArrayUtils.SubList(data.MultiNumericColumns, multiNumColInds);
data.MultiNumericColumnNames = ArrayUtils.SubList(data.MultiNumericColumnNames, multiNumColInds);
data.MultiNumericColumnDescriptions = ArrayUtils.SubList(data.MultiNumericColumnDescriptions, multiNumColInds);
data.CategoryColumns = PerseusPluginUtils.GetCategoryColumns(data, catColInds);
data.CategoryColumnNames = ArrayUtils.SubList(data.CategoryColumnNames, catColInds);
data.CategoryColumnDescriptions = ArrayUtils.SubList(data.CategoryColumnDescriptions, catColInds);
data.StringColumns = ArrayUtils.SubList(data.StringColumns, textColInds);
data.StringColumnNames = ArrayUtils.SubList(data.StringColumnNames, textColInds);
data.StringColumnDescriptions = ArrayUtils.SubList(data.StringColumnDescriptions, textColInds);
}
示例3: ProcessData
public void ProcessData(IMatrixData data, Parameters param, ref IMatrixData[] supplTables,
ref IDocumentData[] documents, ProcessInfo processInfo)
{
int[] exColInds = GetValidExCols(data);
int[] numColInds = GetValidNumCols(data);
int[] multiNumColInds = GetValidMultiNumCols(data);
int[] catColInds = GetValidCatCols(data);
int[] textColInds = GetValidTextCols(data);
if (exColInds.Length < data.ExpressionColumnCount){
data.ExtractExpressionColumns(exColInds);
}
if (numColInds.Length < data.NumericColumnCount){
data.NumericColumns = ArrayUtils.SubList(data.NumericColumns, numColInds);
data.NumericColumnNames = ArrayUtils.SubList(data.NumericColumnNames, numColInds);
data.NumericColumnDescriptions = ArrayUtils.SubList(data.NumericColumnDescriptions, numColInds);
}
if (multiNumColInds.Length < data.MultiNumericColumnCount){
data.MultiNumericColumns = ArrayUtils.SubList(data.MultiNumericColumns, multiNumColInds);
data.MultiNumericColumnNames = ArrayUtils.SubList(data.MultiNumericColumnNames, multiNumColInds);
data.MultiNumericColumnDescriptions = ArrayUtils.SubList(data.MultiNumericColumnDescriptions, multiNumColInds);
}
if (catColInds.Length < data.CategoryColumnCount){
data.CategoryColumns = PerseusPluginUtils.GetCategoryColumns(data, catColInds);
data.CategoryColumnNames = ArrayUtils.SubList(data.CategoryColumnNames, catColInds);
data.CategoryColumnDescriptions = ArrayUtils.SubList(data.CategoryColumnDescriptions, catColInds);
}
if (textColInds.Length < data.StringColumnCount){
data.StringColumns = ArrayUtils.SubList(data.StringColumns, textColInds);
data.StringColumnNames = ArrayUtils.SubList(data.StringColumnNames, textColInds);
data.StringColumnDescriptions = ArrayUtils.SubList(data.StringColumnDescriptions, textColInds);
}
}
示例4: ExpressionToNumeric
private static void ExpressionToNumeric(IList<int> colInds, IMatrixData mdata)
{
int[] remainingInds = ArrayUtils.Complement(colInds, mdata.NumericColumnCount);
foreach (int colInd in colInds){
double[] d = ArrayUtils.ToDoubles(mdata.GetExpressionColumn(colInd));
mdata.AddNumericColumn(mdata.ExpressionColumnNames[colInd], mdata.ExpressionColumnDescriptions[colInd], d);
}
mdata.ExtractExpressionColumns(remainingInds);
}