A Simple Model Manager
- Pre-requisites
- Make sure that Node and MongoDB is installed.
- MongoDB should be running at
localhost:27017
. Otherwise, change./config/db.config.js
file. - MongoDB should have a DB named
betterdata
. Otherwise, create one or change./config/db.config.js
file.
- Install the project and it's dependencies
npm install
- Run the API server
DEBUG=modelman:* npm start
API server will be available at: http://localhost:3000
- (Optional & WIP) Run frontend
cd frontend
npm run start
Frontend server will be available at: http://localhost:8000
Request:
POST http://localhost:3000/users
Body:
{
"id": "unsuitable001",
"name": "Soumyadip Mondal"
}
Response:
{
"name": "Soumyadip Mondal",
"id": "unsuitable001"
}
Request:
POST http://localhost:3000/projects
Body:
{
"title": "project-1",
"real_data": ["real.csv"],
"created_by": "unsuitable001",
"models": [
{
"title": "model-1",
"parameters": {
"batch_size": 32,
"training_cycles": 32
},
"synthetic_data": ["synthetic.csv"]
},
{
"title": "model-2",
"parameters": {
"batch_size": 64,
"training_cycles": 64
},
"synthetic_data": ["synthetic.csv"]
}
]
}
Response:
{
"title": "project-1",
"real_data": ["real.csv"],
"created_by": "unsuitable001",
"models": [
{
"title": "model-1",
"parameters": {
"batch_size": 32,
"training_cycles": 32
},
"synthetic_data": ["synthetic.csv"],
"_id": "6164209264b065a2b4ad3aff"
},
{
"title": "model-2",
"parameters": {
"batch_size": 64,
"training_cycles": 64
},
"synthetic_data": ["synthetic.csv"],
"_id": "6164209264b065a2b4ad3b00"
}
],
"id": "6164209264b065a2b4ad3afe"
}
Request:
GET http://localhost:3000/users/unsuitable001/projects
Response:
[
{
"title": "project-1",
"real_data": ["real.csv"],
"created_by": "unsuitable001",
"models": [
{
"parameters": {
"batch_size": 32,
"training_cycles": 32
},
"title": "model-1",
"synthetic_data": ["synthetic.csv"],
"_id": "6164209264b065a2b4ad3aff"
},
{
"parameters": {
"batch_size": 64,
"training_cycles": 64
},
"title": "model-2",
"synthetic_data": ["synthetic.csv"],
"_id": "6164209264b065a2b4ad3b00"
}
],
"id": "6164209264b065a2b4ad3afe"
}
]
Request:
PATCH http://localhost:3000/projects/PROJECT_ID
Body:
{
"title": "My New Project Name"
}
Response:
{
"title": "My New Project Name",
"real_data": ["real.csv"],
"created_by": "unsuitable001",
"models": [
{
"title": "model-1",
"parameters": {
"batch_size": 32,
"training_cycles": 32
},
"synthetic_data": ["synthetic.csv"],
"_id": "6164209264b065a2b4ad3aff"
},
{
"title": "model-2",
"parameters": {
"batch_size": 64,
"training_cycles": 64
},
"synthetic_data": ["synthetic.csv"],
"_id": "6164209264b065a2b4ad3b00"
}
],
"id": "6164209264b065a2b4ad3afe"
}
Request:
POST http://localhost:3000/models/PROJECT_ID
Body:
{
"title": "model-3",
"parameters": {
"batch_size": 128,
"training_cycles": 128
},
"synthetic_data": ["synthetic.csv"]
}
Response:
{
"title": "My New Project Name",
"real_data": ["real.csv"],
"created_by": "unsuitable001",
"models": [
{
"parameters": {
"batch_size": 32,
"training_cycles": 32
},
"title": "model-1",
"synthetic_data": ["synthetic.csv"],
"_id": "6164209264b065a2b4ad3aff"
},
{
"parameters": {
"batch_size": 64,
"training_cycles": 64
},
"title": "model-2",
"synthetic_data": ["synthetic.csv"],
"_id": "6164209264b065a2b4ad3b00"
},
{
"title": "model-3",
"parameters": {
"batch_size": 128,
"training_cycles": 128
},
"synthetic_data": ["synthetic.csv"],
"_id": "616422e564b065a2b4ad3b10"
}
],
"id": "6164209264b065a2b4ad3afe"
}
Request:
PATCH http://localhost:3000/models/PROJECT_ID/MODEL_ID
Body:
{
"parameters": {
"batch_size": 16,
"training_cycles": 16
}
}
Response:
{
"parameters": {
"batch_size": 16,
"training_cycles": 16
},
"title": "model-1",
"synthetic_data": ["synthetic.csv"],
"id": "6164209264b065a2b4ad3aff"
}
Request:
PATCH http://localhost:3000/models/PROJECT_ID/MODEL_ID/remove
Response:
{
"parameters": {
"batch_size": 64,
"training_cycles": 64
},
"title": "model-2",
"synthetic_data": ["synthetic.csv"],
"id": "6164209264b065a2b4ad3b00"
}
Request:
POST http://localhost:3000/projects/PROJECT_ID/upload
Body:
multipart/form-data file: <data.csv>
Response:
{
"message": "file uploaded",
"file": "drug.csv"
}
Request:
PATCH http://localhost:3000/models/PROJECT_ID/MODEL_ID/generate
Response:
{
"message": "file generated",
"file": "1634012228330syn"
}
Request:
PATCH http://localhost:3000/models/PROJECT_ID/MODEL_ID/FILE_NAME/delete
Response:
{
"message": "file deleted",
"file": "1634012228330syn"
}