Git Product home page Git Product logo

analyzing-models-for-pets-1.0's Introduction

Analyzing models for pets ๐Ÿˆ ๐Ÿ• ๐Ÿ‡ ๐Ÿ ๐ŸฆŽ ๐Ÿฆฎ ๐Ÿ•โ€๐Ÿฆบ

  • Model 1: Pet TOPSIS Model (PTM)
  • Model 2: Multiple Pets TOPSIS Model (MPTM)
  • Model 3: Pets' future living trend predicting
  • Weight settings

Model 1: Pet TOPSIS Model (PTM) ๐Ÿพ

  • A TOPSIS (Technique for Order of Preference by Similarity to Ideal Solution) model for calculating whether multiple households are suitable for keeping different pets. Whether these family are suitable for keeping pets is calculated as a number for 0 to 1.
Screenshot 2024-03-30 at 8 28 31 PM

Sample input: 8 factors of certain amount of families to compare.

Screenshot 2024-03-29 at 11 52 46 PM
  • Input to the code as: the specie of the pet (Cat, Dog, Rabbit, Hamster, Lizard) + number of rows of the table + each number in the table (from column to row)
Cat 6 1 7 4 7 3 7 78 2 0 1 10 3 7 10 27 1 1 8 7 5 5 4 62 4 0 9 20 3 18 5 32 2 1 10 100 4 22 18 45 0 0 4 50 8 15 9 38 3

After forwardization:

Screenshot 2024-03-29 at 11 59 06 PM
1 7 4 7 3 7 0.536585 1 0 1 10 3 7 10 0.962963 1 1 8 7 5 5 4 0.926829 0.333333 0 9 20 3 18 5 1 1 1 10 100 4 22 18 1 1 0 4 50 8 15 9 1 0.666667

Sample output: A number from 0 to 1.

Screenshot 2024-03-30 at 12 03 25 AM
0.63818 0.0880036 0.642584 0.305568 0.879334 0.26832
  • The larger the result value is, the more suitable the family is for this pet.

Model 2: Multiple Pets TOPSIS Model (MPTM) ๐Ÿพ

  • The only difference is an extra factor => number of cats and dogs โ€‹(if they have had cats or/and dogs)โ€‹.

Sample input:

Screenshot 2024-03-30 at 7 11 14 PM
Cat 6 1 7 4 7 3 7 78 2 0 0 1 10 3 7 10 27 1 1 1 8 7 5 5 4 62 4 0 0 9 20 3 18 5 32 2 2 1 10 100 4 22 18 45 0 3 0 4 50 8 15 9 38 3 2

Sample output:

Screenshot 2024-03-30 at 8 13 42 PM
0.662219 0.206854 0.667652 0.310214 0.720904 0.269207

Model 3: Pets' future retention trend predicting (for ๐Ÿˆ ๐Ÿ• ๐Ÿ‡ ๐ŸฆŽ) ๐Ÿพ

  • Using a Gaussian distribution model and adjust the standard deviation for known mortality rates to obtain the predicted number of pets per year in the future.โ€‹
  • Factors such as the species' lifetime are already set in the code.
  • The average lifetime of hamsters๐Ÿ(21 months) is too short to be culculated in this model.

Sample input:

Enter the specie of pets: Cat
Enter the number of pets: 1000000
Enter the age of the pets: 6

Sample output:

Year 1: 999711 pets are predicted to survive.
Year 2: 997483 pets are predicted to survive.
Year 3: 985603 pets are predicted to survive.
Year 4: 941050 pets are predicted to survive.
Year 5: 825527 pets are predicted to survive.
Year 6: 621802 pets are predicted to survive.
Year 7: 376317 pets are predicted to survive.
Year 8: 173729 pets are predicted to survive.
Year 9: 58856 pets are predicted to survive.
Year 10: 14252 pets are predicted to survive.
Year 11: 2437 pets are predicted to survive.
Year 12: 287 pets are predicted to survive.
Year 13: 21 pets are predicted to survive.
Year 14: 0 pets are predicted to survive.
Year 15: 0 pets are predicted to survive.

Weights setting:

  • The weights of the eight factors for different species are already calculated.

PTM

    weightsC = {0.3453, 0.2018, 0.1249, 0.1144, 0.0679, 0.0679, 0.0389, 0.0389};
    weightsD = {0.2864, 0.1835, 0.1861, 0.1100, 0.0758, 0.0802, 0.0464, 0.0316};
    weightsH = {0.3395, 0.1432, 0.2034, 0.0830, 0.0552, 0.1107, 0.0382, 0.0267};
    weightsR = {0.3142, 0.2229, 0.1415, 0.0607, 0.1032, 0.0863, 0.0395, 0.0316};
    weightsL = {0.2542, 0.2955, 0.1453, 0.1162, 0.0791, 0.0570, 0.0313, 0.0214};

Cat: image

Dog: image

Hamster: image

Rabbit: image

Lizard: image

MPTM

    weightsC = {0.3044, 0.1806, 0.1084, 0.0941, 0.0564, 0.0564, 0.0332, 0.0332, 0.1333};
    weightsD = {0.2488, 0.1544, 0.1566, 0.0908, 0.0626, 0.0659, 0.0392, 0.0271, 0.1544};
    weightsH = {0.3107, 0.1337, 0.1825, 0.0713, 0.0492, 0.0930, 0.0339, 0.0239, 0.1019};
    weightsR = {0.2787, 0.2053, 0.1310, 0.0510, 0.0852, 0.0708, 0.0337, 0.0276, 0.1168};
    weightsL = {0.2367, 0.2778, 0.1397, 0.1087, 0.0777, 0.0501, 0.0280, 0.0194, 0.0618};

Cat: Screenshot 2024-03-30 at 7 57 51 PM

Dog: Screenshot 2024-03-30 at 7 58 31 PM

Hamster: Screenshot 2024-03-30 at 7 59 01 PM

Rabbit: Screenshot 2024-03-30 at 7 59 22 PM

Lizard: Screenshot 2024-03-30 at 8 00 02 PM

analyzing-models-for-pets-1.0's People

Contributors

huaedward avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.