“为什么在删除列文本后不删除?在Dl4j转换中”

时间:2019-10-22 18:41:46

标签: dl4j

“我正在尝试训练NN,但是在csv中使用文本时遇到了问题,所以我决定从中删除所有文本。”

“我正在尝试从csv文件中删除文本,但文本没有删除”

TransformProcess tp = new TransformProcess.Builder(schema)
  .removeColumns("MSZoning","Street","Alley","LotConfig","LotShape","LandContour","RoofMatl","LotConfig",
                               "BsmtCond",
                               "Utilities","LandSlope", "Neighborhood", "Condition1", "Condition2", "BldgType",
                               "HouseStyle", "RoofStyle",  "Exterior1st", "Exterior2nd", "MasVnrType", "ExterQual",
                               "ExterCond", "Foundation", "BsmtQual", "BsmtExposure",
                               "BsmtFinType1", "BsmtFinType2", "Heating", "HeatingQC", "CentralAir",  "KitchenQual",
                               "Functional", "FireplaceQu", "GarageType",
                               "GarageFinish", "GarageQual", "GarageCond", "PavedDrive", "PoolQC", "Fence",
                               "MiscFeature", "SaleType", "SaleCondition","Electrical")

csv file

1 个答案:

答案 0 :(得分:0)

看这个例子:https://github.com/eclipse/deeplearning4j-examples/blob/master/datavec-examples/src/main/java/org/datavec/transform/basic/BasicDataVecExample.java

您需要在TransformProcess上调用tp.build(),然后获取生成的模式:

Schema outputSchema = tp.getFinalSchema();