Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Machine Learning Error

Hi, I am trying out the new AI capabilities of Power BI but I am running into some weird errors, that I can't make sense of.

I am running this tutorial: https://docs.microsoft.com/en-us/power-bi/service-tutorial-build-machine-learning-model

Everything goes well with quering, creating a ML model and up until the "Refresh the dataflow" part of the tutorial.

Where it gives me the following error report. Can anyone make sense of this, and what I am doing wrong?

 

Run timeDataflow nameDataflow refresh statusEntity nameStart timeEnd timeEntity refresh statusError
15-04-2019 13:53Online Shoppers IntentFailedOnline Visitor15-04-2019 13:5315-04-2019 13:53Completed 
15-04-2019 13:53Online Shoppers IntentFailedPurchase Intent Prediction15-04-2019 13:5315-04-2019 13:53FailedError: One or more upstream operations failed... RootActivityId = 5d8a6495-df6f-425b-8dbd-8188366137d1 Request ID: 1e6fe497-30b3-5707-42ca-285f1747a7ff.
15-04-2019 13:53Online Shoppers IntentFailedPurchase Intent Prediction Training Data15-04-2019 13:5315-04-2019 13:53FailedError: An internal error occurred... RootActivityId = 5d8a6495-df6f-425b-8dbd-8188366137d1.Param1 = An error happened while reading data from the provider: '{"error":{"code":"UnknownError" "pbi.error":{"code":"UnknownError" "parameters":{} "details":[]}}}' Request ID: 1e6fe497-30b3-5707-42ca-285f1747a7ff.
15-04-2019 13:53Online Shoppers IntentFailedPurchase Intent Prediction Testing Data15-04-2019 13:5315-04-2019 13:53FailedError: One or more upstream operations failed... RootActivityId = 5d8a6495-df6f-425b-8dbd-8188366137d1 Request ID: 1e6fe497-30b3-5707-42ca-285f1747a7ff.
4 REPLIES 4
XY123
Regular Visitor

I'm having exactly the same issue. There seems to be an issue with the "AI.SampleStratifiedWithHoldout" function in the Power Query Editor. 

Anonymous
Not applicable

I've added a detaile error message, maybe it makes sense for someone:

 

DataSource.Error: An error happened while reading data from the provider: '{"error":{"code":"UnknownError","pbi.error":{"code":"UnknownError","parameters":{},"details":[]}}}'

 

section Section1;
shared #"Online Visitor" = let
  Source = Csv.Document(Web.Contents("https://raw.githubusercontent.com/santoshc1/PowerBI-AI-samples/master/Tutorial_AutomatedML/online_shoppers_intention.csv"), [Delimiter = ",", Columns = 18, QuoteStyle = QuoteStyle.None]),
  #"Promoted headers" = Table.PromoteHeaders(Source, [PromoteAllScalars = true]),
  #"Changed column type" = Table.TransformColumnTypes(#"Promoted headers", {{"Administrative_Duration", type number}, {"Informational_Duration", type number}, {"ProductRelated_Duration", type number}, {"BounceRates", type number}, {"ExitRates", type number}, {"PageValues", type number}, {"SpecialDay", type number}, {"Weekend", type logical}, {"Revenue", type logical}})
in
  #"Changed column type";
shared #"Purchase Intent Prediction Training Data" = let
  Source = #"Online Visitor",
  #"Selected columns" = Table.SelectColumns(Source, {"Administrative", "Administrative_Duration", "Informational", "Informational_Duration", "ProductRelated", "ProductRelated_Duration", "BounceRates", "ExitRates", "PageValues", "SpecialDay", "Month", "OperatingSystems", "Browser", "Region", "TrafficType", "VisitorType", "Weekend", "Revenue"}),
  #"Removed nulls" = Table.SelectRows(#"Selected columns", each [Revenue] <> null),
  #"Sampled input" = AI.SampleStratifiedWithHoldout("Revenue", Table.RowCount(#"Removed nulls"), #"Removed nulls")
in
  #"Sampled input";
shared #"Purchase Intent Prediction" = let
  Source = #"Purchase Intent Prediction Training Data",
  #"Invoked TrainPrediction" = AIInsights.Contents(){[Key = "AI.Execute"]}[Data]("AI.TrainPrediction", "Regular", [labelColumnName = "Revenue", data = Source]),
  #"Selected training schema columns" = Table.SelectColumns(#"Invoked TrainPrediction", {"TrainingId", "Model", "Stats", "GlobalExplanation", "TrainingSchema", "TrainingAUC", "LabelColumn"})
in
  #"Selected training schema columns";
shared #"Purchase Intent Prediction.Score" = let
  ApplyScoringFunction = (inputQuery as table, newColumn as text, decisionThreshold as number) => let
  MlModel = #"Purchase Intent Prediction",
  MlModelJson = try Text.FromBinary(Json.FromValue(MlModel{0})) otherwise "InvalidModel",
  Source = inputQuery,
  SelectedBaseEntityColumns = {"Administrative", "Administrative_Duration", "Informational", "Informational_Duration", "ProductRelated", "ProductRelated_Duration", "BounceRates", "ExitRates", "PageValues", "SpecialDay", "Month", "OperatingSystems", "Browser", "Region", "TrafficType", "VisitorType", "Weekend", "Revenue"},
  InputRowCount = Table.RowCount(Source),
  InputTableType = Value.Type(Source),
  SelectedColumnsTypes = List.Transform(SelectedBaseEntityColumns, each Type.TableColumn(InputTableType, _)),
  ScoringFunction = 
        let
            ScoringFunctionScalarType = type function (row as record) as any,
            VectorizedScoringFunction = (input as table) =>
              let
                ExpandedColumns = Table.ExpandRecordColumn(input, "row", SelectedBaseEntityColumns),
                ExpandedColumnsWithTypes = Table.TransformColumnTypes(ExpandedColumns, List.Zip({SelectedBaseEntityColumns, SelectedColumnsTypes})),
                ErrorList = List.Repeat({[Output = null]}, InputRowCount),
                Result = if MlModelJson <> "InvalidModel" then (try Table.ToRecords(AIInsights.Contents(){[Key = "AI.Execute"]}[Data]("AI.ScorePrediction", "Vectorized", [data = ExpandedColumns, scoreParameters = MlModelJson])) otherwise ErrorList) else ErrorList
              in
                Result,
            ScalarVectorScoringFunction = Function.ScalarVector(ScoringFunctionScalarType, VectorizedScoringFunction)
        in
            ScalarVectorScoringFunction,
  AddScoringColumn = Table.AddColumn(Source, newColumn, each ScoringFunction(_)),
  ExpandResultColumns = Table.ExpandRecordColumn(AddScoringColumn, newColumn, {"PredictionScore", "PredictionExplanation"}, {Text.Combine({newColumn, "PredictionScore"}, "."), Text.Combine({newColumn, "PredictionExplanation"}, ".")}),
  LabeledOutput = Table.AddColumn(ExpandResultColumns, Text.Combine({newColumn, "Outcome"}, "."), each Record.Field(_, Text.Combine({newColumn, "PredictionScore"}, ".")) >= decisionThreshold * 100),
  ReplacedErrors = Table.ReplaceErrorValues(LabeledOutput, {{Text.Combine({newColumn, "Outcome"}, "."), null}, {Text.Combine({newColumn, "PredictionScore"}, "."), null}, {Text.Combine({newColumn, "PredictionExplanation"}, "."), null}}),
  TransformTypes = Table.TransformColumnTypes(ReplacedErrors, {{Text.Combine({newColumn, "Outcome"}, "."), type logical}, {Text.Combine({newColumn, "PredictionScore"}, "."), type text}, {Text.Combine({newColumn, "PredictionExplanation"}, "."), type text}})
in
  TransformTypes
in
  ApplyScoringFunction;
shared #"Purchase Intent Prediction_PollingQuery" = let
  Source = "536eb714-1488-49b5-9ac6-598e40d1780b"
in
  Source;
shared #"Purchase Intent Prediction Testing Data" = let
  Source = #"Purchase Intent Prediction Training Data",
  #"Filtered rows" = Table.SelectRows(Source, each ([__IsTraining__] = false)),
  #"Invoked Scoring" = #"Purchase Intent Prediction.Score"(#"Filtered rows", "Purchase Intent PredictionOutput", 0.5)
in
  #"Invoked Scoring";
shared #"Purchase Intent Prediction Preview" = let
  Source = PowerBI.Dataflows(),
  Workspace = Source{[workspaceId = "94fe567d-5d7c-496c-85c7-30650d1271ce"]}[Data],
  Dataflow = Workspace{[dataflowId = "90099937-edac-4f34-8f73-3fca50551482"]}[Data],
  Preview = Dataflow{[entity = "Purchase Intent Prediction"]}[Data]
in
  Preview;
shared #"Purchase Intent Prediction Testing Data Preview" = let
  Source = PowerBI.Dataflows(),
  Workspace = Source{[workspaceId="94fe567d-5d7c-496c-85c7-30650d1271ce"]}[Data],
  Dataflow = Workspace{[dataflowId="90099937-edac-4f34-8f73-3fca50551482"]}[Data],
  Preview = Dataflow{[entity="Purchase Intent Prediction Testing Data"]}[Data]
in
  Preview;
Anonymous
Not applicable

Is it resolved?

Anonymous
Not applicable

Bump

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors