-
Notifications
You must be signed in to change notification settings - Fork 6.1k
Extended SentimentPrediction for easier display #11955
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice job. Minor changes
| [!code-csharp[BuildTuples](~/samples/machine-learning/tutorials/SentimentAnalysis/Program.cs#BuildSentimentPredictionPairs "Build the pairs of sentiment data and predictions")] | ||
|
|
||
| Now that `SentimentText` and `Sentiment` are combined in a class, display the results: | ||
| Because `SentimentPrediction` inherited from `SentimentData`, the `Transform()` method populated `SentimentText` with the predicted fields. As the ML.NET process processes, each component adds columns, and this makes it easy to display the results: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion:
"Because SentimentPrediction is inherited from SentimentData, the Transform() method populated SentimentText with the values in the SentimentText column. Throughout the ML.NET model building process, each component adds columns, and this makes it easy to display the result"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent! Thanks, @luisquintanilla!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not clear how the concepts in the two sentences connect here. What does the user need to know? That the fields in SentimentPrediction will be in the transformed result. The inheritance is an implementation detail.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But the fields need to be there in order for the results to appear. Modified. Any clearer?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. A couple of comments.
| |Service was very prompt. | 1 | | ||
|
|
||
| `SentimentPrediction` is the prediction class used after the model training. It has a single boolean (`Sentiment`) and a `PredictedLabel` `ColumnName` attribute. The `Label` is used to create and train the model, and it's also used with the split out test dataset to evaluate the model. The `PredictedLabel` is used during prediction and evaluation. For evaluation, training data, the predicted values, and the model are used. | ||
| `SentimentPrediction` is the prediction class used after the model training. It inherits from `SentimentData` for displaying the `SentimentText` with the predictions. `SentimentPrediction` has a single boolean (`Sentiment`) and a `PredictedLabel` `ColumnName` attribute. The `Label` is used to create and train the model, and it's also used with the split out test dataset to evaluate the model. The `PredictedLabel` is used during prediction and evaluation. For evaluation, training data, the predicted values, and the model are used. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if a simple diagram (stylized UML) would help here? Even if we don't add a diagram, I think we can simplify the text. The fields are already in the code, so we don't need to repeat that here, but rather focus on the information that helps to interpret the code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, and this is really a comment for the sample, would it simplify this explanation to not re-map the column names. i.e.
Use Label for the training label; and PredictedLabel for the prediction?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Modified.
| [!code-csharp[BuildTuples](~/samples/machine-learning/tutorials/SentimentAnalysis/Program.cs#BuildSentimentPredictionPairs "Build the pairs of sentiment data and predictions")] | ||
|
|
||
| Now that `SentimentText` and `Sentiment` are combined in a class, display the results: | ||
| Because `SentimentPrediction` inherited from `SentimentData`, the `Transform()` method populated `SentimentText` with the predicted fields. As the ML.NET process processes, each component adds columns, and this makes it easy to display the results: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not clear how the concepts in the two sentences connect here. What does the user need to know? That the fields in SentimentPrediction will be in the transformed result. The inheritance is an implementation detail.
|
@luisquintanilla - I believe I've addressed your changes. |
|
Thanks, @luisquintanilla and @natke for the thoughtful feedback and time spent. Much appreciated! |
Extended SentimentPrediction for easier display of results
Internal Review URL
Related code sample: dotnet/samples#832