-
Notifications
You must be signed in to change notification settings - Fork 177
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds protobuf serialization to FeatureMap, Hasher, and VariableInfo i…
…mplementations (#226) * Roughing out the core tribuo protos. * Adding protobuf serialization for FeatureMap, subclasses and fields of FeatureMap. * Adding generated protos. * Adding equals methods to CategoricalInfo and RealInfo, and added an equality test to CategoricalInfoTest. * Adding equals methods to Hashers, and adding HashedFeatureMap.serialize(). * Adding equals methods to FeatureMap and MutableFeatureMap, and tests for equality and serialization in FeatureMapTest. * Removing generated protos for ease of reviewing. * Fix the javadoc in ProtoSerializable. * Adding support for serializing TransformerMap. * Adding protobuf serialization to org.tribuo.transform.transformations. * Fixing copyrights. * Adding tests for transformation serialization. Made the transformer implementations package private so they are easier to test. * initial scratchings of ProtobufClass/Field annotations and ProtoUtil.serialize method * moved ProtoUtilTest to org.tribuo to allow testing of protected method * added protobuf generated source files * added @ProtobufField and @ProtobufClass to a bunch of class defs - major update to ProtoUtil.serialize to handle more cases - added a bunch of tests to ProtoUtilTest - replaced serialize method impls with ProtoUtil.serialize - CategoricalIDInfo/CategoricalInfo - handles observedValue and observedCount separately from valueCounts - CategoricalInfo has an id member set to -1 - added version attribute to ProtobufClass annotation * renamed annotations ProtoSerializable has default serialize method ProtoSerializableClass no longer has 'serializedClass' attribute and is no longer repeatable added RealIDInfoProto and CategricalIDInfoProto removed CategoricalInfo.id and RealInfo.id removed various serialize methods in favor of default method new annotation ProtoSerializableKeysValuesField towards cleaning up ProtoUtil.serialize ReflectUtil gives the type parameter assignments for an object's interface type parameters * default deserialize method replaces "instantiate" added @ProtoSerializableMapValuesField remove register redirects clean up serialization of fields logic - remove getMapFields - clean up getFields findMethod can be used for setters and getters by specifying expected param count. * moved protoserializable code into protos package remove various compile warnings in package. * initial commit of ProtoSerializableArrayField which allows you to annotate e.g. an array of doubles as done in BinningTransformer (found in BinningTransformation). * removed unneeded serialize methods * updated tests to be consistent * added @ProtoSerializable annotations to two transformers * removes initial attempt at generic but underspecified deserialize method developer must implement deserializeFromProto and won't get a crappy solution that does something if they don't. also, put back in detailed error handling messages in the higher-level 'deserialize' method (FKA 'instantiate'). * reimplemented ReflectUtil to pull out one type parameter resolution this version has a bunch of sysout statements added unit tests * cleaned up reimplementation of ReflectUtil functionality. better unit tests removed sysout statements fixed a bug found in unit tests. * SimpleTransform replace serialize() impl fix problem with field name in annotation * moved functionality in ReflectUtil to ProtoUtil and made it private * added @ProtoSerializableClass annotation to LinearScalingTransformer refactored serialize() * added @ProtoSerializableClass to IDFTransformer and refactored serialize added unit test * removed default impl for ProtoSerializable.serialize added default impls to all the effected subclasses that now require them. * Formatting and licenses. * Removing ProtoSerializableArrayField, cleaning up the use of maps, making version not default, adding javadoc. * Tidying up ProtoUtil. * Adding internal redirect hook. * Narrowing the visibility of some methods in ProtoUtil. * Adding static version field. Improving validation of deserialized objects. * Adding docs about hasher deserialization. * Adding more logging and exceptions to ProtoUtil. * Fix ModHashCodeHasher deserialize. Co-authored-by: Philip Ogren <[email protected]>
- Loading branch information
Showing
104 changed files
with
34,124 additions
and
120 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.