machinelearning: StochasticDualCoordinateAscent not work For Multiclass after migrate to 0.10.0

System information

  • OS version/distro: W10
  • .NET Version (eg., dotnet --info): 4.6.1

Issue

  • What did you do? Migrated my code from 0.9.0 to 0.10.0
  • What happened? StochasticDualCoordinateAscent Algorithm was working fine for multi class and binary trainer before move to 0.10 after updating its working only for binary and freeze on trainingPipeline.Fit(trainingDataView); for Multiclass take a while
  • What did you expect? it should work fine

Source code / logs

`var mlContext = new MLContext(seed: 1);

#region “STEP 1: Common data loading configuration”

IDataView trainingDataView = GetNormalDataSet(mlContext, allFeatures, mLFeatures);

if (trainingDataView.GetRowCount() == 0)
{

    return;
}

textFeatures = GetTextFeatures(normalFeatures);

numericFeatures = GetNumericFeatures(normalFeatures).ToArray();

#endregion

#region “STEP 2: Common data process configuration with pipeline data transformations”

// STEP 2: Common data process configuration with pipeline data transformations

var textFeaturesProcessPipeline = mlContext.Transforms.Text.FeaturizeText(DefaultColumnNames.Features, textFeatures);

var numericFeaturesProcessPipeline = mlContext.Transforms.Concatenate(DefaultColumnNames.Features, numericFeatures);

var dataProcessPipeline = numericFeaturesProcessPipeline.Append(textFeaturesProcessPipeline).AppendCacheCheckpoint(mlContext);

#endregion

#region “STEP 3: Set the training algorithm, then create and configure the modelBuilder”

ITransformer trainedModel = null;

//“StochasticDualCoordinateAscent”

var trainingPipeline = mlContext.Transforms.Conversion.MapValueToKey(DefaultColumnNames.Label) .Append(dataProcessPipeline) .Append(mlContext.MulticlassClassification.Trainers.StochasticDualCoordinateAscent(labelColumn: DefaultColumnNames.Label, featureColumn: DefaultColumnNames.Features)) .Append(mlContext.Transforms.Conversion.MapKeyToValue(DefaultColumnNames.PredictedLabel));

#region STEP 4: Train the model fitting to the DataSet

//Take a while and no responce when call fit method

trainedModel = trainingPipeline.Fit(trainingDataView);

#endregion`

you can see some screen for values and when change from “StochasticDualCoordinateAscent” to “Naive Bayes” Working fine

what wrong on my code image image image

also those my Data Structure Classes `[Serializable] public class NormalTagsModelFeatures { //[Column(ordinal: “0”, name: “Label”)] public string Label; [LoadColumn(0)] public string Label; [LoadColumn(1)] public float fontSize; [LoadColumn(2)] public float isBold; [LoadColumn(3)] public float isItalic; [LoadColumn(4)] public float isUnderLine; [LoadColumn(5)] public float containsDot; [LoadColumn(6)] public float containsQuestionMark; [LoadColumn(7)] public string fontColor; [LoadColumn(8)] public float isAllCaps; [LoadColumn(9)] public string tagText; [LoadColumn(10)] public string firstWord; [LoadColumn(11)] public string FontName; [LoadColumn(12)] public float verticalText; [LoadColumn(13)] public float trdLeft; [LoadColumn(14)] public float trdRight; [LoadColumn(15)] public float trdTop; [LoadColumn(16)] public float trdBottom; [LoadColumn(17)] public float pageNo;

}

public class NormalTagsPrediction
{
    [ColumnName("PredictedLabel")]
    public string PredictedLabel;

    [ColumnName("Score")]
    public float[] Score { get; set; }

}`

Please paste or attach the code or logs or traces that would be helpful to diagnose the issue you are reporting.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 20 (8 by maintainers)

Most upvoted comments

@rogancarr @Ivanidzo4ka @TomFinley - the above deadlock looks to be the same as #1095.