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
1
vote
0answers
37 views

Looping over files to create a dataframe

As part of my NLP project at work, I want to loop over all files that are either PDF of docx in the same directory. The end purpose is to create a dataframe with text content of the files in one ...
2
votes
0answers
29 views

Optimize binary classification model

I've created binary classification model from scratch, just to understand intuition behind that. However when I compare my implementation to model from tensorflow/pytorch with the same parameters and ...
1
vote
0answers
12 views

Industrial Practices for Time-Series Forecasting

Hi I have wrote a code here for predicting temperature across months. This is the dataset that I was using: https://www.kaggle.com/sumanthvrao/daily-climate-time-series-data I have used a SARIMA model ...
0
votes
0answers
19 views

Convert JPG to H5 and plot the images

I'm learning ML/DL and found the process of getting the data and labels quite tedious. There is not much details on how to get JPG files into H5, which is (afaik) the only way to work smoothly later ...
2
votes
1answer
42 views

Calculation of the Distance Matrix in the K-Means Algorithm in MATLAB

Purpose of the code : To assign the corresponding label of the centroids to the points which are close to it. Below is a graphical (2D) example. Variable X is a matrix, rows represent the points, ...
2
votes
0answers
17 views

Transfer learning CNNs for image classification in TensorFlow

This code works, and I'm pretty sure it's mathematically/algorithmically correct: ...
2
votes
0answers
15 views

Implementation of Policy Gradient Reward Design paper

I've implemented the first experiment from the Reward Design via Online Gradient Ascent paper. I don't have any specific concerns, but it's my first time using multiprocessing or doing reinforcement ...
3
votes
0answers
97 views

Playing pong (atari game) using a DQN agent

I trained a DQN agent using tensorflow and OpenAI gym Atari environment called PongNoFrameskip-v4, but this code should be compatible with any ...
4
votes
0answers
68 views

Using VAE for reconstructing images

Article: https://arxiv.org/pdf/2009.07047v1.pdf Full Code: https://colab.research.google.com/drive/1KZZuIa7Lk13ImZLJ3b-kxMfcveOPaWvN#scrollTo=XhdMfBFtzaEH Dataset: https://drive.google.com/file/d/...
1
vote
0answers
67 views

Implementing Convolutional Neural Network

Context I was making a Convolutional Neural Network from scratch in Python. I completed making it .... It works fine ... The only thing is that it takes a lot of time as the size of the input grows. ...
4
votes
2answers
88 views

C++ performance: Linear regression in other way

Here is the code that can be used for calculation of mathematical function, like ax^2 + bx + c. It is fast enough if you choose small length, otherwise if ...
1
vote
0answers
47 views

How to handle overfitting in Random Forest

I have a random forest model I built to predict if NFL teams will score more combined points than the line Vegas has set. The features I use are Total - the total ...
2
votes
0answers
23 views

Data Visualization (rendering env)

How can I improve this code? It renders a ML env with openAI gym and matplotlib. I am new to coding so not sure if my variables or format or any lines can be improved. ...
1
vote
0answers
32 views

How to speed up this numba based decision tree?

In order to improve the performance of this code fragment, I have speeded up some code fragments by using the numba. However, a frustrating thing is that the performance of this decision tree is bad. ...
10
votes
2answers
251 views

Convert an English sentence to German using Bahdanau Attention

Context I am following this tutorial . My mission is to convert an English sentence to a German sentence using Bahdanau Attention. Summary of the Code I first took the whole English and German ...
2
votes
1answer
93 views

A Tiny Nearest Neighbor Classification Implementation in C#

I am practicing to implement the KNN classification tool in C#. The basic point structure is constructed by the class Point, and there are two members in ...
4
votes
0answers
128 views

A Very Simple Support Vector Machine with SMO Algorithm Implementation

Context. I was looking for some simple implementation of SVM with the SMO algorithm that can be used as an in-class problem together with a simple mathematical explanation of how it works. The problem ...
10
votes
1answer
253 views

K-means function in Python

I have written a k-means function in Python to understand the methodology. I am trying to use this on a more complex dataset with a larger value for k, but it is running super slow. Does anyone have ...
1
vote
0answers
25 views

Machine Learning Implementation when dealing with high variance data

I'm am trying to classify MLB (Baseball) games whose score go over the total based on the total and the number of people who have bet the over. The total is a number set by Vegas and a bettor can ...
1
vote
0answers
50 views

A program that performs logistic regression based on Iris dataset

I am a newcomer in Machine Learning and I have wrote a simple program for logistic regression based on Iris dataset. I would like for experts to tell me about its drawbacks and bugs, and if it can be ...
6
votes
1answer
673 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
61 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
166 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 ...
4
votes
1answer
99 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
110 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
50 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
110 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
175 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
248 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
51 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
35 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
23 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
37 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
54 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
22 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
31 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
38 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
159 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
40 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
162 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
59 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
70 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
77 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
83 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
149 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
238 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
850 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
78 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 ...

1
2 3 4 5