Skip to content

LL08-MathematicalModelling-dowell/100033-dowellclassification

Repository files navigation

Dowell Classification API Documentation

Insert Input Data

URL

http://100061.pythonanywhere.com/allbaskets/

Request

{
   "country":[
         {
            "item":"India",
            "itemLink":"Asia"
         },
         {
            "item":"USA",
            "itemLink":"North America"
         },
         {
            "item":"Germany",
            "itemLink":"Europe"
         }
   ],
   "state":[
         {
            "item":"Uttar Pradesh",
            "itemLink":"India"
         },
         {
            "item":"Maharashtra",
            "itemLink":"India"
         },
         {
            "item":"Georgia",
            "itemLink":"USA"
         },
         {
            "item":"Nevada",
            "itemLink":"USA"
         },
         {
            "item":"Bavaria",
            "itemLink":"Germany"
         },
         {
            "item":"Brandenburg",
            "itemLink":"Germany"
         }
   ],
   "city":[
         {
            "item":"Agra",
            "itemLink":"Uttar Pradesh"
         },
         {
            "item":"Noida",
            "itemLink":"Uttar Pradesh"
         },
         {
            "item":"Pune",
            "itemLink":"Maharashtra"
         },
         {
            "item":"Mumbai",
            "itemLink":"Maharashtra"
         },
         {
            "item":"Atlanta",
            "itemLink":"Georgia"
         },
         {
            "item":"Carson City",
            "itemLink":"Nevada"
         },
         {
            "item":"Munich",
            "itemLink":"Bavaria"
         },
         {
            "item":"Potsdam",
            "itemLink":"Brandenburg"
         }
   ]
}

Response

{
  "dbInsertedId": "63d8ec5e790d8f03c1318997"
}

For Non-Hierarchical Classification

1. Classification Type

URL

http://100061.pythonanywhere.com/type/

Request

{
    "numberOfLevels": 3, 
    "classificationType": "N",
    "dbInsertedId":"63d8ec5e790d8f03c1318997"
}

Response

{
  "insertedId": "63d8ed59790d8f03c13189aa",
  "message": "Select first baskets from the given baskets",
  "baskets": [
    "country",
    "state",
    "city"
  ]
}

2. Basket Selection

URL

http://100061.pythonanywhere.com/basket/

Request

{
    "selectedBasket":"state",
    "baskets":[
    "country",
    "state"
  ]
,
    "insertedId":"63d8ed59790d8f03c13189aa"
}

Response

{
  "insertedId": "63d8ed59790d8f03c13189aa",
  "permutations": [
    [
      "state",
      "city"
    ],
    [
      "city",
      "state"
    ]
  ],
  "baskets": [
    "country"
  ],
  "message": "Select and save from the given permutations of basket order and select next basket from the given baskets"
}

3. Save Selected Basket Order

URL

http://100061.pythonanywhere.com/savepermutations/

Request

{
  "inserted_id": "63d8ed59790d8f03c13189aa",
  "selectedPermutation":[
      "state",
      "city"
    ]
}

Response

{
  "message": "Selected permutation ['state', 'city'] is saved successfully."
}

4. Save Final Basket Order

URL

http://100061.pythonanywhere.com/basket/

Request

{
    "selectedBasket":"BasketOrder",
    "baskets":[
    "BasketOrder"
  ]
,
    "insertedId":"63d8ed59790d8f03c13189aa"
}

Response

{
  "insertedId": "63d8ed59790d8f03c13189aa",
  "message": "3 baskets are already selected, select item from the given items for the first basket",
  "basket": "country",
  "items": [
    "India",
    "USA",
    "Germany"
  ]
}

5. Item Selection

URL

http://100061.pythonanywhere.com/item/

Request

{
  "selectedItem":"India",
  "basket":"country",
  "insertedId":"63d8ed59790d8f03c13189aa",
  "status":true
}

Response

{
  "message": "Select and save permutation from the given permutations and select next item from the same basket country or next basket state",
  "nextBasekt": "state",
  "nextBasketItems": [
    "Uttar Pradesh",
    "Maharashtra",
    "Georgia",
    "Nevada",
    "Bavaria",
    "Brandenburg"
  ],
  "permutations": [
    [
      "Germany",
      "India"
    ],
    [
      "India",
      "Germany"
    ]
  ],
  "currentBasketItems": [
    "USA"
  ],
  "currentBasket": "country"
}

6. Save Selected Order of Items

URL

http://100061.pythonanywhere.com/savepermutations/

Request

{
  "inserted_id": "63d8ed59790d8f03c13189aa",
  "selectedPermutation":[
      "India",
      "Germany"
    ]
}

Response

{
  "message": "Selected permutation ['India', 'Germany'] is saved successfully."
}

7. Finalize Item Selection after selections from all baskets are done

URL

http://100061.pythonanywhere.com/item/

Request

{
  "selectedItem":"",
  "basket":"",
  "insertedId":"63d8ed59790d8f03c13189aa",
  "status":false
}

Response

{
  "message": "Items from all required baskets are successfully selected"
}

8. Call Classification Function

URL

http://100061.pythonanywhere.com/function/

Request

{
  "insertedId":"63d8ed59790d8f03c13189aa"
}

Response

{
  "_id": "63d8ed59790d8f03c13189aa",
  "classificationType": "N",
  "numberOfLevels": 3,
  "eventId": "FB1010000000167516091556471636",
  "dbInsertedId": "63d8ec5e790d8f03c1318997",
  "baskets": [
    "country",
    "state",
    "city"
  ],
  "basketOrder": [
    "country",
    "state",
    "city"
  ],
  "finalSelection": {
    "country": [
      "India",
      "Germany"
    ],
    "state": [
      "Uttar Pradesh",
      "Georgia"
    ],
    "city": [
      "Pune",
      "Munich"
    ]
  },
  "totalLength": {
    "country": 3,
    "state": 6,
    "city": 8
  },
  "selectedLength": {
    "country": 2,
    "state": 2,
    "city": 2
  },
  "probability": 0.35294117647058826,
  "finalOutput": [
    [
      "India",
      "Germany"
    ],
    [
      "Uttar Pradesh",
      "Georgia"
    ],
    [
      "Pune",
      "Munich"
    ]
  ]
}

For Tree Structure and Hierarchical Classification

1. Basket Selection

URL

http://100061.pythonanywhere.com/basket/

Request

{
    "selectedBasket":"state",
    "baskets":[
    "country",
    "state"
  ]
,
    "insertedId":"63d8ed59790d8f03c13189aa"
}

Response

{
  "insertedId": "63d8ed59790d8f03c13189aa",
  "permutations": [
    [
      "state",
      "city"
    ],
    [
      "city",
      "state"
    ]
  ],
  "baskets": [
    "country"
  ],
  "message": "Select and save from the given permutations of basket order and select next basket from the given baskets"
}

2. Save Selected Basket Order

URL

http://100061.pythonanywhere.com/savepermutations/

Request

{
  "inserted_id": "63d8ed59790d8f03c13189aa",
  "selectedPermutation":[
      "state",
      "city"
    ]
}

Response

{
  "message": "Selected permutation ['state', 'city'] is saved successfully."
}

3. Save Final Basket Order

URL

http://100061.pythonanywhere.com/basket/

Request

{
    "selectedBasket":"BasketOrder",
    "baskets":[
    "BasketOrder"
  ]
,
    "insertedId":"63d8ed59790d8f03c13189aa"
}

4. Classification Type

URL

http://100061.pythonanywhere.com/type/

Request

{
    "numberOfLevels": 3, 
    "classificationType": "N",
    "dbInsertedId":"63d8ec5e790d8f03c1318997"
}

Response

{
  "insertedId": "63d8ed59790d8f03c13189aa",
  "message": "Select first baskets from the given baskets",
  "baskets": [
    "country",
    "state",
    "city"
  ]
}

5. Item Selection

URL

http://100061.pythonanywhere.com/item/

Request

{
  "selectedItem":"India",
  "basket":"country",
  "insertedId":"63d8ed59790d8f03c13189aa",
  "status":true
}

Response

{
  "message": "Select and save permutation from the given permutations and select next item from the same basket country or next basket state",
  "nextBasekt": "state",
  "nextBasketItems": [
    "Uttar Pradesh",
    "Maharashtra",
    "Georgia",
    "Nevada",
    "Bavaria",
    "Brandenburg"
  ],
  "permutations": [
    [
      "Germany",
      "India"
    ],
    [
      "India",
      "Germany"
    ]
  ],
  "currentBasketItems": [
    "USA"
  ],
  "currentBasket": "country"
}

6. Save Selected Order of Items

URL

http://100061.pythonanywhere.com/savepermutations/

Request

{
  "inserted_id": "63d8ed59790d8f03c13189aa",
  "selectedPermutation":[
      "India",
      "Germany"
    ]
}

Response

{
  "message": "Selected permutation ['India', 'Germany'] is saved successfully."
}

7. Finalize Item Selection after selections from all baskets are done

URL

http://100061.pythonanywhere.com/item/

Request

{
  "selectedItem":"",
  "basket":"",
  "insertedId":"63d8ed59790d8f03c13189aa",
  "status":false
}

Response

{
  "message": "Items from all required baskets are successfully selected"
}

8. Call Classification Function

URL

http://100061.pythonanywhere.com/function/

Request

{
  "insertedId":"63d8ed59790d8f03c13189aa"
}

Response

{
  "_id": "63d8ed59790d8f03c13189aa",
  "classificationType": "N",
  "numberOfLevels": 3,
  "eventId": "FB1010000000167516091556471636",
  "dbInsertedId": "63d8ec5e790d8f03c1318997",
  "baskets": [
    "country",
    "state",
    "city"
  ],
  "basketOrder": [
    "country",
    "state",
    "city"
  ],
  "finalSelection": {
    "country": [
      "India",
      "Germany"
    ],
    "state": [
      "Uttar Pradesh",
      "Georgia"
    ],
    "city": [
      "Pune",
      "Munich"
    ]
  },
  "totalLength": {
    "country": 3,
    "state": 6,
    "city": 8
  },
  "selectedLength": {
    "country": 2,
    "state": 2,
    "city": 2
  },
  "probability": 0.35294117647058826,
  "finalOutput": [
    [
      "India",
      "Germany"
    ],
    [
      "Uttar Pradesh",
      "Georgia"
    ],
    [
      "Pune",
      "Munich"
    ]
  ]
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •