A web application for visualizing the ID3 decision tree algorithm, built with FastAPI (Python backend) and React (JavaScript frontend). This tool lets users upload datasets, view step-by-step tree construction, and interactively explore decision trees.
- Upload datasets (CSV format) for analysis.
- Interactive decision tree visualization using a custom React component.
- Step-by-step algorithm breakdown for educational purposes.
- RESTful API backend powered by FastAPI.
- MongoDB integration for storing data and results.
- Modern UI styled with Tailwind CSS.
.
├── backend/
│ ├── server.py # FastAPI app, decision tree logic (ID3), MongoDB connection
│ ├── .env # Environment variables (MONGO_URL, DB_NAME, etc.)
│ └── requirements.txt # Python dependencies
├── frontend/
│ ├── src/
│ │ ├── App.js # Main React app, visualization logic
│ │ ├── App.css # Custom styles
│ │ └── index.js # App entry point
│ ├── public/
│ │ └── index.html # HTML template
│ ├── package.json # Frontend dependencies
│ └── tailwind.config.js # Tailwind CSS config
├── .gitconfig # Git configuration
Note: This file listing is based on a limited search result, and may be incomplete. View all files in GitHub
- Install dependencies:
cd backend pip install -r requirements.txt - Configure environment variables:
- Set MongoDB URL and DB name in
.env.
- Set MongoDB URL and DB name in
- Run FastAPI server:
uvicorn server:app --reload
- Install dependencies:
cd frontend yarn install - Start the React app:
yarn start
- MongoDB: Used for storing uploaded datasets and trees.
- CORS: Configured via backend
.envfile. - API Endpoint: The frontend expects a
REACT_APP_BACKEND_URLenvironment variable.
- Backend: FastAPI, Python, MongoDB, Motor, Pandas, Numpy
- Frontend: React, Axios, Tailwind CSS
- Others: Docker/Cloud support via requirements, ESLint, Prettier
- Upload a dataset (CSV) in the web UI.
- View the constructed decision tree.
- Explore each split with entropy and information gain.
- Interact with tree nodes for more details.
Pull requests are welcome! For major changes, please open an issue first to discuss what you would like to change.