def test_projecting_dataframe_from_hierarchical_to_one_hot_encoding_cross_product_hypergrid(
         self):
     adaptee = self.hierarchical_hypergrid
     adapter = CategoricalToOneHotEncodedHypergridAdapter(
         adaptee=adaptee, merge_all_categorical_dimensions=True)
     self._test_projecting_dataframe_categorical_to_one_hot_encoding_point_from_adaptee(
         adapter=adapter, adaptee=adaptee, num_random_points=1000)
 def test_projecting_dataframe_from_hierarchical_to_one_hot_encoding_drop_first_hypergrid(
         self):
     adaptee = self.hierarchical_hypergrid
     adapter = CategoricalToOneHotEncodedHypergridAdapter(adaptee=adaptee,
                                                          drop='first')
     self._test_projecting_dataframe_categorical_to_one_hot_encoding_point_from_adaptee(
         adapter=adapter, adaptee=adaptee, num_random_points=1000)
 def test_projecting_point_from_hierarchical_categorical_to_one_hot_encoding_hypergrid(
         self):
     hierarchical_adapter = CategoricalToOneHotEncodedHypergridAdapter(
         adaptee=self.hierarchical_hypergrid)
     self._test_projecting_categorical_to_one_hot_encoding_point_from_adaptee(
         adaptee=self.hierarchical_hypergrid,
         adapter=hierarchical_adapter,
         num_random_points=500)
 def test_projecting_point_from_categorical_to_one_hot_encoding_drop_first_simple_hypergrid(
         self):
     adapter = CategoricalToOneHotEncodedHypergridAdapter(
         adaptee=self.simple_hypergrid, drop='first')
     self._test_projecting_categorical_to_one_hot_encoding_point_from_adaptee(
         adaptee=self.simple_hypergrid,
         adapter=adapter,
         num_random_points=500)
 def test_projecting_point_from_categorical_to_one_hot_encoding_cross_product_simple_hypergrid(
         self):
     adapter = CategoricalToOneHotEncodedHypergridAdapter(
         adaptee=self.simple_hypergrid,
         merge_all_categorical_dimensions=True)
     self._test_projecting_categorical_to_one_hot_encoding_point_from_adaptee(
         adaptee=self.simple_hypergrid,
         adapter=adapter,
         num_random_points=500)
 def test_projecting_dataframe_from_flat_to_one_hot_encoded_cross_product_drop_first_hypergrid(
         self):
     adaptee = self.simple_hypergrid
     adapter = CategoricalToOneHotEncodedHypergridAdapter(
         adaptee=adaptee,
         merge_all_categorical_dimensions=True,
         drop='first')
     self._test_projecting_dataframe_categorical_to_one_hot_encoding_point_from_adaptee(
         adapter=adapter, adaptee=adaptee, num_random_points=1000)
 def test_projecting_point_from_hierarchical_categorical_to_one_hot_encoding_cross_product_drop_first_hypergrid(
         self):
     hierarchical_adapter = CategoricalToOneHotEncodedHypergridAdapter(
         adaptee=self.hierarchical_hypergrid,
         merge_all_categorical_dimensions=True,
         drop='first')
     self._test_projecting_categorical_to_one_hot_encoding_point_from_adaptee(
         adaptee=self.hierarchical_hypergrid,
         adapter=hierarchical_adapter,
         num_random_points=100)
    def test_projecting_dataframe_from_flat_to_one_hot_encoded_hypergrid_parameterized(
            self, drop, merge_all_categorical_dimensions):
        for adaptee in [self.simple_hypergrid, self.hierarchical_hypergrid]:
            adapter = CategoricalToOneHotEncodedHypergridAdapter(
                adaptee=adaptee,
                drop=drop,
                merge_all_categorical_dimensions=
                merge_all_categorical_dimensions)
            test_types_are_not_categorical = [
                dimension.__class__ != CategoricalDimension
                for dimension in adapter.dimensions
            ]
            assert all(test_types_are_not_categorical)

            self._test_projecting_dataframe_categorical_to_one_hot_encoding_point_from_adaptee(
                adapter=adapter, adaptee=adaptee, num_random_points=1000)
 def test_projecting_dataframe_from_flat_to_one_hot_encoded_hypergrid(self):
     adaptee = self.simple_hypergrid
     adapter = CategoricalToOneHotEncodedHypergridAdapter(adaptee=adaptee)
     self._test_projecting_dataframe_categorical_to_one_hot_encoding_point_from_adaptee(
         adapter=adapter, adaptee=adaptee, num_random_points=1000)