Spaces:
No application file
No application file
| # predict_success.py | |
| import joblib | |
| import numpy as np | |
| model = joblib.load('model.pkl') | |
| def predict_token_success(token_features): | |
| """ | |
| token_features: dict with keys liquidity, volume, holder_growth, trading_velocity | |
| """ | |
| features = np.array([ | |
| token_features['liquidity'], | |
| token_features['volume'], | |
| token_features['holder_growth'], | |
| token_features['trading_velocity'] | |
| ]).reshape(1, -1) | |
| probability = model.predict_proba(features)[0][1] # Success class probability | |
| return probability | |