Downloads · 30 days
0
nahiar/tiktok-bot-detection-v2
tiktok-bot-detection-v2 is a machine learning model from nahiar. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for scikit-learn. The card lists the license as apache-2.0.
This directory contains a trained Random Forest classifier for detecting bot accounts on Tiktok.
Downloads · 30 days
0
Access
Public
Updated Jan 7, 2026
Repo size
9.7 MB
Likes
0
Public
Click a slice to open those files.
.pkl3.8 MB · 88%
From the Hugging Face model README
This directory contains a trained Random Forest classifier for detecting bot accounts on Tiktok.
Model Version: v2 Training Date: 2025-12-30 11:38:35 Framework: scikit-learn 1.5.2 Algorithm: Random Forest Classifier with GridSearchCV Hyperparameter Tuning
| Metric | Score |
|---|---|
| Accuracy | 0.9224 (92.24%) |
| Precision | 0.9596 (95.96%) |
| Recall | 0.9094 (90.94%) |
| F1-Score | 0.9338 (93.38%) |
| ROC-AUC | 0.9773 (97.73%) |
| Average Precision | 0.9596 (95.96%) |
| File | Description |
|---|---|
tiktok_bot_detection_v2.pkl | Trained Random Forest model |
tiktok_scaler_v2.pkl | MinMaxScaler for feature normalization |
tiktok_features_v2.json | List of features used by the model |
tiktok_metrics_v2.txt | Detailed performance metrics report |
images/ | All visualization plots (13 images) |
README.md | This file |
Training Set:
Test Set:
IsPrivateIsVerifiedHasProfilePicFollowingCountFollowerCountLikesCountHasInstagramHasYoutubeHasBioHasLinkInBioHasPostsPostsCountFollowToFollowerRatioTotal combinations tested: 540
All visualizations are saved in the images/ directory:
import joblib
import pandas as pd
import numpy as np
# Load model and scaler
model = joblib.load('tiktok_bot_detection_v2.pkl')
scaler = joblib.load('tiktok_scaler_v2.pkl')
# Prepare your data (example)
data = {
'IsPrivate': 0.5,
'IsVerified': 0.5,
'HasProfilePic': 0.5,
'FollowingCount': 0.5,
'FollowerCount': 0.5,
'LikesCount': 0.5,
'HasInstagram': 0.5,
'HasYoutube': 0.5,
'HasBio': 0.5,
'HasLinkInBio': 0.5,
'HasPosts': 0.5,
'PostsCount': 0.5,
'FollowToFollowerRatio': 0.5,
}
# Create DataFrame
df = pd.DataFrame([data])
# Scale features
df_scaled = scaler.transform(df)
# Predict
prediction = model.predict(df_scaled)[0]
probability = model.predict_proba(df_scaled)[0]
print(f"Prediction: {'Bot' if prediction == 1 else 'Human'}")
print(f"Bot Probability: {probability[1]:.4f}")
print(f"Human Probability: {probability[0]:.4f}")
Predicted
Human Bot
Actual Human 220 24
Bot 18 334
To retrain the model:
../data/train_tiktok.csv5_enhanced_training.ipynbFor questions or issues regarding this model, please refer to the main project documentation.
Generated: 2025-12-30 11:38:35
Notebook: 5_enhanced_training.ipynb
Platform: Tiktok