from Helper.Transform.Selector.NumberSelector import NumberSelector from Helper.Transform.Selector.TextSelector import TextSelector from Helper.Transform.Columns.column_pipeline import column_pipeline from sklearn.preprocessing import StandardScaler, OneHotEncoder At1 = column_pipeline("At1", NumberSelector, StandardScaler, {}) At2 = column_pipeline("At2", NumberSelector, StandardScaler, {}) Class = column_pipeline("Class", NumberSelector, OneHotEncoder, {"categories":"auto"}) Column_pipeline_Dictionary = {"At1":At1, "At2":At2, "Class":Class}
from Helper.Transform.Selector.NumberSelector import NumberSelector from Helper.Transform.Selector.TextSelector import TextSelector from Helper.Transform.Columns.column_pipeline import column_pipeline from sklearn.preprocessing import OneHotEncoder, StandardScaler import numpy as np _Sex = {"handle_unknown": "ignore"} _Rings = {"categories": np.array(list(range(100))).reshape(1, -1)} Sex = column_pipeline("Sex", TextSelector, OneHotEncoder, _Sex) Length = column_pipeline("Length", NumberSelector, StandardScaler, {}) Diameter = column_pipeline("Diameter", NumberSelector, StandardScaler, {}) Height = column_pipeline("Height", NumberSelector, StandardScaler, {}) Whole_weight = column_pipeline("Whole_weight", NumberSelector, StandardScaler, {}) Shucked_weight = column_pipeline("Shucked_weight", NumberSelector, StandardScaler, {}) Viscera_weight = column_pipeline("Viscera_weight", NumberSelector, StandardScaler, {}) Shell_weight = column_pipeline("Shell_weight", NumberSelector, StandardScaler, {}) Rings = column_pipeline("Rings", NumberSelector, OneHotEncoder, _Rings) Column_pipeline_Dictionary = { "Sex": Sex, "Length": Length, "Diameter": Diameter, "Height": Height, "Whole_weight": Whole_weight, "Shucked_weight": Shucked_weight,
from Helper.Transform.Columns.column_pipeline import column_pipeline from Helper.Transform.Custom.nominal import _Identity _ClumpThickness = {} _CellSize = {} _CellShape = {} _MaginalAdhesion = {} _EpithelialSize = {} _BareNuclei = {} _BlandChromatin = {} _NormalNucleoli = {} _Mitoses = {} _Class = {} ClumpThickness = column_pipeline("ClumpThickness", NumberSelector, _Identity, _ClumpThickness) CellSize = column_pipeline("CellSize", NumberSelector, _Identity, _CellSize) CellShape = column_pipeline("CellShape", NumberSelector, _Identity, _CellShape) MaginalAdhesion = column_pipeline("MarginalAdhesion", NumberSelector, _Identity, _MaginalAdhesion) EpithelialSize = column_pipeline("EpithelialSize", NumberSelector, _Identity, _EpithelialSize) BareNuclei = column_pipeline("BareNuclei", NumberSelector, _Identity, _BareNuclei) BlandChromatin = column_pipeline("BlandChromatin", NumberSelector, _Identity, _BlandChromatin) NormalNucleoli = column_pipeline("NormalNucleoli", NumberSelector, _Identity, _NormalNucleoli) Mitoses = column_pipeline("Mitoses", NumberSelector, _Identity, _Mitoses) Class = column_pipeline("Class", NumberSelector, _Identity, _Class)
from Helper.Transform.Selector.NumberSelector import NumberSelector from Helper.Transform.Selector.ColumnSelector import ColumnSelector from Helper.Transform.Selector.TypeSelector import TypeSelector from Helper.Transform.Selector.TextSelector import TextSelector from Helper.Transform.Columns.column_pipeline import column_pipeline from Helper.Load.classification import Classification loadC = Classification("Data", "letter.dat", "letters-name.txt") from sklearn.preprocessing import StandardScaler from Helper.Transform.Custom.nominal import _Identity continuous_ = {} outputs_ = {} inputs_number = column_pipeline(loadC.inputs, ColumnSelector, StandardScaler, continuous_) outputs = column_pipeline(*loadC.outputs, TextSelector, _Identity, outputs_) Column_ = {"inputs": inputs_number, "output": outputs}
from Helper.Transform.Selector.NumberSelector import NumberSelector from Helper.Transform.Selector.TextSelector import TextSelector from Helper.Transform.Columns.column_pipeline import column_pipeline from Helper.Transform.Custom.nominal import _LabelBinarizer from sklearn.preprocessing import KBinsDiscretizer _Age = {"n_bins": 15, "encode": "ordinal", "strategy": "uniform"} _Year = {"n_bins": 10, "encode": "ordinal", "strategy": "uniform"} _Positive = {"n_bins": 5, "encode": "ordinal", "strategy": "uniform"} _Survival = {} Age = column_pipeline("Age", NumberSelector, KBinsDiscretizer, _Age) Year = column_pipeline("Year", NumberSelector, KBinsDiscretizer, _Year) Positive = column_pipeline("Positive", NumberSelector, KBinsDiscretizer, _Positive) Survival = column_pipeline("Survival", TextSelector, _LabelBinarizer, _Survival) Column_pipeline_Dictionary = { "Age": Age, "Year": Year, "Positive": Positive, "Survival": Survival }
from Helper.Transform.Selector.NumberSelector import NumberSelector from Helper.Transform.Selector.TextSelector import TextSelector from Helper.Transform.Columns.column_pipeline import column_pipeline from Helper.Transform.Custom.nominal import _LabelBinarizer, _Identity _Led1 = {} _Led2 = {} _Led3 = {} _Led4 = {} _Led5 = {} _Led6 = {} _Led7 = {} _number = {} Led1 = column_pipeline("Led1", NumberSelector, _LabelBinarizer, _Led1) Led2 = column_pipeline("Led2", NumberSelector, _LabelBinarizer, _Led2) Led3 = column_pipeline("Led3", NumberSelector, _LabelBinarizer, _Led3) Led4 = column_pipeline("Led4", NumberSelector, _LabelBinarizer, _Led4) Led5 = column_pipeline("Led5", NumberSelector, _LabelBinarizer, _Led5) Led6 = column_pipeline("Led6", NumberSelector, _LabelBinarizer, _Led6) Led7 = column_pipeline("Led7", NumberSelector, _LabelBinarizer, _Led7) number = column_pipeline("Number", NumberSelector, _Identity, _number) Column_pipeline_Dictionary = { "Led1": Led1, "Led2": Led2, "Led3": Led3, "Led4": Led4, "Led5": Led5, "Led6": Led6,
from Helper.Transform.Selector.NumberSelector import NumberSelector from Helper.Transform.Selector.TextSelector import TextSelector from Helper.Transform.Columns.column_pipeline import column_pipeline from sklearn.preprocessing import StandardScaler from Helper.Transform.Custom.nominal import _Identity SepalLength_ = {} SepalWidth_ = {} PetalLength_ = {} PetalWidth_ = {} Class_ = {} SepalLength = column_pipeline("SepalLength", NumberSelector, StandardScaler, SepalLength_) SepalWidth = column_pipeline("SepalWidth", NumberSelector, StandardScaler, SepalWidth_) PetalLength = column_pipeline("PetalLength", NumberSelector, StandardScaler, PetalLength_) PetalWidth = column_pipeline("PetalWidth", NumberSelector, StandardScaler, PetalWidth_) Class = column_pipeline("Class", NumberSelector, _Identity, Class_) Column_pipeline_Dictionary = { "SepalLength": SepalLength, "SepalWidth": SepalWidth, "PetalLength": PetalLength, "PetalWidth": PetalWidth, "Class": Class }
from Helper.Transform.Selector.NumberSelector import NumberSelector from Helper.Transform.Selector.ColumnSelector import ColumnSelector from Helper.Transform.Selector.TypeSelector import TypeSelector from Helper.Transform.Selector.TextSelector import TextSelector from Helper.Transform.Columns.column_pipeline import column_pipeline # is this a class? Hyperparameters too? I think these should be classes that take in a load # object or a transform object. name = "connect-4" from Helper.Load.classification import Classification loadC = Classification("Data", f"{name}.dat", f"{name}-names.txt") from sklearn.preprocessing import OrdinalEncoder from Helper.Transform.Custom.nominal import _Identity continuous_ = {} outputs_ = {} inputs_number = column_pipeline(loadC.inputs, ColumnSelector, OrdinalEncoder, continuous_) outputs = column_pipeline(*loadC.outputs, TextSelector, _Identity, outputs_) Column_ = { "inputs":inputs_number, "output":outputs }