year, Category, Leather interior, Fuel type, Engine volume, Mileage, Cylinders, Gearbox type, Drive wheels, Doors, Wheel, Color, Airbags. I imported a CSV file with data on ID, Price, Levy, Manufacturer, Model, and Prod.
I created a linear regression model using TensorFlow 2.0. LinearEst = tf.estimator.LinearClassifier(feature_columns=featureColumns) TrainInputFN = makeInputFN(dfTrain, yTrain)ĮvalInputFN = makeInputFN(dfEval, yEval, nEpochs=1, shuffle=False)
Vocabulary = dfTrain.unique()įeatureColumns.append(tf.feature_column.categorical_column_with_vocabulary_list(featureName, vocabulary))įeatureColumns.append(tf.feature_column.numeric_column(featureName, dtype=tf.float32))ĭef makeInputFN(dfData, dfLabel, nEpochs=10, shuffle=True, batchSize=32):ĭs = tf._tensor_slices((dict(dfData), dfLabel)) DfTrain = pd.read_csv('carPriceTrain.csv')ĭfTrain = dfTrain.rename(columns=)ĬATEGORICAL_COLUMNS =