Change how trees are saved so that they are compressed.
This commit is contained in:
parent
dc9d20aa1a
commit
d4853f5232
2 changed files with 3 additions and 2 deletions
|
@ -66,7 +66,7 @@ public class DataLoader {
|
|||
final List<Tree<O>> treeList = new ArrayList<>(treeFileList.size());
|
||||
|
||||
for(final File treeFile : treeFileList){
|
||||
final ObjectInputStream inputStream = new ObjectInputStream(new FileInputStream(treeFile));
|
||||
final ObjectInputStream inputStream = new ObjectInputStream(new GZIPInputStream(new FileInputStream(treeFile)));
|
||||
|
||||
final Tree<O> tree = (Tree) inputStream.readObject();
|
||||
|
||||
|
|
|
@ -18,6 +18,7 @@ import java.util.concurrent.Executors;
|
|||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
import java.util.zip.GZIPOutputStream;
|
||||
|
||||
@Builder
|
||||
@AllArgsConstructor(access=AccessLevel.PRIVATE)
|
||||
|
@ -163,7 +164,7 @@ public class ForestTrainer<Y, TO, FO> {
|
|||
public void saveTree(final Tree<TO> tree, String name) throws IOException {
|
||||
final String filename = saveTreeLocation + "/" + name;
|
||||
|
||||
final ObjectOutputStream outputStream = new ObjectOutputStream(new FileOutputStream(filename));
|
||||
final ObjectOutputStream outputStream = new ObjectOutputStream(new GZIPOutputStream(new FileOutputStream(filename)));
|
||||
|
||||
outputStream.writeObject(tree);
|
||||
|
||||
|
|
Loading…
Reference in a new issue