Downloads · 30 days
0
Joe-Zeloof/joey_s_the_largest_diamond_dataset_price_prediction_models
joey_s_the_largest_diamond_dataset_price_prediction_models is a machine learning model from Joe-Zeloof. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
<video controls width="100%" <source src="JosephzeloofReg-ClassModelPresentation.mp4" type="video/mp4" Your browser does not support the video tag. </video
Downloads · 30 days
0
Access
Public
Updated Dec 9, 2025
Repo size
715 MB
Likes
0
Public
Click a slice to open those files.
.pkl704 MB · 97%
From the Hugging Face model README
Selected dataset: The largest diamond dataset currently on Kaggle
Link to dataset: https://www.kaggle.com/datasets/hrokrin/the-largest-diamond-dataset-currely-on-kaggle
Dataset description: This dataset contains the prices and other attributes of over 200k diamonds. Including many features about the diamonds quality, size, attributes and finnaly its price.
cleaning: the data was in pretty good shape, it had two categorical features that contained null which i change to categories labeled 'empty'. It also had 2 features that were percentegaes out of which i created two new features which binned those percentages in 10 sized intervals. The data also had lots of outliars so i decided to remove them using the IQR method
After that i created multiple plots showing some analysis of the data whereby the general insights where that diamonds are priced mainly in acorrdance to their to carrat weight. i also showed all plots of different features correlation to other features where i learned that most size features are positivly correleted to each other due to geology and market prefrences.
Example plot:

Regression Goal: To predict diamond price (total_sales_price) using available numeric and categorical features. this is very important as it will allow anyone to who holds this model to evaluate a stone in his possesion which is somthing diamond dealers multiple times a day manually.
Feature Selection: for the sake of simplicity i will includeonly all the aformentioned numeric columns and wont include the categorical ones - and we will continue from there
Results:
my r2 is suprisingly good given i havent included any of the categorical features which i thought would amount to a majority of the value but on the other hand my errors are in the hundreds of dollars which is pretty awful IMO given the fact that the avg price is around 7k$. nevertheless it is a good baseline to start from.
Feature Coefficients:

Precision vs Recall: In the context of predicting whether a diamond is high-priced, precision is generally more important than recall. Misclassifying a low-priced diamond as high-priced (a false positive) could mislead buyers, inflate expected revenue, or distort inventory decisions. High precision ensures that when the model predicts a diamond is expensive, it is very likely correct — which is crucial for pricing, sales strategy, and consumer trust. Recall is still useful, but missing some high-priced diamonds (false negatives) is less harmful than incorrectly labeling cheap diamonds as valuable.
false positives vs false negatives: A false positive is more critical as explained in the question above but to sum it up: because mislabeling a high-priced diamonds (false negatives) is less harmful than incorrectly labeling cheap diamonds as valuable mainly due to the pottential gain/loss invovlved.
I trained three models and displeyed classification reports and confusian matrixes for each one:



surprisingly, in the classification models just like in the regression models the random forrest model had the highest accuracy acroos all stats. Classification Report: precision recall f1-score support
0 0.96 0.96 0.96 4997
1 0.96 0.96 0.96 5003
accuracy 0.96 10000 macro avg 0.96 0.96 0.96 10000 weighted avg 0.96 0.96 0.96 10000
I choose it as the winner beacuse Random Forest achieves the highest overall performance, with the most balanced precision and recall across both classes and the lowest total number of misclassifications. Its ability to capture nonlinear patterns and interactions makes it better suited for the complex structure of diamond pricing than a linear model (Logistic Regression) or a distance-based model (KNN). While Logistic Regression is close, Random Forest still makes fewer errors overall and offers a more flexible and robust decision boundary.