gravatar

saairam02

Saairam S

Recently Published

MACHINE LEARNING ASSIGNMENT
The R code implements an image classification pipeline that includes data loading, exploratory analysis, logistic regression, clustering, and neural network modeling. It begins by loading images from a directory, resizing them, and organizing the data into a structured format. The dataset is explored using summary statistics. A multinomial logistic regression model is fitted after applying PCA for dimensionality reduction. Clustering techniques, including hierarchical clustering and K-means, are used to assess data groupings. Finally, a neural network model is developed to predict classes based on varying hidden layer sizes, and accuracy metrics are computed to evaluate model performance.
NEURAL NETWORK
This R code demonstrates the creation and training of a simple neural network using synthetic data. It begins by setting up the environment and installing necessary libraries, including neuralnet, tidyverse, and GGally. Random training data is generated with two input features and an output representing the square root of the sum of the squares of the inputs. A neural network with one hidden layer of three neurons is defined and trained on this data. The training results are printed, and the structure of the trained neural network is visualized, showcasing foundational concepts in neural network modeling.
HABERMAN SURVIVAL DATASET
The RMarkdown file is well-structured and includes comprehensive sections on loading the dataset, logistic regression, clustering, and neural networks. Here’s the summary : Library Installation and Loading: Installed and loaded essential R packages for image processing (imager, EBImage), data manipulation (dplyr, tidyverse), and modeling (caret, nnet). Dataset Preparation: Loaded images from a specified directory, resizing them for uniformity. Created a data frame containing the labels (derived from folder names) and the resized image data. Exploratory Data Analysis: Analyzed the dataset's structure, dimensions, and class distributions to understand the data better. Logistic Regression: Flattened the image data and performed normalization. Applied PCA for dimensionality reduction, retaining components that explain 95% of the variance. Split the dataset into training and testing sets, trained a multinomial logistic regression model, and evaluated its performance using accuracy and a confusion matrix. Clustering: Assessed the clusterability of the data with the Hopkins statistic. Conducted hierarchical clustering and visualized the results using a dendrogram. Implemented K-means clustering and visualized clusters based on the first two PCA components. Neural Networks: Defined a function to fit a neural network model and calculate accuracy. Evaluated models with varying hidden neuron sizes to determine the best configuration.