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 Untitled2.ipynb
Browse files123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104{ "cells": [ { "cell_type": "code", "execution_count": 2, "id": "2a0f61a3", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Accuracy: 0.8417508417508418\n" ] } ], "source": [ "import pandas as pd\n", "from sklearn.compose import ColumnTransformer\n", "from sklearn.ensemble import RandomForestClassifier\n", "from sklearn.impute import SimpleImputer\n", "from sklearn.model_selection import train_test_split\n", "from sklearn.pipeline import Pipeline\n", "from sklearn.preprocessing import LabelEncoder, StandardScaler\n", "\n", "# Load the CSV data\n", "data = pd.read_csv('dataset.csv')\n", "\n", "# Split the data into features and labels\n", "X = data.drop('PlacedOrNot', axis=1)\n", "y = data['PlacedOrNot']\n", "\n", "# Encode categorical features\n", "categorical_features = ['HistoryOfBacklogs']\n", "for feature in categorical_features:\n", " encoder = LabelEncoder()\n", " X[feature] = encoder.fit_transform(X[feature])\n", "\n", "# Split the data 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 the pipeline\n", "numerical_features = ['Internships', 'CGPA']\n", "numerical_transformer = StandardScaler()\n", "categorical_features = [ 'HistoryOfBacklogs']\n", "categorical_transformer = SimpleImputer(strategy='most_frequent')\n", "preprocessor = ColumnTransformer(\n", " transformers=[\n", " ('num', numerical_transformer, numerical_features),\n", " ('cat', categorical_transformer, categorical_features)\n", " ])\n", "\n", "pipeline = Pipeline([\n", " ('preprocessor', preprocessor),\n", " ('classifier', RandomForestClassifier(random_state=42))\n", "])\n", "\n", "# Train the model\n", "pipeline.fit(X_train, y_train)\n", "\n", "# Evaluate the model\n", "accuracy = pipeline.score(X_test, y_test)\n", "print('Accuracy:', accuracy)\n" ] }, { "cell_type": "code", "execution_count": null, "id": "8e941b77", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "id": "4a2788a3", "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}Untitled2.ipynbAdded+104