Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/72.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
用missForest填充缺少的值_R_Random Forest_Missing Data - Fatal编程技术网

用missForest填充缺少的值

用missForest填充缺少的值,r,random-forest,missing-data,R,Random Forest,Missing Data,我想使用missForest估算值 变量中缺少值,但不是全部 当我这样做的时候,它真的很慢(从来没有发生过) mf_1对数据框进行子集设置只会将这些列传递给missfreest()函数,因此,它只会使用这些变量来插补数据。以下是一个例子: library(missForest) data(iris) ## We are going to have missing values in first 3 columns ## Introduce missing values iris_wih_NA

我想使用
missForest
估算值

变量中缺少值,但不是全部

当我这样做的时候,它真的很慢(从来没有发生过)


mf_1对数据框进行子集设置只会将这些列传递给
missfreest()
函数,因此,它只会使用这些变量来插补数据。以下是一个例子:

library(missForest)
data(iris)

## We are going to have missing values in first 3 columns
## Introduce missing values 
iris_wih_NA <- missForest::prodNA(iris[c(1,2,3)], 0.3)
## Last two columns are then added
iris_wih_NA$Petal.Width <- iris$Petal.Width
iris_wih_NA$Species <- iris$Species
head(iris_wih_NA)

## Will use all variables to impute missing Values
iris_imputed1 <- missForest::missForest(iris_wih_NA)$ximp
## Will use only variables 1,2 and 3 to impute missing values
iris_imputed2 <- missForest::missForest(iris_wih_NA[c(1,2,3)])$ximp
库(密斯林)
数据(iris)
##我们将在前3列中缺少值
##引入缺失值

iris_wih_NA对数据帧进行子集设置只会将这些列传递给
missForest()
函数,因此,它只会使用这些变量来插补数据。以下是一个例子:

library(missForest)
data(iris)

## We are going to have missing values in first 3 columns
## Introduce missing values 
iris_wih_NA <- missForest::prodNA(iris[c(1,2,3)], 0.3)
## Last two columns are then added
iris_wih_NA$Petal.Width <- iris$Petal.Width
iris_wih_NA$Species <- iris$Species
head(iris_wih_NA)

## Will use all variables to impute missing Values
iris_imputed1 <- missForest::missForest(iris_wih_NA)$ximp
## Will use only variables 1,2 and 3 to impute missing values
iris_imputed2 <- missForest::missForest(iris_wih_NA[c(1,2,3)])$ximp
库(密斯林)
数据(iris)
##我们将在前3列中缺少值
##引入缺失值

iris_wih_NA欢迎来到S.O.请为您的问题添加更多细节,以便其他人能够提供帮助(例如,添加使用的样本数据,以便其他人能够复制您遇到的问题)。您会发现这些指导原则很有用:欢迎来到S.O.请为您的问题添加更多细节,以便其他人能够提供帮助(例如,添加使用的样本数据,以便其他人能够复制您遇到的问题)。您会发现这些指南很有用:
library(missForest)
data(iris)

## We are going to have missing values in first 3 columns
## Introduce missing values 
iris_wih_NA <- missForest::prodNA(iris[c(1,2,3)], 0.3)
## Last two columns are then added
iris_wih_NA$Petal.Width <- iris$Petal.Width
iris_wih_NA$Species <- iris$Species
head(iris_wih_NA)

## Will use all variables to impute missing Values
iris_imputed1 <- missForest::missForest(iris_wih_NA)$ximp
## Will use only variables 1,2 and 3 to impute missing values
iris_imputed2 <- missForest::missForest(iris_wih_NA[c(1,2,3)])$ximp