A simple web app that estimates the optimal price to sell warframe items at using Ridge Regression.
- Price Trends: View 1-day, 7-day, and 30-day median prices
- Fair Price: ML-based price estimation using Ridge Regression
- Search: Autocomplete search for Warframe items
- Frontend: Next.js with TypeScript and Tailwind CSS
- Backend: Next.js API routes
- ML: Python + scikit-learn (Ridge Regression)
- Data Source: Warframe.market API v2
# Install dependencies
npm install
# Create Python virtual environment
python -m venv venv
# Activate virtual environment
source venv/bin/activate
# Install Python dependencies
pip install "numpy>=1.24.0" "scikit-learn>=1.3.0" "requests>=2.31.0"# Make sure virtual environment is activated
source venv/bin/activate
# Run training script
python scripts/train_model.pyThis will:
- Fetch historical price data from the Warframe.market API
- Train a Ridge Regression model
- Save the model to
model/model.json
Note: The API has rate limiting, so this may take a while.
npm run devOpen http://localhost:3000.
Ridge Regression is a technique that finds patterns in historical prices and uses them to estimate what an item should cost.
The model uses three pieces of information to make predictions:
median_1d: The median price from the last 1 day (current market)median_7d: The median price from the last 7 days (short-term trends)median_30d: The median price from the last 30 days (longer-term trends)
These medians are weighted so that days with more trading volume are more important in the calcuations.
The optimal sell price is then calculated with this formula:
Sell Price = Base Price + (Weight1 * median_1d) + (Weight2 * median_7d) + (Weight3 * median_30d)
The weights are learned through training.
- Get Real-Time Data: The training script downloads historical prices for up to 200 items from the Warframe.market API
- Clean the Data:
The script:
- Removes price outliers
- Ignores days with low to no trading volume
- Build Patterns:
The script looks at examples of previous trades and maps:
- Inputs: 1-day, 7-day, and 30-day medians
- Target: the next day’s median price
- Train Model:
- Ridge Regression learns the best weights to explain how past prices relate to future ones
- Save the Model:
- The weights are stored in a JSON file
When a user searches for an item:
- Get recent prices from Warframe.market API
- Compute 1/7/30 day trends
- Use the trained model on the trends to compute the optimal sell price
- Bounds-check the value to within current buy/sell values
- Return the result
