📜  规范化 - R 编程语言代码示例

📅  最后修改于: 2022-03-11 14:51:58.388000             🧑  作者: Mango

代码示例1
# creating a normalize function for easy convertion.
normalize <- function(x) {
return ((x - min(x)) / (max(x) - min(x))) } 

# lapply creates list that is why it is converted to dataframe and it
# applies defined fundtion (which is 'normalize') to all the list values
# which is here column 2 to 8 as first column is target/response.
df.norm<- as.data.frame(lapply(df, normalize))