Casebasedreasoning

Find missing values in data set using Euclid distance, normalization and calculating information value, weight of evidence
Alternatives To Casebasedreasoning
Project NameStarsDownloadsRepos Using ThisPackages Using ThisMost Recent CommitTotal ReleasesLatest ReleaseOpen IssuesLicenseLanguage
Keras57,7483306 hours ago68May 13, 2022373apache-2.0Python
Deep Learning for humans
Scikit Learn53,56018,9446,7222 hours ago64May 19, 20222,129bsd-3-clausePython
scikit-learn: machine learning in Python
Ml For Beginners45,381
8 days ago11mitJupyter Notebook
12 weeks, 26 lessons, 52 quizzes, classic Machine Learning for all
Made With Ml32,763
10 days ago5May 15, 20198mitJupyter Notebook
Learn how to responsibly develop, deploy and maintain production machine learning applications.
Spacy25,6361,5338422 hours ago196April 05, 2022112mitPython
💫 Industrial-strength Natural Language Processing (NLP) in Python
Ray24,807801992 hours ago76June 09, 20222,872apache-2.0Python
Ray is a unified framework for scaling AI and Python applications. Ray consists of a core distributed runtime and a toolkit of libraries (Ray AIR) for accelerating ML workloads.
Ai Expert Roadmap24,033
a month ago13mitJavaScript
Roadmap to becoming an Artificial Intelligence Expert in 2022
Data Science Ipython Notebooks23,924
6 months ago26otherPython
Data science Python notebooks: Deep learning (TensorFlow, Theano, Caffe, Keras), scikit-learn, Kaggle, big data (Spark, Hadoop MapReduce, HDFS), matplotlib, pandas, NumPy, SciPy, Python essentials, AWS, and various command lines.
Applied Ml23,904
6 days ago5mit
📚 Papers & tech blogs by companies sharing their work on data science & machine learning in production.
Streamlit23,570174042 hours ago182July 27, 2022637apache-2.0Python
Streamlit — The fastest way to build data apps in Python
Alternatives To Casebasedreasoning
Select To Compare


Alternative Project Comparisons
Readme

Missing Values

Case-based reasoning (CBR) is the process of solving new problems based on the solutions of similar past problems [1]. In data science CBR is a technique which allows us to find missing values from a given set of data, and each variable has its own set of characteristics. If we have a variable that does not contain one or more characteristic, we can find a similar variable using Euclidean distance and predict the missing characteristics.

In this repository there are 2 Python scripts, one for finding missing values and the other for calculating which characteristics (columns) influence/define the missing value the most. There is also already a generated file containing data (including missing values) and statistics collected from users of a telecommunication company. Using that data we can train a model and check the correctness of the results.

Getting started

Requirements

To run both scripts you should have Python version 3.x and the following modules installed:

  • pandas
  • numpy

All modules are available trough PIP:

pip install pandas

This command also installs numpy module.

Running

This git repository is consisted of the following files:

  • FindMissingValues.py
  • CalculateIV.py
  • telecom.csv
  • telecomStats.txt

File telecom.csv contains all data from the telecommunication company in csv format with columns:

  • customerId : int
  • customerAge : int
  • customerPlansChanged : int
  • smsCountPerMonth : int
  • callMinutePerMonth : int
  • dataMBPerMonth : int
  • netflixStream : boolean
  • pickboxStream : boolean
  • youtubeStream : boolean
  • hboGoStream : boolean
  • viberFree : boolean
  • whatsappFree : boolean

There is a total of 4 000 rows and 12 columns. Out of the 4 000 rows, 6 of them have missing values: 3 rows with customerAge missing and 3 rows with customerPlansChanged missing.

If we run the script FindMissingValues.py with the following command:

python3 FindMissingValues.py

we get following results:

customerId predictedValue realValue
3998 30 33
3999 70 48
4000 25 28
3995 0 0
3996 3 3
3997 4 5

As we can see our predicting model is giving pretty good values, except for people older than 40. Those people usually do not use any kind of data/sms/call plans, and for that reason they are not our target population for presenting new tariffs. It should also be mentioned that data used in prediction is quite random so edge cases are not deeply covered (ex: people older than 40 years old).

If we run CalculateIV.py we will get information about which columns influence missing value (in this case customer age is the column that contains missing values):

(14, 18):
#Positive influence:
customerPlansChanged = (2.0, 3.0)
#Opposite influence:
customerPlansChanged = (3.0, 4.0)
netflixStream = True
pickboxStream = True
youtubeStream = True
hboGoStream = True

(18, 28):
#Positive influence:
youtubeStream = True
#There is no opposite influence
...

From this partial output you can see which variables influence the missing value, so if a user changes his/her tariff 2 or 3 times (positive influence), and does not have Netflix, Pickbox, Youtube or HBO GO stream (negative influence), than he/she is probably between 14 and 18 years old.

Notice

This is a simple algorithm for finding missing values and it is not tested on real world data/applications. Do not use it in production before you double check if everything is working as assumed.

License

This project is licensed under the MIT License - see the LICENSE file for details.

References

[1] https://en.wikipedia.org/wiki/Case-based_reasoning

Popular Data Science Projects
Popular Machine Learning Projects
Popular Data Processing Categories
Related Searches

Get A Weekly Email With Trending Projects For These Categories
No Spam. Unsubscribe easily at any time.
Python
Machine Learning
Csv
Data Science
Pandas
Numpy