https://github.com/hrolfrc/calf-milp
Milp feature section and hypercube vertex weights inspired by calf
https://github.com/hrolfrc/calf-milp
classification-algorithm
Last synced: 3 months ago
JSON representation
Milp feature section and hypercube vertex weights inspired by calf
- Host: GitHub
- URL: https://github.com/hrolfrc/calf-milp
- Owner: hrolfrc
- License: bsd-3-clause
- Created: 2023-08-02T13:50:21.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2023-08-28T21:30:43.000Z (almost 3 years ago)
- Last Synced: 2025-08-26T08:59:03.751Z (10 months ago)
- Topics: classification-algorithm
- Language: Python
- Homepage: https://www.nature.com/articles/s41598-022-09415-2
- Size: 82 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Quick Start
```python
from calf_milp import CalfMilp
from sklearn.datasets import make_classification
from sklearn.model_selection import train_test_split
```
#### Make a classification problem
```python
seed = 42
X, y = make_classification(
n_samples=30,
n_features=5,
n_informative=2,
n_redundant=2,
n_classes=2,
random_state=seed
)
X_train, X_test, y_train, y_test = train_test_split(X, y, random_state=seed)
```
#### Train the classifier
```python
cls = CalfMilp().fit(X_train, y_train)
```
#### Get the score on unseen data
```python
cls.score(X_test, y_test)
```
1.0