DefaultRenderingTypePredictor
Hierarchy
- RenderingTypePredictor
- DefaultRenderingTypePredictor
Index
Methods
Methods
__init__
A default constructor.
Parameters
optionaldetection_ratio: float = 0.1
A number between 0 and 1 that determines the desired ratio of rendering type detections.
Returns None
predict
Get
RenderingTypePrediction
based on the input request.Parameters
request: Request
Request
instance for which the prediction is made.
Returns RenderingTypePrediction
store_result
Store prediction results and retrain the model.
Parameters
request: Request
Used
Request
instance.rendering_type: RenderingType
Known suitable
RenderingType
for the usedRequest
instance.
Returns None
Stores rendering type for previously crawled URLs and predicts the rendering type for unvisited urls.
RenderingTypePredictor
implementation based on logistic regression: https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.LogisticRegression.html