-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
113 additions
and
549 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Classification | ||
|
||
TabPFN provides a powerful interface for handling classification tasks on tabular data. The `TabPFNClassifier` class can be used for binary and multi-class classification problems. | ||
|
||
## Example | ||
|
||
Below is an example of how to use `TabPFNClassifier` for a multi-class classification task: | ||
|
||
```python | ||
from tabpfn import TabPFNClassifier | ||
from sklearn.datasets import load_iris | ||
from sklearn.model_selection import train_test_split | ||
from sklearn.metrics import accuracy_score | ||
|
||
# Load the Iris dataset | ||
X, y = load_iris(return_X_y=True) | ||
|
||
# Split data | ||
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42) | ||
|
||
# Initialize and train classifier | ||
classifier = TabPFNClassifier(device='cuda', N_ensemble_configurations=10) | ||
classifier.fit(X_train, y_train) | ||
|
||
# Evaluate | ||
y_pred = classifier.predict(X_test) | ||
print('Test Accuracy:', accuracy_score(y_test, y_pred)) | ||
``` |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# Installation | ||
|
||
To install TabPFN, you can simply use pip. The basic installation is suitable for most users who are interested in applying TabPFN models to their tabular data. | ||
|
||
```bash | ||
pip install tabpfn | ||
For users interested in a more comprehensive setup, including the ability to train models, evaluate them as done in our paper, and use baselines, the full installation is recommended: | ||
``` | ||
|
||
```bash | ||
pip install tabpfn[full] | ||
``` | ||
Note: To use AutoGluon and Auto-sklearn baselines, please create separate environments and install autosklearn==0.14.5 and autogluon==0.4.0 respectively. Installing them in the same environment as TabPFN may not be possible due to dependency conflicts. | ||
|
||
## Example | ||
|
||
A simple way to get started with TabPFN using our sklearn interface is demonstrated below. This example shows how to train a classifier on the breast cancer dataset and evaluate its accuracy. | ||
|
||
```python | ||
from sklearn.metrics import accuracy_score | ||
from sklearn.datasets import load_breast_cancer | ||
from sklearn.model_selection import train_test_split | ||
|
||
from tabpfn import TabPFNClassifier | ||
|
||
# Load data | ||
X, y = load_breast_cancer(return_X_y=True) | ||
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.33, random_state=42) | ||
|
||
# Initialize classifier | ||
classifier = TabPFNClassifier(device='cpu', N_ensemble_configurations=32) | ||
|
||
# Train classifier | ||
classifier.fit(X_train, y_train) | ||
|
||
# Predict and evaluate | ||
y_pred = classifier.predict(X_test) | ||
print('Accuracy:', accuracy_score(y_test, y_pred)) | ||
``` | ||
This example demonstrates the basic workflow of training and predicting with TabPFN models. For more advanced usage, including handling of categorical data, please refer to the Advanced Usage section. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,73 +1,23 @@ | ||
# Welcome to Sample Project Official Documentation | ||
# Welcome to TabPFN Documentation | ||
|
||
For full documentation visit [mkdocs.org](https://www.mkdocs.org). | ||
TabPFN is a cutting-edge neural network designed specifically for tabular data prediction, leveraging the power of transformers to provide state-of-the-art performance on a wide range of datasets. This documentation will guide you through the installation, basic usage, and advanced features of TabPFN, helping you to efficiently integrate this powerful tool into your data science workflow. | ||
|
||
## Commands | ||
## Features | ||
|
||
- `mkdocs new [dir-name]` - Create a new project. | ||
- `mkdocs serve` - Start the live-reloading docs server. | ||
- `mkdocs build` - Build the documentation site. | ||
- `mkdocs -h` - Print help message and exit. | ||
- **High Performance**: TabPFN brings the power of transformers to tabular data, achieving top-tier results across various datasets. | ||
- **Easy Integration**: Designed with an sklearn-like interface, TabPFN can be seamlessly integrated into existing workflows. | ||
- **Versatility**: Whether you're working on classification, regression, or even survival analysis tasks, TabPFN has you covered. | ||
- **Efficiency**: Optimized for both CPU and GPU, TabPFN ensures fast training and inference times, making it suitable for projects of any scale. | ||
|
||
!!! info | ||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla et euismod | ||
nulla. Curabitur feugiat, tortor non consequat finibus, justo purus auctor | ||
massa, nec semper lorem quam in massa. | ||
## Quick Links | ||
|
||
## Bash | ||
- [Installation](docs/installation.md): Get started by installing TabPFN in your environment. | ||
- [Getting Started](docs/getting_started.md): Learn how to quickly train and evaluate your first TabPFN model. | ||
- [Classification](docs/classification.md): Dive into using TabPFN for classification tasks, with examples and tips. | ||
- [Regression](docs/regression.md): Explore how to apply TabPFN to regression problems, including setup and evaluation. | ||
|
||
```bash | ||
# Minimal makefile for Sphinx documentation | ||
# | ||
## Getting Help | ||
|
||
# You can set these variables from the command line, and also | ||
# from the environment for the first two. | ||
SPHINXOPTS ?= | ||
SPHINXBUILD ?= sphinx-build | ||
SOURCEDIR = source | ||
BUILDDIR = build | ||
If you encounter any issues or have questions about using TabPFN, please refer to the [FAQs](#) or reach out to the community through [GitHub Issues](https://github.com/your-github-repo/issues). | ||
|
||
# Put it first so that "make" without argument is like "make help". | ||
help: | ||
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) | ||
|
||
.PHONY: help Makefile | ||
|
||
# Catch-all target: route all unknown targets to Sphinx using the new | ||
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). | ||
%: Makefile | ||
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) | ||
|
||
|
||
``` | ||
|
||
## Syntax highlighting Example | ||
|
||
```python | ||
import flask | ||
import flask_saml | ||
|
||
app = flask.Flask(__name__) | ||
|
||
app.config.update({ | ||
'SECRET_KEY': 'soverysecret', | ||
'SAML_METADATA_URL': 'https://mymetadata.xml', | ||
}) | ||
flask_saml.FlaskSAML(app) | ||
``` | ||
|
||
## Sample layout | ||
|
||
```bash | ||
├── docs | ||
│ ├── about.md | ||
│ └── index.md | ||
├── mkdocs.yml | ||
└── site | ||
├── 404.html | ||
├── about | ||
│ └── search_index.json | ||
├── sitemap.xml | ||
└── sitemap.xml.gz | ||
|
||
``` | ||
Thank you for choosing TabPFN. We hope you find this tool valuable in your data science endeavors. |
Oops, something went wrong.