Tabular Classification
Scikit-learn
Joblib
postgresql
sql
query-cache
plan-cache
redis
database
tabular-regression
Instructions to use nilenpatel/pg-plan-cache-models with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Scikit-learn
How to use nilenpatel/pg-plan-cache-models with Scikit-learn:
from huggingface_hub import hf_hub_download import joblib model = joblib.load( hf_hub_download("nilenpatel/pg-plan-cache-models", "sklearn_model.joblib") ) # only load pickle files from sources you trust # read more about it here https://skops.readthedocs.io/en/stable/persistence.html - Notebooks
- Google Colab
- Kaggle
File size: 1,264 Bytes
406cec4 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 | {
"models": {
"cache_advisor": {
"type": "RandomForestClassifier",
"task": "classification",
"classes": [
"high",
"low",
"medium"
],
"accuracy_cv5": 1.0
},
"ttl_recommender": {
"type": "GradientBoostingRegressor",
"task": "regression",
"unit": "seconds",
"mae": 494.56,
"r2": 0.8994
},
"complexity_estimator": {
"type": "GradientBoostingRegressor",
"task": "regression",
"unit": "score (1-100)",
"mae": 5.57,
"r2": 0.9216
}
},
"features": [
"query_length",
"query_type",
"num_tables",
"num_joins",
"num_conditions",
"num_aggregates",
"num_subqueries",
"num_columns",
"has_distinct",
"has_order_by",
"has_group_by",
"has_having",
"has_limit",
"has_offset",
"has_where",
"has_like",
"has_in_clause",
"has_between",
"has_exists",
"has_window_func",
"has_cte",
"has_union",
"has_case",
"has_cast",
"nesting_depth",
"num_and_or",
"num_string_literals",
"num_numeric_literals"
],
"n_features": 28,
"training_samples": 8000,
"test_samples": 1600
} |