Downloads · 30 days
0
aqibtahir/cookie-classifier-lr-tfidf
cookie-classifier-lr-tfidf is a text classification model from aqibtahir. Use it when you need a label for a piece of text. It is set up for scikit-learn. The card lists the license as mit.
This is a Linear Regression model trained for cookie classification. The model uses TF-IDF (Term Frequency-Inverse Document Frequency) vectorization with both word n-grams (1-2) and character n-grams (3-5), combined w…
Downloads · 30 days
0
Access
Public
Updated Oct 30, 2025
Repo size
4.7 MB
Likes
0
Public
Click a slice to open those files.
.joblib4.7 MB · 100%
From the Hugging Face model README
This is a Linear Regression model trained for cookie classification. The model uses TF-IDF (Term Frequency-Inverse Document Frequency) vectorization with both word n-grams (1-2) and character n-grams (3-5), combined with engineered name features to classify web cookies into 4 privacy categories:
The model achieves the following performance metrics on the test set:
| Class | Category | Precision | Recall | F1-Score | Support |
|---|---|---|---|---|---|
| 0 | Strictly Necessary | 0.92 | 0.90 | 0.91 | 7987 |
| 1 | Functionality | 0.64 | 0.61 | 0.62 | 1663 |
| 2 | Analytics | 0.89 | 0.93 | 0.91 | 8536 |
| 3 | Advertising/Tracking | 0.92 | 0.91 | 0.92 | 10485 |
Overall Accuracy: 0.90 (90%)
Weighted Average:
import joblib
import numpy as np
# Load the model
model = joblib.load('LR_TFIDF+NAME.joblib')
# The model expects preprocessed TF-IDF features
# Make predictions
predictions = model.predict(X_test)
# Get prediction probabilities (if supported)
# Note: Linear Regression for classification may not have predict_proba
# You may need to use decision_function instead
scores = model.decision_function(X_test)
from huggingface_hub import hf_hub_download
import joblib
# Download the model from Hugging Face Hub
model_path = hf_hub_download(
repo_id="aqibtahir/cookie-classifier-lr-tfidf",
filename="LR_TFIDF+NAME.joblib"
)
# Load the model
model = joblib.load(model_path)
# Use the model for predictions (with preprocessed features)
# Note: You'll need the TF-IDF vectorizers and name feature extractor
predictions = model.predict(your_features)
This model is intended for automated cookie classification to help with:
Requirements:
If you use this model, please cite appropriately and mention the training methodology.
Created on October 30, 2025