{"cells":[{"metadata":{},"cell_type":"markdown","source":"# Quasar Classifier (PLASTiCC dataset)"},{"metadata":{},"cell_type":"markdown","source":"### Data Preprocessing & feature construction"},{"metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","trusted":true},"cell_type":"code","source":"","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"### Pipeline feeding (tf.data API)"},{"metadata":{"trusted":true},"cell_type":"code","source":"class ArtificialDataset(tf.data.Dataset):\n    def _generator(num_samples):\n        # open the file\n        time.sleep(0.03)\n        for sample_idx in range(num_samples):\n            # read data (line, record) from the file\n            time.sleep(0.015)\n            yield (sample_idx,)\n    def __new__(cls, num_samples= 3):\n        return tf.data.Dataset.from_generator(\n            cls._generator,\n            output_signature = tf.TensorSpec(shape = (1,), dtype = tf.int64),\n            args = (num_samples,)\n        )","execution_count":null,"outputs":[]}],"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"pygments_lexer":"ipython3","nbconvert_exporter":"python","version":"3.6.4","file_extension":".py","codemirror_mode":{"name":"ipython","version":3},"name":"python","mimetype":"text/x-python"}},"nbformat":4,"nbformat_minor":4}