Run this model with HF Jobs
Run harshiv/prediction on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/harshiv/prediction. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/harshiv/prediction on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use harshiv/prediction with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Scikit-learn
How to use harshiv/prediction with Scikit-learn:
from huggingface_hub import hf_hub_download import joblib model = joblib.load( hf_hub_download("harshiv/prediction", "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
Upload Untitled1.ipynb
Browse files123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596{ "cells": [ { "cell_type": "code", "execution_count": 17, "id": "2e314513", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Accuracy: 0.8417508417508418\n" ] } ], "source": [ "import pandas as pd\n", "from sklearn.model_selection import train_test_split\n", "from sklearn.ensemble import RandomForestClassifier\n", "from sklearn.metrics import accuracy_score, classification_report\n", "\n", "# Load the dataset\n", "df = pd.read_csv('dataset.csv')\n", "\n", "# Split the dataset into features and target variable\n", "X = df.drop('PlacedOrNot', axis=1) # Features\n", "y = df['PlacedOrNot'] # Target variable\n", "\n", "# Convert categorical features to numerical using one-hot encoding\n", "X = pd.get_dummies(X)\n", "\n", "# Split the dataset into training and testing sets\n", "X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)\n", "\n", "# Create a Random Forest Classifier\n", "clf = RandomForestClassifier(n_estimators=100, random_state=42)\n", "\n", "# Train the model\n", "clf.fit(X_train, y_train)\n", "\n", "accuracy = clf.score(X_test, y_test)\n", "print('Accuracy:', accuracy)\n", "\n", "# Export the trained model as a pickle file\n", "with open('random_forest_model.pkl', 'wb') as f:\n", " pickle.dump(clf, f)" ] }, { "cell_type": "code", "execution_count": null, "id": "ad204a75", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "id": "11ad2756", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "id": "913f5ce2", "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.9.12" } }, "nbformat": 4, "nbformat_minor": 5}Untitled1.ipynbAdded+96