Skip to content

Commit

Permalink
revert: implement Serializable for ThresholdedRandomCutForestState
Browse files Browse the repository at this point in the history
Signed-off-by: Yaliang Wu <[email protected]>
  • Loading branch information
ylwu-amzn committed Mar 25, 2022
1 parent e7496ef commit ad37748
Show file tree
Hide file tree
Showing 12 changed files with 11 additions and 184 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,10 @@

package com.amazon.randomcutforest.state;

import java.io.Serializable;

import lombok.Data;

@Data
public class ExecutionContext implements Serializable {
private static final long serialVersionUID = 1L;

public class ExecutionContext {
private boolean parallelExecutionEnabled;
private int threadPoolSize;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

import static com.amazon.randomcutforest.state.Version.V3_0;

import java.io.Serializable;
import java.util.List;

import lombok.Data;
Expand All @@ -31,8 +30,7 @@
* that the forest can be serialized and deserialized.
*/
@Data
public class RandomCutForestState implements Serializable {
private static final long serialVersionUID = 1L;
public class RandomCutForestState {

private String version = V3_0;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@

package com.amazon.randomcutforest.state.returntypes;

import java.io.Serializable;

import lombok.Getter;
import lombok.Setter;

Expand All @@ -34,9 +32,7 @@
*/
@Getter
@Setter
public class DiVectorState implements Serializable {
private static final long serialVersionUID = 1L;

public class DiVectorState {
double[] high;
double[] low;
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,14 @@

import static com.amazon.randomcutforest.state.Version.V2_0;

import java.io.Serializable;

import lombok.Data;

/**
* A data object representing the state of a
* {@link com.amazon.randomcutforest.sampler.CompactSampler}.
*/
@Data
public class CompactSamplerState implements Serializable {
private static final long serialVersionUID = 1L;

public class CompactSamplerState {
/**
* a version string for extensibility
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,10 @@

import static com.amazon.randomcutforest.state.Version.V2_0;

import java.io.Serializable;

import lombok.Data;

@Data
public class NodeStoreState implements Serializable {
private static final long serialVersionUID = 1L;
public class NodeStoreState {

private String version = V2_0;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@

import static com.amazon.randomcutforest.state.Version.V2_0;

import java.io.Serializable;

import lombok.Data;

/**
Expand All @@ -28,9 +26,7 @@
* {@code floatData} will be null.
*/
@Data
public class PointStoreState implements Serializable {
private static final long serialVersionUID = 1L;

public class PointStoreState {
/**
* version string for future extensibility
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,12 @@

import static com.amazon.randomcutforest.state.Version.V2_0;

import java.io.Serializable;

import lombok.Data;

import com.amazon.randomcutforest.state.store.NodeStoreState;

@Data
public class CompactRandomCutTreeState implements Serializable {
private static final long serialVersionUID = 1L;

public class CompactRandomCutTreeState {
private String version = V2_0;
private int root;
private int maxSize;
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@

import static com.amazon.randomcutforest.state.Version.V2_1;

import java.io.Serializable;

import lombok.Data;

import com.amazon.randomcutforest.parkservices.state.preprocessor.PreprocessorState;
Expand All @@ -27,9 +25,7 @@
import com.amazon.randomcutforest.state.returntypes.DiVectorState;

@Data
public class ThresholdedRandomCutForestState implements Serializable {
private static final long serialVersionUID = 1L;

public class ThresholdedRandomCutForestState {
private String version = V2_1;
RandomCutForestState forestState;
private BasicThresholderState thresholderState;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,12 @@

import static com.amazon.randomcutforest.state.Version.V2_1;

import java.io.Serializable;

import lombok.Data;

import com.amazon.randomcutforest.parkservices.state.statistics.DeviationState;

@Data
public class PreprocessorState implements Serializable {
private static final long serialVersionUID = 1L;
public class PreprocessorState {

private String version = V2_1;
private double useImputedFraction;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,10 @@

package com.amazon.randomcutforest.parkservices.state.statistics;

import java.io.Serializable;

import lombok.Data;

@Data
public class DeviationState implements Serializable {
private static final long serialVersionUID = 1L;

public class DeviationState {
private double discount;

private double weight;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,12 @@

package com.amazon.randomcutforest.parkservices.state.threshold;

import java.io.Serializable;

import lombok.Data;

import com.amazon.randomcutforest.parkservices.state.statistics.DeviationState;

@Data
public class BasicThresholderState implements Serializable {
private static final long serialVersionUID = 1L;
public class BasicThresholderState {

private long randomseed;

Expand Down

0 comments on commit ad37748

Please sign in to comment.