Class RoundingStarRatingInfo
An implementation of IStarRatingInfo<TRating> which converts floating-point ratings to star ratings by rounding.
Implements
Inherited Members
Namespace: Microsoft.ML.Probabilistic.Learners
Assembly: Microsoft.ML.Probabilistic.Learners.dll
Syntax
public class RoundingStarRatingInfo : IStarRatingInfo<double>
Constructors
RoundingStarRatingInfo(Int32, Int32)
Initializes a new instance of the RoundingStarRatingInfo class.
Declaration
public RoundingStarRatingInfo(int minRating, int maxRating)
Parameters
Type | Name | Description |
---|---|---|
Int32 | minRating | The minimum star rating. |
Int32 | maxRating | The maximum star rating. |
Properties
MaxStarRating
Gets the maximum possible star rating.
Declaration
public int MaxStarRating { get; }
Property Value
Type | Description |
---|---|
Int32 |
MinStarRating
Gets the minimum possible star rating.
Declaration
public int MinStarRating { get; }
Property Value
Type | Description |
---|---|
Int32 |
Methods
ToStarRating(Double)
Converts a floating-point rating to a star rating by rounding to the nearest integer.
Declaration
public int ToStarRating(double rating)
Parameters
Type | Name | Description |
---|---|---|
Double | rating | The floating-point rating. |
Returns
Type | Description |
---|---|
Int32 | The rounded star rating. |