Questions tagged [machine-learning]

Machine learning provides computer algorithms that automatically discover patterns in data and make intelligent decisions from them.

Filter by
Sorted by
Tagged with
6
votes
1answer
385 views

Simple neural network in c++

I have implemented a neural network in C++. But I'm not sure whether my implementation is correct or not. My code of the implementation of neural networks given bellow. As an inexperienced programmer, ...
5
votes
0answers
55 views

Machine Learning Implementation

I am new to ML and I wanted to implement a Linear Regression to predict a golfer's scores based on certain feature supplied to my model. I would like a review to see if I'm implementing this correctly ...
2
votes
1answer
152 views

Smart Tic Tac Toe, a reinforcement learning approach

I'm currently familiarizing myself with reinforcement learning (RL). For convenience, instead of manually entering coordinates in the terminal, I created a very simple UI for testing trained agents ...
3
votes
1answer
73 views

C++: k-Nearest Neighbours with Lambdas and Priority Queues

I implemented getting the \$k\$-nearest neighbours of an origin point to a set of points in C++17. I tried to use some more modern C++ lambda techniques and was looking for feedback on use of lambdas, ...
5
votes
1answer
78 views

C++ - Logistic Regression Backpropagation with Gradient Descent

I implemented binary logistic regression for a single datapoint trained with the backpropagation algorithm to calculate derivatives for a gradient descent optimizer. I am primarily looking for ...
3
votes
0answers
47 views

Nvidia Energy Consumption Watcher

The idea was to write a context manager that would calculate energy consumption for the given machine learning pipeline running on a GPU. It does it by polling the current power consumption using the ...
5
votes
1answer
63 views

Yolov3 Real Time Object Detection in tensorflow 2.2

Note As there are a lot of related modules in the project, I recently posted several similar posts(because all content cannot fit due to character limit) and someone indicated that this might be ...
0
votes
0answers
26 views

VGG-16 encoder - decoder implementation

I've just started with Python and Tensorflow and I wondering if you can check my VGG-16 encoder - decoder implementation. I'm using Python 3.7.7 and Tensorflow 2.1.0. ...
5
votes
2answers
132 views

Polynomial regression with Gradient Descent: Python

Just for the sake of practice, I've decided to write a code for polynomial regression with Gradient Descent Code: ...
3
votes
0answers
37 views

Doing image compression with Neural Network AutoEncoders

I wanted to create an image compressor using Machine Learning and started work on an "AutoEncoder". This is a type of Neural Network which takes in the image and creates a compressed vector form. It ...
1
vote
1answer
34 views

Tensorflow Python ML to Detect Emotion [closed]

I've created an application to predict emotions. But I think the application is being over fitted. And I cannot figure out how to solve the overfitting. I'm using a small data set of 107 images spread ...
2
votes
0answers
19 views

Implementation of calculation of gamma for RBF SVM

I have implemented the calculation of gamma value for RBF SVM as described in Liu et al (2012) [https://ieeexplore.ieee.org/abstract/document/6246300]. Here's a snapshot of the example from the paper: ...
2
votes
0answers
34 views

simple neural network in python

I've spent the last few days learning the beginnings of how to implement a simple neural network. I've gone through chapters 1 and 2 of this book and have tried to write my own NN with referrals to ...
2
votes
0answers
47 views

ML text generating code with Python and Tensorflow

I wanted a simple code review for improvement to increase the efficiency of my text generating model. This model is taken from the official TensorFlow site but is being trained on different datasets. ...
3
votes
1answer
29 views

Creating generator object with image augmentation to train Convolutional Neural Networks with Keras

I am currently self-studying on Python generator object and use it to generate training data and do augmentation on-the-fly, then feed it into Convolutional Neural Networks. Could anyone please help ...
2
votes
0answers
21 views

One Class SVM algorithm taking too long

The data bellow shows part of my dataset, that is used to detect anomalies ...
2
votes
0answers
30 views

Sklearn Custom Imputer from prediction

I asked this question on Stackoverflow, but thought it might be a better fit here. I'm playing around with the titanic dataset, and wanted to create a custom imputer to fill in missing ...
2
votes
0answers
35 views

Get most similar element in an array of string with another string

I have a code to get most similar element in an array of categories of jobs to another job using Google's Universal Sentence Encoder. ...
3
votes
0answers
77 views

PPE object detection with tensorflow and opencv with rtsp streams

I am working on an object detection API implemented in Tensorflow 1.14 and OpenCV 4.1, where my task is to recognize personal protection equipment (PPE) worn by workers at various construction site ...
2
votes
1answer
39 views

Re-write custom feature encoding function python

I have a question regarding code quality and best practices. My task - to write a feature encoding function that will encode categorical labels, boolean labels as one-hot encoding, timestamps for ...
3
votes
1answer
131 views

Implementation of K-means

I have recently built a class that is an implementation of kMeans from scratch. I believe there is room for improvement and I would happily receive some feedback. The project can be found at: https://...
2
votes
1answer
56 views

Forecasting stock market data using Support Vector Regression

I coded this Support Vector Regression (SVR) myself following some equations in a journal (see here, or here (not in English)). The loss function used by the journal and the code below is mean ...
0
votes
0answers
22 views

Sequential learning function running slowly

I'm new to Python and made this Sequential Learning function but it runs slowly. Do you know why this runs slowly and how to improve it? ...
3
votes
1answer
66 views

Estimation of min_samples for DBSCAN

I'm attempting to speed up some python code that is supposed to automatically pick the minimum samples argument in DBSCAN. Currently the execution time grows exponentially as the number of training ...
3
votes
1answer
68 views

Slow python code that automatically selects k for KNNG

This code is used to select K for a K-nearest neighbor graph [KNNG] from a dataset with an unknown number of centroids (which is not the same as K-means clustering). Suppose that you have a dataset ...
2
votes
0answers
79 views

Multi-threaded HD Image classifier using a neural network

This is a follow up to the code found here: Multithreaded HD Image Processing + Logistic reg. Classifier + Visualization Description: This code takes a label and a folder path of subfolders as ...
7
votes
0answers
146 views

Multithreaded HD Image Processing + Logistic reg. Classifier + Visualization

[I'm awaiting suggestions for improvement/optimization/more speed/general feedback ...] This code takes a label and a folder path of subfolders as input that have certain labels ex: trees, cats with ...
3
votes
1answer
127 views

Gradient Descent Algorithm using Pandas + GIF Visualization

Happy new year everyone, Following Andrew NG's course on coursera here's my implementation for the gradient descent algorithm(univariate linear regression) in Python using pandas, matplotlib with ...
2
votes
1answer
460 views

Keras stacked LSTM model for multiclass classification

I am working on a multiple classification problem and after dabbling with multiple neural network architectures, I settled for a stacked LSTM structure as it yields the best accuracy for my use-case. ...
2
votes
1answer
71 views

Java Neural Network Implementation

I have recently tried to get a better grip on machine learning from a point of implementation - not statistics. I've read several explanations of an implementation of a Neural Network via pseudocode ...
7
votes
1answer
300 views

Portfolio optimization using genetic algorithm

I'm working on a (naïve) algorithm for portfolio optimization using GA. It takes a list of stocks, calculates its expected returns and the covariance between all of them and then it returns the ...
2
votes
1answer
48 views

Optimizing a TFxIDF vectorization - Python 3.x [closed]

I am attempting to train many classifiers to test their performance with classifying tweets as being from a political bot, or not (a binary 0 or 1 classifier). My ...
1
vote
0answers
78 views

Homemade web-scraper that feeds perceptron with hidden layer [closed]

I’d like to start by apologising for the mess that is my code. I know that it’s really hard to parse, inefficient, and probably not idiomatic. I just don’t know how to fix it which is why I'm here. ...
-1
votes
1answer
41 views

How to write a multivariate multi-step forecasting from a multivariate single step [closed]

I'm trying to implement a multi-variate, multiple-step model to forecast the day ahead electricity prices (h+1,h+2,...,h+24). I know how to do one forecast, but I'm confused with how to implement a ...
2
votes
1answer
51 views

K_nearest_neighbors from scratch [closed]

I wanted to create a script that will perform the k_nearest_neighbors algorithm on the well-known iris dataset. This was mainly for me to better understand the algorithm and process. I think it works, ...
1
vote
0answers
63 views

condensed nearest centroid classifier in numpy

This is my attempt to write a numpy-optimized version of a nearest centroid classifier to classify some images from the MNIST data set of handwritten digits. I am ...
1
vote
0answers
68 views

Recommender system accuracy testing using GridSearchCV [closed]

I'm trying to improve my Alternating Least Squares (ALS) model performance by testing using different model parameters, but the model performance is seemingly very low. Since the Alternating Least ...
1
vote
0answers
74 views

Neural network from scratch in Python

So after watching week 5 of the machine learning course on Coursera by Andrew Ng, I decided to write a simple neural net from scratch using Python. Here's my code: ...
1
vote
0answers
68 views

Stochastic gradient descent - backpropagation over mini-batches in one go

I have been working through a tutorial on neural networks. I have then been translating the code to java, to help improve my understanding of what the code is doing. The book mentions a way of ...
-1
votes
1answer
63 views

Python ANN Implementation [closed]

I recently learned about backpropagation online and tried to implement it. I am not sure I have it correct yet. I am confused and would love a second pair of eyes on this code. Please help me ...
2
votes
0answers
69 views

GRU-Autoencoder training

I'm training a GRU auto-encoder and my current code is very slow.I believe it's predict_captions function that takes most the time. Any suggestion to optimize this code? ...
2
votes
1answer
757 views

Simple Genetic Algorithm in Python

For past few months I was trying to understand genetic algorithms (GA) and most of the materials availble in the web was not always easy for me. Then I came across this article written by Ahmed Gad ...
1
vote
2answers
3k views

Simple Linear Regression in C++

Python has amazing sci-kit learn library but I am building some projects on C++ with involves some machine learning algorithms. I found machine learning libraries in C++ involves more dependencies so ...
3
votes
0answers
71 views

Automated machine learning training and evaluation in Sagemaker with XGBoost

This code aims to make very easy to train new models in SageMaker and quickly decide whether a new feature should be introduced in our model or not, getting metrics (recall, accuracy and so on) for a ...
2
votes
1answer
64 views

Manual Regression Tree using Python

I wrote a code to create a regression tree for a synthetic train data of size Np. The idea is, first I have the source node (which consists of all set of points) ...
2
votes
0answers
84 views

Machine learning, kNN and Naïve Bayes algorithm

This is the task I am working on: In this assignment you will implement the K-Nearest Neighbour and Naïve Bayes algorithms and evaluate them on a real dataset using the stratified cross validation ...
2
votes
0answers
119 views

Plant pest detection using CNN

I am doing a project in plant pest detection using CNN. There are four classes each having about 1400 images. While training the model using Convolution Neural Network, there is a smooth curve for ...
4
votes
1answer
370 views

Simple decision tree in Haskell

I've been trying to get better at Haskell for a while, and have recently been working on a lot of small projects with it. This constructs a binary decision tree. The command to run it is: ...
1
vote
0answers
69 views

Modified and created a new python class for generating a report of metrics for machine learning

I initially posted a question on SO. I have come up with an answer for the same. Basically, given two dicts of models and parameters, user can create an object, and get the report in 5 steps. ...
5
votes
1answer
76 views

Simple SVM in MATLAB

I'm studying SVMs and wrote a demo in MATLAB (because I couldn't get a quadratic programming package to work correctly in Python). Right now it's simple and can only do linearly-separable cases (...