Skip to content

Commit

Permalink
Update to commit 66bcf33: Revised directory names, following the same…
Browse files Browse the repository at this point in the history
… convention (title/proper case, with a hyphen in between words)
  • Loading branch information
Anirban166 committed May 8, 2021
1 parent 66bcf33 commit 23a8659
Show file tree
Hide file tree
Showing 43 changed files with 81 additions and 81 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,49 +1,49 @@
# normalization & standardization
normalization<-function(x){
return((x-min(x))/(max(x)-min(x)))
}

standardization<-function(x){
return((x-mean(x))/sd(x))
}

head(iris)
# Sepal.Length Sepal.Width Petal.Length Petal.Width Species
# 1 5.1 3.5 1.4 0.2 setosa
# 2 4.9 3.0 1.4 0.2 setosa
# 3 4.7 3.2 1.3 0.2 setosa
# 4 4.6 3.1 1.5 0.2 setosa
# 5 5.0 3.6 1.4 0.2 setosa
# 6 5.4 3.9 1.7 0.4 setosa

iris<-iris[,-5]
head(iris)
# Sepal.Length Sepal.Width Petal.Length Petal.Width
# 1 5.1 3.5 1.4 0.2
# 2 4.9 3.0 1.4 0.2
# 3 4.7 3.2 1.3 0.2
# 4 4.6 3.1 1.5 0.2
# 5 5.0 3.6 1.4 0.2
# 6 5.4 3.9 1.7 0.4

#normalize
apply(as.matrix(iris),2,normalization)
# Sepal.Length Sepal.Width Petal.Length Petal.Width
# [1,] 0.22222222 0.62500000 0.06779661 0.04166667
# [2,] 0.16666667 0.41666667 0.06779661 0.04166667
# [3,] 0.11111111 0.50000000 0.05084746 0.04166667
# [4,] 0.08333333 0.45833333 0.08474576 0.04166667
# [5,] 0.19444444 0.66666667 0.06779661 0.04166667
# [6,] 0.30555556 0.79166667 0.11864407 0.12500000
# [7,] 0.08333333 0.58333333 0.06779661 0.08333333

#standardize
apply(as.matrix(iris),2,standardization)
# Sepal.Length Sepal.Width Petal.Length Petal.Width
# [1,] -0.89767388 1.01560199 -1.33575163 -1.3110521482
# [2,] -1.13920048 -0.13153881 -1.33575163 -1.3110521482
# [3,] -1.38072709 0.32731751 -1.39239929 -1.3110521482
# [4,] -1.50149039 0.09788935 -1.27910398 -1.3110521482
# [5,] -1.01843718 1.24503015 -1.33575163 -1.3110521482
# [6,] -0.53538397 1.93331463 -1.16580868 -1.0486667950
# normalization & standardization
normalization<-function(x){
return((x-min(x))/(max(x)-min(x)))
}

standardization<-function(x){
return((x-mean(x))/sd(x))
}

head(iris)
# Sepal.Length Sepal.Width Petal.Length Petal.Width Species
# 1 5.1 3.5 1.4 0.2 setosa
# 2 4.9 3.0 1.4 0.2 setosa
# 3 4.7 3.2 1.3 0.2 setosa
# 4 4.6 3.1 1.5 0.2 setosa
# 5 5.0 3.6 1.4 0.2 setosa
# 6 5.4 3.9 1.7 0.4 setosa

iris<-iris[,-5]
head(iris)
# Sepal.Length Sepal.Width Petal.Length Petal.Width
# 1 5.1 3.5 1.4 0.2
# 2 4.9 3.0 1.4 0.2
# 3 4.7 3.2 1.3 0.2
# 4 4.6 3.1 1.5 0.2
# 5 5.0 3.6 1.4 0.2
# 6 5.4 3.9 1.7 0.4

#normalize
apply(as.matrix(iris),2,normalization)
# Sepal.Length Sepal.Width Petal.Length Petal.Width
# [1,] 0.22222222 0.62500000 0.06779661 0.04166667
# [2,] 0.16666667 0.41666667 0.06779661 0.04166667
# [3,] 0.11111111 0.50000000 0.05084746 0.04166667
# [4,] 0.08333333 0.45833333 0.08474576 0.04166667
# [5,] 0.19444444 0.66666667 0.06779661 0.04166667
# [6,] 0.30555556 0.79166667 0.11864407 0.12500000
# [7,] 0.08333333 0.58333333 0.06779661 0.08333333

#standardize
apply(as.matrix(iris),2,standardization)
# Sepal.Length Sepal.Width Petal.Length Petal.Width
# [1,] -0.89767388 1.01560199 -1.33575163 -1.3110521482
# [2,] -1.13920048 -0.13153881 -1.33575163 -1.3110521482
# [3,] -1.38072709 0.32731751 -1.39239929 -1.3110521482
# [4,] -1.50149039 0.09788935 -1.27910398 -1.3110521482
# [5,] -1.01843718 1.24503015 -1.33575163 -1.3110521482
# [6,] -0.53538397 1.93331463 -1.16580868 -1.0486667950
# [7,] -1.50149039 0.78617383 -1.33575163 -1.1798594716
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
66 changes: 33 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ Here are some common algorithms that can be applied to almost all data problems:

### PREPROCESSING
- Feature projection
- [Dimensionality Reduction Algorithm](https://github.com/TheAlgorithms/R/blob/master/Preprocessing/dimensionality_reduction_algorithms.R)
- Data manipulattion
- [Data Processing](https://github.com/TheAlgorithms/R/blob/master/Preprocessing/data_processing.R)
- [Data normalization and standardization](https://github.com/TheAlgorithms/R/blob/master/Preprocessing/data_normalization_standardization.R)
- [Dimensionality Reduction Algorithm](https://github.com/TheAlgorithms/R/blob/master/Data-Preprocessing/dimensionality_reduction_algorithms.R)
- Data manipulation
- [Data Processing](https://github.com/TheAlgorithms/R/blob/master/Data-Preprocessing/data_processing.R)
- [Data normalization and standardization](https://github.com/TheAlgorithms/R/blob/master/Data-Preprocessing/data_normalization_standardization.R)
- Categorical variable into numerical
- [One Hot Encoding](https://github.com/TheAlgorithms/R/blob/master/Data-Manipulation/OneHotEncode.R)
- [Label Encoding](https://github.com/TheAlgorithms/R/blob/master/Data-Manipulation/LabelEncode.R)
Expand All @@ -30,44 +30,44 @@ Here are some common algorithms that can be applied to almost all data problems:

### SUPERVISED LEARNING
- Classification
- [Decision Tree](https://github.com/TheAlgorithms/R/blob/master/Classification/decision_tree.R)
- [Gradient Boosting Algorithm](https://github.com/TheAlgorithms/R/blob/master/Classification/gradient_boosting_algorithms.R)
- [KNN](https://github.com/TheAlgorithms/R/blob/master/Classification/KNN.R)
- [LightGBM](https://github.com/TheAlgorithms/R/blob/master/Classification/LightGBM.R)
- [Logistic Regression](https://github.com/TheAlgorithms/R/blob/master/Classification/logistic_regression.R)
- [Naive Bayes](https://github.com/TheAlgorithms/R/blob/master/Classification/naive_bayes.R)
- [Random Forest](https://github.com/TheAlgorithms/R/blob/master/Classification/random_forest.R)
- [SVM](https://github.com/TheAlgorithms/R/blob/master/Classification/SVM.R)
- [XGBoost](https://github.com/TheAlgorithms/R/blob/master/Classification/xgboost.R)
- [Lasso](https://github.com/TheAlgorithms/R/blob/master/Classification/lasso.R)
- [Decision Tree](https://github.com/TheAlgorithms/R/blob/master/Classification-Algorithms/decision_tree.R)
- [Gradient Boosting Algorithm](https://github.com/TheAlgorithms/R/blob/master/Classification-Algorithms/gradient_boosting_algorithms.R)
- [KNN](https://github.com/TheAlgorithms/R/blob/master/Classification-Algorithms/KNN.R)
- [LightGBM](https://github.com/TheAlgorithms/R/blob/master/Classification-Algorithms/LightGBM.R)
- [Logistic Regression](https://github.com/TheAlgorithms/R/blob/master/Classification-Algorithms/logistic_regression.R)
- [Naive Bayes](https://github.com/TheAlgorithms/R/blob/master/Classification-Algorithms/naive_bayes.R)
- [Random Forest](https://github.com/TheAlgorithms/R/blob/master/Classification-Algorithms/random_forest.R)
- [SVM](https://github.com/TheAlgorithms/R/blob/master/Classification-Algorithms/SVM.R)
- [XGBoost](https://github.com/TheAlgorithms/R/blob/master/Classification-Algorithms/xgboost.R)
- [Lasso](https://github.com/TheAlgorithms/R/blob/master/Classification-Algorithms/lasso.R)
- Regression
- [Gradient Boosting Algorithm](https://github.com/TheAlgorithms/R/blob/master/Regression/gradient_boosting_algorithms.R)
- [KNN](https://github.com/TheAlgorithms/R/blob/master/Regression/KNN.R)
- [LightGBM](https://github.com/TheAlgorithms/R/blob/master/Regression/LightGBM.R)
- [Linear Regression](https://github.com/TheAlgorithms/R/blob/master/Regression/linear_regression.R)
- [Artificial Neural Net](https://github.com/TheAlgorithms/R/blob/master/Regression/ANN.R)
- [Gradient Boosting Algorithm](https://github.com/TheAlgorithms/R/blob/master/Regression-Algorithms/gradient_boosting_algorithms.R)
- [KNN](https://github.com/TheAlgorithms/R/blob/master/Regression-Algorithms/KNN.R)
- [LightGBM](https://github.com/TheAlgorithms/R/blob/master/Regression-Algorithms/LightGBM.R)
- [Linear Regression](https://github.com/TheAlgorithms/R/blob/master/Regression-Algorithms/linear_regression.R)
- [Artificial Neural Net](https://github.com/TheAlgorithms/R/blob/master/Regression-Algorithms/ANN.R)

### UNSUPERVISED LEARNING
- Clustering
- [K-Means](https://github.com/TheAlgorithms/R/blob/master/Clustering/K-Means.R)
- [DbScan Clustering](https://github.com/TheAlgorithms/R/blob/master/Clustering/dbscan_clustering.R)
- [Heirarchical Clustering](https://github.com/TheAlgorithms/R/blob/master/Clustering/heirarchical_clustering.R)
- [K-Means Clustering](https://github.com/TheAlgorithms/R/blob/master/Clustering/kmeans_clustering.R)
- [K-Means](https://github.com/TheAlgorithms/R/blob/master/Clustering-Algorithms/K-Means.R)
- [DbScan Clustering](https://github.com/TheAlgorithms/R/blob/master/Clustering-Algorithms/dbscan_clustering.R)
- [Heirarchical Clustering](https://github.com/TheAlgorithms/R/blob/master/Clustering-Algorithms/heirarchical_clustering.R)
- [K-Means Clustering](https://github.com/TheAlgorithms/R/blob/master/Clustering-Algorithms/kmeans_clustering.R)

### SORTING
- [Bubble Sort](https://github.com/TheAlgorithms/R/blob/master/Sorting/Bubble%20sort.R)
- [Comb Sort](https://github.com/TheAlgorithms/R/blob/master/Sorting/Comb%20sort.R)
- [Insertion Sort](https://github.com/TheAlgorithms/R/blob/master/Sorting/Insertion%20sort.R)
- [Quick Sort](https://github.com/TheAlgorithms/R/blob/master/Sorting/Quick%20sort.R)
- [Selection Sort](https://github.com/TheAlgorithms/R/blob/master/Sorting/Selection%20sort.R)
- [Stooge Sort](https://github.com/TheAlgorithms/R/blob/master/Sorting/Stooge%20sort.R)
- [Merge Sort](https://github.com/TheAlgorithms/R/blob/master/Sorting/Merge%20sort.R)
- [Radix Sort](https://github.com/TheAlgorithms/R/blob/master/Sorting/Radix%20sort.R)
- [Heap Sort](https://github.com/TheAlgorithms/R/blob/master/Sorting/Heap%20sort.R)
- [Bubble Sort](https://github.com/TheAlgorithms/R/blob/master/Sorting-Algorithms/Bubble%20sort.R)
- [Comb Sort](https://github.com/TheAlgorithms/R/blob/master/Sorting-Algorithms/Comb%20sort.R)
- [Insertion Sort](https://github.com/TheAlgorithms/R/blob/master/Sorting-Algorithms/Insertion%20sort.R)
- [Quick Sort](https://github.com/TheAlgorithms/R/blob/master/Sorting-Algorithms/Quick%20sort.R)
- [Selection Sort](https://github.com/TheAlgorithms/R/blob/master/Sorting-Algorithms/Selection%20sort.R)
- [Stooge Sort](https://github.com/TheAlgorithms/R/blob/master/Sorting-Algorithms/Stooge%20sort.R)
- [Merge Sort](https://github.com/TheAlgorithms/R/blob/master/Sorting-Algorithms/Merge%20sort.R)
- [Radix Sort](https://github.com/TheAlgorithms/R/blob/master/Sorting-Algorithms/Radix%20sort.R)
- [Heap Sort](https://github.com/TheAlgorithms/R/blob/master/Sorting-Algorithms/Heap%20sort.R)

## Contribution Guidelines
Please ensure to follow the points stated below if you would like to contribute:
- If your proposing a new algorithm or making changes to an existing one, make sure your code works. Reviewers or the general user must be able to directly emplace it in an R environment and get the desired output.
- Add an example to showcase the use of an algorithm proposed. It can be commented.
- Follow proper naming convention for variables (use `.` or `_` to seperate terms, such as `results.df` for a data frame containing some results) and filenames (follow the convention that has been followed for files under the directory your committing to).
- Feel free to add links here to the newly added file(s), but ensure that they do not result in a merge conflict with different versions of this readme under previous pull requests.
- Feel free to add links here to the newly added file(s), but ensure that they do not result in a merge conflict with different versions of this readme under previous pull requests.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 23a8659

Please sign in to comment.