示例#1
0
        public Algorithm_(int k, List <winequalityRed> train, List <winequalityRed> wineSet)
        {
            this.kNN = k;                     //k neighbor

            this.trainset      = train;       //trainset
            this.wineSet       = wineSet;     //customer
            this.totalTrainset = train.Count; //total of wine

            distances = new Distance [this.totalTrainset];

            //get max value of each column need to normalize
            MaxinumValue maximum = new MaxinumValue(train);

            maximum.findAllMax();

            MAXfixedAcidity       = maximum.getFixedAcidity();
            MAXvolatileAcidity    = maximum.getVolatileAcidity();
            MAXcitricAcid         = maximum.getCitricAcid();
            MAXresidualSugar      = maximum.getResidualSugar();
            MAXchlorides          = maximum.getChlorides();
            MAXfreeSulfurDioxide  = maximum.getFreeSulfurDioxide();
            MAXtotalSulfurDioxide = maximum.getTotalSulfurDioxide();
            MAXdensity            = maximum.getDensity();
            MAXpH        = maximum.getPH();
            MAXsulphates = maximum.getSulphates();
            MAXalcohol   = maximum.getAlcohol();
            MAXquality   = maximum.getQuality();
        }
示例#2
0
文件: Algorithm.cs 项目: nvnhcmus/kNN
        public Algorithm(  int k, List <Customer> train, List <Customer> customer )
        {
            this.kNN = k;//k neighbor

            this.trainset = train;//trainset
            this.customerset = customer;//customer
            this.totalTrainset = train.Count;//total of customer

            distances = new Distance [this.totalTrainset];

            //get max value of each column need to normalize
            MaxinumValue maximum = new MaxinumValue(train);
            maximum.findAllMax();

            maxAge = maximum.getMaxAge();
            maxIncome = maximum.getMaxIncome();
            maxNumCard = maximum.getMaxNumCard();
        }
示例#3
0
        public Algorithm(int k, List <Customer> train, List <Customer> customer)
        {
            this.kNN = k;                     //k neighbor

            this.trainset      = train;       //trainset
            this.customerset   = customer;    //customer
            this.totalTrainset = train.Count; //total of customer

            distances = new Distance [this.totalTrainset];

            //get max value of each column need to normalize
            MaxinumValue maximum = new MaxinumValue(train);

            maximum.findAllMax();

            maxAge     = maximum.getMaxAge();
            maxIncome  = maximum.getMaxIncome();
            maxNumCard = maximum.getMaxNumCard();
        }