VIF Application in Python | VIF In python | Variance Inflation Factor In Python

Поділитися
Вставка
  • Опубліковано 17 жов 2024

КОМЕНТАРІ • 50

  • @faeezaroos3236
    @faeezaroos3236 2 роки тому +2

    Great Video! I am getting RuntimeWarning: divide by zero encountered in double_scalars
    vif = 1. / (1. - r_squared_i). I am able to see VIF values for only a few independent variables

  • @ManishSingh-qp8vl
    @ManishSingh-qp8vl 2 роки тому +1

    Sir, i have used VIF after using standard scaler . I found very less values . Is this right way to use scaling of input parameters before calculating VIF

  • @prateeksachdeva1611
    @prateeksachdeva1611 2 роки тому

    Really helpful video

  • @CosmicTrisha
    @CosmicTrisha 2 роки тому +1

    Dear sir,I have one question like you have create one new variable from year_old and swiggy_rating,How to handle this in front end for prediction??

    • @UnfoldDataScience
      @UnfoldDataScience  2 роки тому

      Good question Neeraj. Whenever u get the input data from front end, it should pass through feature engineering pipeline before prediction. That logic you should apply before calling "prediction"

  • @valeuler
    @valeuler 2 роки тому

    Parabéns pelo seu Vídeo. Gostei. 👏👏👏👏

  • @response2u
    @response2u 2 роки тому

    Thank you for your video. Does this apply to classification problems as well? Is the process different in classification problems?

    • @UnfoldDataScience
      @UnfoldDataScience  2 роки тому +1

      It is application to Logistic regression - not other algorithms, basically linear models.

    • @response2u
      @response2u 2 роки тому

      @@UnfoldDataScience Thank you! So how do you detect and remove multicollinearity in categorical problems?

  • @dorgeswati
    @dorgeswati 3 роки тому +1

    keep it up, good concepts coming

    • @UnfoldDataScience
      @UnfoldDataScience  3 роки тому

      Thanks a lot

    • @333razesh
      @333razesh 3 роки тому

      As always, very good explanation with simple example and relate to the real-time work..thanks a lot

  • @sivachaitanya6330
    @sivachaitanya6330 2 роки тому

    why do we use vif ?if we can eliminate features by some feature selection techniques like mutual_info_regress,pca,p-value ......????????????please reply

  • @niharkashyap3897
    @niharkashyap3897 3 роки тому

    Why did you multiply rating and year at 7:13 . Is there any significance or you have randomly multiplied them?

  • @ayesha11261
    @ayesha11261 3 місяці тому

    why exactly did you multiple the year and rating column tho ?

  • @musicalhearts0106
    @musicalhearts0106 Рік тому

    Hello sir.. very informative video.. why did we do product of rating and year?
    And also what should be the value of vif so that it is acceptable?

  • @sandipansarkar9211
    @sandipansarkar9211 2 роки тому

    finished watching

  • @ishtigokak3526
    @ishtigokak3526 3 роки тому +1

    hi aman, your videos are very informative and unique. Nice work. Keep going.
    I tried to install statsmodels using pip install statsmodels but dint get variance inf fac in that could you help me how to go ahead..?

    • @UnfoldDataScience
      @UnfoldDataScience  3 роки тому

      statsmodels.stats.outliers_influence.variance_inflation_factor

    • @ishtigokak3526
      @ishtigokak3526 3 роки тому

      @@UnfoldDataScience Got it. Thanks Aman!

  • @MadhumithaN
    @MadhumithaN 2 роки тому

    Hello, I'm getting an error "ufunc 'isfinite' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe" when I run this for my data. Any thoughts on what could have caused this? Much appreciated.

    • @UnfoldDataScience
      @UnfoldDataScience  2 роки тому

      stackoverflow.com/questions/40809503/python-numpy-typeerror-ufunc-isfinite-not-supported-for-the-input-types

  • @vtechguruG
    @vtechguruG Рік тому

    hi ,can u pls make tutorial with pyhton code for IV-score analysis & weight of evidence??

  • @gouthamansaravanan7692
    @gouthamansaravanan7692 2 роки тому

    Very nice one! Thank you!!

  • @pragatishinde3688
    @pragatishinde3688 3 роки тому

    Can you please explain Why do you prefer multiplication operation on rating and year?

  • @alfathterry7215
    @alfathterry7215 3 роки тому

    sir, do we need adding constant to calculate vif? bcs in stackoverflow i saw an article that we have to add constant, and now im confused which one is correct

    • @UnfoldDataScience
      @UnfoldDataScience  3 роки тому +1

      Vif formula is same everywhere.
      Could you give me the stack overflow link you are talking abt,

  • @laxmanbisht2638
    @laxmanbisht2638 3 роки тому

    Sir, calculate_vif is showing as undefined. I have imported vif as shown in the video, still I am getting this error.

    • @UnfoldDataScience
      @UnfoldDataScience  3 роки тому

      Hi Laxman, due to version difference it might be happening, check your sklearn version and find the equivalent function for VIF.

  • @sandipansarkar9211
    @sandipansarkar9211 2 роки тому

    The " must to know topics" code and datasets is not present in google drive.Can you please sent the link for valuable practice

  • @montegukh7907
    @montegukh7907 2 роки тому

    when i call the function 'calculate_vif(features)'
    i get this as an error 'TypeError: '(slice(None, None, None), 0)' is an invalid key'
    please help.

  • @rafsunahmad4855
    @rafsunahmad4855 3 роки тому

    Sir please make a video on how data science work actually done in a office.How they perform tasks. Means first to last how a work is done in a office.

  • @mmarva3597
    @mmarva3597 3 роки тому

    Thanks very much, can you please explain (the code) why we add [ ] to variance_inflation_factor(dataset.values,i) for i in range (dataset.values.shape[1]) ?? I can't seem to understand

    • @abhinavkale4632
      @abhinavkale4632 3 роки тому

      cause it is a list comprehension. you must have solved this.. [i for i in list if i%2==0].. (which gives all even number present inside the '"list").... google it

  • @sivachaitanya6330
    @sivachaitanya6330 2 роки тому

    where can i get the code and the dataset??????????

  • @amolkabugade3728
    @amolkabugade3728 3 роки тому

    sir could you please try it in our traditional way without using variance_inflation_factor
    i tried many times but the are not matching at all
    i used this below code on some other dataset, what is wrong in this..
    for i in features:

    x=X_train.drop(i,axis=1)
    # print(x)
    Y=X_train[i]
    # print(Y)
    x_sm=sm.add_constant(x)
    lr=sm.OLS(Y,x_sm).fit()

    Y_pred=lr.predict(x_sm)
    r2=r2_score(Y,Y_pred)
    VIF=1/(1-r2)
    print('r2=',r2)
    print('VIF=',VIF)

    • @UnfoldDataScience
      @UnfoldDataScience  3 роки тому +1

      What is the issue i did not get.

    • @amolkabugade3728
      @amolkabugade3728 3 роки тому

      @@UnfoldDataScience we calculate VIF directly using the function.
      My problem was that i tried this VIF by writing whole code for VIF myself instead of using function directly. i was not able to do that. I got error

    • @amolkabugade3728
      @amolkabugade3728 3 роки тому

      Send me your mail ID there i'll send u the pic of the issue.

  • @mohammadumar6536
    @mohammadumar6536 2 роки тому

    Xxxxiii

  • @umamaheswariyarlagadda9033
    @umamaheswariyarlagadda9033 2 роки тому

    Hii, Can you please provide the link to download dataset (RestaurentData.xlsx) so that I can compare the results. Thank you.

    • @UnfoldDataScience
      @UnfoldDataScience  2 роки тому

      drive.google.com/drive/folders/1XdPbyAc9iWml0fPPNX91Yq3BRwkZAG2M