Python Forum
Classification of Request
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Classification of Request
#1
Python: How to categorize the request in different categories for example in 3 categories based on any 3 ex. aa, bb, cc (any):, using KMeans or any other classification technique, I need just categories. help will be highly appreciated. thanks in advance! Smile

import random


class Req():
    def __init__(self,reqNum,node_num):
        self.reqNum = reqNum
        self.location = random.randint(0,node_num//10)
        self.firewall_demand = random.randint(300,600)
        self.storage_demand = random.randint(100,300)
        self.bandwidth_demand = random.randint(200,500)
        self.fw_dm = random.randint(200,400)
        self.st_dm = random.randint(150,350)
        self.bw_dm = random.randint(250,550)

def createSetOfRequest(req_num, node_num):
    sr = []
    for i in range(0, req_num):
        sr.append(Req(i, node_num))
    return sr
# (i have to categorise in 3 category, scenario will be like that you can change accordingly, this is just for example)
ns = createSetOfRequest(20,200)
for i in range(0,20):
    print(sr[i].reqNum,sr[i].firewall_demand ,sr[i].firewall_demand ,sr[i].bandwidth_demand)
Reply


Messages In This Thread
Classification of Request - by PythonLearner703 - Nov-19-2019, 04:14 AM
RE: Classification of Request - by baquerik - Nov-19-2019, 11:27 AM
RE: Classification of Request - by PythonLearner703 - Nov-20-2019, 01:48 AM
RE: Classification of Request - by micseydel - Nov-25-2019, 09:03 PM
RE: Classification of Request - by PythonLearner703 - Dec-09-2019, 04:06 AM
RE: Classification of Request - by buran - Dec-09-2019, 11:24 AM
RE: Classification of Request - by micseydel - Dec-09-2019, 08:56 PM
Classifications of request - by PythonLearner703 - Dec-09-2019, 03:51 AM
RE: Classifications of request - by Larz60+ - Dec-09-2019, 11:08 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
Sad Miss-Classification problem with shuffled batch Faebs94 0 1,587 Sep-02-2021, 11:55 AM
Last Post: Faebs94
  Probabilities of binary classification problem Troublesome1996 0 2,445 Apr-19-2021, 06:40 PM
Last Post: Troublesome1996
  GridSearchCV for multi-label classification mapypy 0 3,737 Mar-29-2021, 01:58 AM
Last Post: mapypy
  GNN For Graph "Classification" BennyS 1 1,805 Feb-09-2021, 12:09 PM
Last Post: BennyS
  Help with multiclass classification in perceptron code Nimo_47 0 3,767 Nov-09-2020, 10:32 PM
Last Post: Nimo_47
  Classification and Regression tree (CART) kumarants 2 2,760 May-26-2020, 11:04 AM
Last Post: Larz60+
  CNN Speech Classification Mitchie87 0 1,640 Dec-06-2019, 06:17 PM
Last Post: Mitchie87
  Keras: Time series classification midarq 0 2,021 Sep-25-2019, 09:03 AM
Last Post: midarq
  Classification with shuffling PythonNewbie 1 2,472 Nov-12-2017, 10:23 AM
Last Post: PythonNewbie

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020