DefaultRenderingTypePredictor
Hierarchy
- RenderingTypePredictor
- DefaultRenderingTypePredictor
Index
Methods
Methods
__init__
Initialize a new instance.
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
RenderingTypePredictionbased on the input request.Parameters
request: Request
Requestinstance for which the prediction is made.
Returns RenderingTypePrediction
store_result
Store prediction results and retrain the model.
Parameters
request: Request
Used
Requestinstance.rendering_type: RenderingType
Known suitable
RenderingTypefor the usedRequestinstance.
Returns None
Stores rendering type for previously crawled URLs and predicts the rendering type for unvisited urls.
RenderingTypePredictorimplementation based on logistic regression: https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.LogisticRegression.html