how to use Convert-to-Indicator-Values, to convert a string category column for use in a Linear Regression model

MikeRichardson-3493 161 Reputation points
2021-07-23T02:26:55.79+00:00

Hi, Azure ML users, I'm new to modules that were not mentioned in the learning Paths. My new numerical columns are title-#NAN,title-rebuilt,title-salvage.

Azure seems to predict a higher price, when it sees a 1 for title-salvage, or 1 for title-rebuilt. But it needs to do the opposite. Any tips for how to use my new indicator numerical columns in a Linear Regression (online Gradient descent)?

screen shot attached. Thank you.
117128-cars-4features2-confused-indicators.png

Azure Machine Learning
Azure Machine Learning
An Azure machine learning service for building and deploying models.
2,545 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. MikeRichardson-3493 161 Reputation points
    2021-07-25T17:04:11.997+00:00

    The model using Convert-to-Indicator-Values seems to score title-Rebuilt column as 1 to increase the predicted value. However, title-Salvage column did lower the value of the predicted value. Is there a way to specify the new converted columns as a detractor to the algorithm?

    screen shots. model on right uses title convrted-indicator columns in model. the green box column, is the actual real recorded price of the car, used as a Label.
    117645-azure-convert-indicator1.png

    117657-azure-convert-indicator2.png

    0 comments No comments

  2. MikeRichardson-3493 161 Reputation points
    2021-07-25T17:08:51.297+00:00

    price,year,car,miles,model,engine,manual,title,notes
    1900,2009,Nissan Quest,178000,,v6,,,white
    2900,2008,Nissan Quest,137000,SE,3.5L,,,Runs good a/c good clean title DVD 2 screens reverse camera 555-444-1111
    4000,2007,Nissan Quest,125336,SL,v6 3.5L,,,silver vin 15C1FV2N14
    5300,2012,Nissan Quest,130000,S,v6,,,
    7000,2012,Nissan Quest,115000,,,,,gray one owner
    6250,2015,Dodge Grand Caravan,105200,,v6,,,blue 2C25C1FV2
    6750,2010,Dodge Grand Caravan,101074,SXT,,,,navy blue
    8000,2013,Dodge Grand Caravan,85000,SXT,v6 3.6L,,,vin 2C24R1FV2 blue Natural Aspiration
    8000,2014,Dodge Grand Caravan,55431,SE,v6 3.6L,,,gray flex fuel
    9900,2012,Dodge Grand Caravan,35000,,,,,gray 555-444-2222
    6000,2014,Dodge Avenger,45000,SXT,,,rebuilt,white tinted Windows leather 1C3CDZ6560504
    6000,2014,Dodge Avenger,45000,SXT,,,rebuilt,white 1C32CDZC33333
    5500,2016,Dodge Dart,78000,,,,rebuilt,gray with stickers no email 555-444-3333
    5900,2014,Dodge Dart,75136,,,manual,,red with rims 555-444-4444
    6400,2015,Dodge Dart,83218,,2.0L,,,black tinted windows 1C23CDF4040404
    6700,2013,Dodge Dart,93800,SXT Turbo,,,,1C3CDF505050505 red reef auto sales dealer
    6850,2015,Dodge Dart,66000,Limited,,,rebuilt,sunroof
    3700,2007,Buick Lucerne,87000,CX,3.8L,,,has divider console
    4200,2008,Buick Lucerne,87000,CXL,v8,,,sunroof red
    4200,2008,Buick Lucerne,87000,CXS,v8 4.6L,,,red console divider sunroof
    4500,2011,Buick Lucerne,110000,,,,rebuilt,white console divider 555-444-5555
    5800,2009,Buick Lucerne,68000,CXL,v6,,,white clear foot area very good condition 555-444-6666
    5300,2009,Buick Lucerne,98100,CXL,v6,,,silver console divider 555-444-7777 down from 5800 to 5300
    6400,2011,Buick Lucerne,56000,,,,rebuilt,silver
    6500,2011,Buick Lucerne,93000,CXL,3.9L,,,red or silver clear foot area
    6500,2008,Buick Lucerne,58000,CXL,,,,light brown mint condition clear foot area nice and dependable 555-444-8888
    6800,2011,Buick Lucerne,61000,,3.9L,,,heated and cooled seats floor console divider 555-444-9999
    4900,2010,Nissan Maxima,80000,S,,,rebuilt,maroon sunroof only had small side swipe on drive side back door buy now drive now fix later price 777-555-1111
    5900,2011,Nissan Maxima,89000,,v6,,rebuilt,dark gray wrecked tail light sunroof
    5500,2010,Nissan Altima,76000,SR,v6 3.5L,,rebuilt,coupe purple Bose GPS screen backup camera sunroof 777-555-2222
    5600,2013,Nissan Altima,88000,S,,,salvage,gray with rims and spanish
    6300,2011,Nissan Altima,76000,,,,,
    6500,2011,Nissan Altima,44000,,2.5L,,,silver brand new sells great cars including Buick Lucerne 777-555-3333
    6550,2015,Nissan Altima,33000,,,,rebuilt,red one owner sports edition 777-555-4444
    6800,2010,Nissan Altima,48000,,,,,gray blue 30 day warranty mint condition 777-555-5555
    6800,2015,Nissan Altima,60000,SV,2.5L,,,custom color brown silver
    6800,2012,Nissan Altima,57000,2.5S,2.5L,,,gray brand new mint condition 777-555-6666
    7500,2011,Nissan Altima,34000,2.5SL,,,,white shiny new sun roof leather heated seats 777-555-7777
    5800,2012,Nissan Sentra,75000,SR,,,,black tinted 3B21AB6A3333 spanish only 777-555-8888
    5800,2014,Nissan Sentra,85659,,,,,black automatic one tiny wreck fixed
    6800,2014,Nissan Sentra,47000,,,,,no model decal
    6900,2015,Nissan Sentra,50000,S,,manual,,
    4000,2015,Nissan Sentra,65000,,,manual,,gray tinted windows austin 777-555-9999
    4100,2015,Nissan Versa,82000,S,,manual,,white 3N12CN7A22222 222-222-1111
    4900,2015,Nissan Versa,90000,,,manual,,five spd Clean CarFax gray green
    6300,2016,Nissan Versa,86100,SV,,,,gray 3N7C2N2222 firm price
    6900,2016,Nissan Versa,67324,SV,,,,white licensed dealer
    7000,2017,Nissan Versa,79000,,,manual,,teal dark green shiny new look
    5150,2009,Honda Civic,95000,,,,,paint peeling on hood 1 owner 222-222-2222
    6300,2012,Honda Civic,90000,,,,salvage,brown silver 281-777-1000
    4800,2015,Mitsibishi Lancer,75000,,,,,tinted window and maybe special wheels
    6000,2011,Mitsubishi Endeavor,89000,,v6,,,all black 4wd elegantautodealer 222-222-3333
    4500,2010,Mazda 3,78000,,,manual,,black
    5500,2014,Mazda 6,80000,,,,,red no scratches good condition
    7100,2013,Infinity G37,91000,,v6,,salvage,gray sunroof
    6200,2015,Hyundai Elantra,62440,SE,1.8L,,rebuilt,silver rear camera gray 5N1PDH5555 222-222-4444
    6650,2011,Hyundai Elantra,73186,,,,,light blue trunk damage
    6800,2012,Hyundai Sonata,57000,,,,rebuilt,
    6700,2012,Hyundai Velostar,78000,,,,salvage,black
    7350,2012,Hyundai Velostar,78000,base,,manual,,black dealer
    5000,2012,Kia Soul,72063,,1.6L,,,green 222-222-5555
    5500,2015,Kia Soul,75000,,,manual,,six speed tinted windows one owner gray
    7950,2015,Kia Soul,82000,,1.6L,manual,,white 4door remote entry
    3300,2008,Kia Spectra,114000,LX,,manual,,white fun to drive good tires
    3000,2008,Kia Spectra,54000,,,,,red hood paint peeling low mileage
    3950,2008,Pontiac g6,85000,GT,v6,,,white tinted Windows front passenger fender unflush
    6200,2011,Ford Fusion,85000,,,,,purple new tires 222-222-6666
    6500,2010,Ford Fusion,86000,SEL,v6 3.0L,,,blue sunroof power leather heated seats 222-222-7777
    5500,2015,Ford Fiesta,58000,,,manual,rebuilt,white 222-222-7777 strange pic shows automatic not manual
    4995,2013,Ford Fiesta,78100,,,,,gray like new 222-222-8888
    4700,2013,Ford Fiesta,46000,,,,,white 4 door excellent condition
    5900,2014,Ford Focus,68000,SE,,,,white 222-222-9999
    5000,2014,Ford Focus,77457,SE,,,,vin 1FADP98332222
    6000,2011,Ford Focus,87000,SEL,,,,light green oil changed often new front brake pads and rotors
    5000,2013,Chrysler 200,89000,LX,,,,black from dealer L1X3C14DCB22222
    4900,2015,Chevrolet Aveo,9000,,1.6L,,,red runs good
    2500,2011,Chevrolet Aveo,85269,LT,,,,red tinted windows radio does not work
    4500,2015,Chevrolet Cruze,83341,,,,salvage,dark blue good tires
    5500,2014,Chevrolet Cruze,88000,,,,rebuilt,red
    6000,2016,Chevrolet Cruze,86300,,1.8L,manual,,black blue chrome shifter
    6900,2015,Chevrolet Malibu,80000,LT,2.5L,,rebuilt,backup camera
    7200,2015,Chevrolet Malibu,80000,,,,rebuilt,black Back up camera Bluetooth power seats price firm
    5500,2009,Chevrolet Impala,71500,,v6,,salvage,black one owner
    5950,2014,Chevrolet Impala,63840,,,,,sunroof silver
    6500,2014,Chevrolet Impala,63755,LTZ,v6 3.6L,,,silver
    7500,2012,Chevrolet Impala,78000,LT,v6,,,unknown color
    7999,2015,Chevrolet Impala,72000,Limited,3.6L,,,white 9C1 w police package 3.6L VVT Direct Injection one owner 300 HP V6
    4900,2010,Mini Cooper,85000,,,manual,,used car lot red and black stripe
    5500,2013,Mini Cooper,74000,Sport,,manual,rebuilt,silver black lines now down to 5800 started at 6500
    4500,2013,Fiat,94000,,,manual,,black tinted windows seller does not need anymore
    7995,2015,Volkswagon Jetta,69000,,2.0L,,,white excellent condition Vin 1VW4MAJ3222222
    8500,2012,Nissan Quest,95000,SV,v6,,,white spanish 4wd
    6200,2013,Dodge Charger,93000,,,,,black tinted windows owner got a new one
    5500,2012,Nissan Sentra,75000,SR,,,,black spanish 3B1AB
    5800,2013,Dodge Avenger,52000,SXT,,,rebuilt,red
    4175,2011,Chevrolet Cruz,68000,,1.8L,manual,,silver 1F1P45
    8000,2016,Kia Forte,70231,,,,,black TX female driver
    6000,2016,Hyundai Accent,90000,SE,,,,white factory GPS
    7429,2013,Chevrolet Sonic,91835,LT,,,,black sold dealer
    6321,2016,Chevrolet Spark,50414,LS,,,,silver KSA8 Lubbock
    5121,2011,Nissan Altima,84348,2.5S,2.5L,,,silver 14A2P dealer Lubbock
    7200,2014,Toyota Corolla,71276,LE,,,,black w rims Excellent Condition
    6850,2015,Ford Fiesta,81000,,,,,white 3ADP0F
    7900,2012,Ford Fusion,90400,SEL,v6 3.0,,,cream Leather XM radio 3T0AP
    7900,2018,Kia Forte,83000,LX,,,rebuilt,blue firm price
    5495,2013,Dodge Dart,93000,SXT,,,,black non smoker previous owner good tires
    7000,2017,Buick Verano,79000,,,,rebuilt,red sunroof
    7900,2018,Kia Forte,83000,LX,,,rebuilt,blue firm price
    7900,2017,Nissan Sentra,83000,SV,,,rebuilt,maroon backup camera

    0 comments No comments

  3. MikeRichardson-3493 161 Reputation points
    2021-07-27T03:21:53.57+00:00

    more bad news. Testing the model from within Azure as a deployed Endpoint. putting in rebuilt predicted price is $5,136. testing with regular clean title, which for my data is null value in this column, the price goes down to $3,493. Adding an Indicator column based on a Categorical column is failing in Regression my model. What am I doing wrong? thanks. This is a great concept to combine categories with numerical for regression. Perhaps next month, I will start over with Logistic Regression.

    118095-azure-deploy-endp-indicator1.png

    118131-azure-deploy-endp-indicator2.png

    0 comments No comments