根据给定值完成矩阵

时间:2019-06-18 14:46:28

标签: python matrix scikit-learn

好,所以我有一个矩阵,假设5x5的示例值只在角落:

javascript

//Create bimIdsList Promise in order to create a list with all BIM360 
//elements in the model      
    function bimIdsList() {
        self.viewer.model.getBulkProperties(ids, properties, (propResults) => {
            propResults.forEach((propResult) => {
                propResult.properties.forEach((property) => { 
                    if(property.displayCategory === 'BIM 360'){
                        self._bimIds.push(propResult.dbId);
                    }                     
                })
            })  
        });
        /*if(self._bimIds) {
            resolve();
        }*/                         

        return Promise.resolve(self._bimids);

    }

//Create fillEquipList function in order to fill equipment list after 
//generating bimIdsList 
    function fillEquipList(bimIds) {
        self.viewer.model.getBulkProperties(bimIds, ['Type'], (propResults) => {
            propResults.forEach((propResult) => {
                propResult.properties.forEach((property) => {
                    if(property.displayCategory === 'BIM 360') {
                        var foundEqIndex = self._equipList.findIndex(x => x == property.displayValue);
                        if(foundEqIndex >= 0) {         
                            //Already in List, do Nothing                                    
                        } else {
                            self._equipList.push(property.displayValue)                                      
                            self._addedEquipment = true;                                                                    
                            //Add to dropdown 
                            const optionElement = document.createElement('option');
                            optionElement.value = property.displayValue;
                            optionElement.innerText = property.displayValue;
                            self._selEquipmentType.append(optionElement);  

                        } 
                    }
                })
            })                                                       



        });             
        //Resolve after callback 
        return Promise.resolve(self._addedEquipment); 

    }  


    //Now execute both functions
    bimIdsList()
        .then(success => {
            console.log('bimIds length: ');
            console.log( JSON.parse(JSON.stringify(success)) )                
            return fillEquipList(success)
        })
        .then(success => this.fillDictionaries());


    console.log(this._bimIds);

我想根据给定的值完成它,我找到了scikit-learn,但是simpleimputer一次只对每个nan取平均值,并且只在其中有数字的列中取平均值,因此在这种情况下结果将是:

 1  nan nan nan  15
nan nan nan nan nan 
nan nan nan nan nan 
nan nan nan nan nan 
 17 nan nan nan  12

是否有用于python的库(或使用scikit learning)可以帮助我预测矩阵的所有值而无需一次完成所有操作,所以不会有相同值的三倍?

0 个答案:

没有答案