Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [machine-learning]

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

87 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
6 votes
0 answers
7k views

Simple Neural Network in C

A neural network is a structure of connections and nodes that takes input and generates an output. It can be "taught"(adjusting weights and biases of connections) from a teacher data set ...
J. H's user avatar
  • 189
5 votes
0 answers
70 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 ...
Austin Johnson's user avatar
5 votes
0 answers
160 views

Deep learning CNN for image recognition using tensor flow

This algorithm is a convolutional deep neural network used for image recognition. I used the MNIST data set, which is a bunch of images from 0 to 9. As of right now, I have trained this image with ...
Ben Nicholl's user avatar
5 votes
0 answers
204 views

Code for training machine learning linear regression and SVM

Ok , for my final year project I've wrote this piece of code to train my machine learning model on a this dataset , here the code i used ...
Espoir Murhabazi's user avatar
5 votes
0 answers
128 views

Stacking and folding machine-learning algorithm

I am trying to use the code of this guy. Written in 2013 but it is a bit obsolete on some points. Basically, the idea is to create folders from 1 dataset to train several models independently on the ...
Mayeul sgc's user avatar
5 votes
0 answers
715 views

RandomForest multi-class classification

Below is the code I have for a RandomForest multiclass-classification model. I am reading from a CSV file and doing various transformations as seen in the code. I ...
Huga's user avatar
  • 153
4 votes
0 answers
100 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/...
Robert's user avatar
  • 41
4 votes
0 answers
659 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 ...
guest's user avatar
  • 141
4 votes
0 answers
279 views

Linear Regression in Tensorflow

I am a machine learning newbie and recently I implemented (or at least tried to implement) a linear regression model in tensorflow. I would love to know how I can improve my code: ...
whs's user avatar
  • 41
4 votes
0 answers
4k views

Calculate relationship between 2 categorical variables in a pandas Dataset with chi square test

I'm working on a Machine Learning project and I'm in Data Exploration step, and my dataset has both categorical and continuous attributes. I decided to compute a chi square test between 2 categorical ...
Espoir Murhabazi's user avatar
4 votes
0 answers
66 views

sk-learn like model

I am trying to make a simple model that returns the conditional expectation of a target with respect to the value observed for another variable. Basically, given a feature \$F\$, a level of this ...
RUser4512's user avatar
  • 1,033
4 votes
0 answers
1k views

Logistic regression with eigen

I am a new to Eigen, and I implemented a logistic regression model with it. It works but I don't know whether it is implemented in an efficient way. ...
Jason's user avatar
  • 41
3 votes
0 answers
173 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 ...
poima's user avatar
  • 31
3 votes
0 answers
202 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 ...
neel g's user avatar
  • 151
3 votes
0 answers
482 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 ...
Demeter Márton's user avatar
3 votes
0 answers
136 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 ...
Javier Lopez Tomas's user avatar
3 votes
0 answers
1k views

A simple toy ResNet model and its implementation

I want to understand how resnet works also called us residual networks and I understand it better when I code one myself. I tried to find a simple implementation of resnet in the web but most I found ...
Eka's user avatar
  • 349
3 votes
0 answers
2k views

Auto classification of my bank transactions

This is my first Machine Learning algorithm using Python and SkLearn. The code works, which is pretty awesome. I'm getting about 65-70% of accuracy after training it with about 4k rows of data. ...
lowercase00's user avatar
3 votes
0 answers
391 views

Tic Tac Toe engine in Python for Deep Learning

I'm implementing a Tic Tac Toe engine that will work with deep learning. I'm using a 3x3 numpy array of floats to represent the board. +1.0 represents an X, ...
Jonathan Dayton's user avatar
3 votes
0 answers
383 views

PCA, LDA and Logistic Regression

Based on the great blog by Joel Grus, I implemented LogisticRegression, PCA, and LDA. I'd appreciate feedback as I'm not sure that the logistic classifier is good enough (as it supposed to achieve ...
oba2311's user avatar
  • 197
3 votes
0 answers
4k views

Code for Training a Handwriting Recognition Model

I just made my machine learning code work a few days ago and I would like to know if there's a way to improve my code. Before I get to the implementation of the tasks at hand, I would like to ...
Rocket Pingu's user avatar
3 votes
0 answers
280 views

Weighted logistic regression in Julia

I'm trying to estimate a weighted logistic regression as part of a bigger project. I have an implementation in Matlab2015b, but I wanted to give Julia a try to see if I could speed up the estimation ...
jvz's user avatar
  • 131
3 votes
0 answers
84 views

Sklearn: Regularized ridge regression for predicting fantasy football performance from several sources' projections

I've been working on trying to predict fantasy performance of players in this upcoming NFL season based on projections from several experts/sources. I trained the data on projections from last year ...
Eric Brenner's user avatar
3 votes
0 answers
761 views

Sklearn custom transformer (label encoder and imputer)

I have a pandas.Dataframe with a single (new) record and the following function: ...
Georg Heiler's user avatar
3 votes
0 answers
78 views

Time calculation for NLTK tagging

I am trying to calculate the time required to tag one sentence/file by one trained NLTK HMM Tagger. To do this I am writing the following code, please suggest if I need to revise anything here. ...
Richard Parker's user avatar
3 votes
0 answers
98 views

Classifying test data into several classes

The following code is to classify the test data into several classes: ...
user avatar
3 votes
0 answers
273 views

Naive implementation of Naive Bayes in Haskell

A simple implementation of Naive Bayes, as I'm a Haskell beginner I've tried to put an emphasis on clarity and documentation. I've tried to incorporate the feedback from a similar question. This is ...
dimid's user avatar
  • 303
2 votes
0 answers
83 views

neural network that determines the gender of a word

I wrote a neural network in python using pytorch, which determines the gender of a word in Russian. As a training set: a file containing a word and a number from 0 to 2 (0-masculine,1- feminine and 2-...
Андрей С.'s user avatar
2 votes
0 answers
72 views

CodeReview: CycleGAN Implementation Using Keras FunctionalAPI

Okay So I Am Here Implementing the cyclegan architecture with using keras api from scratch. For Those who Wanna Know More About Cyclegan seehere The CycleGan Compose of Two Phase Architecture Like ...
CallMeAaishaa's user avatar
2 votes
0 answers
127 views

Logistic Regression for Fashion MNIST T-shirt vs. Shirt

I wrote a Logistic Regression for Fashion MNIST to classify T-shirt vs. Shirt. here is the class ...
AlbertJ's user avatar
  • 199
2 votes
0 answers
66 views

xagents - implementations of reinforcement learning algorithms

Description It is valid to say, this work started and evolved from a standalone DQN implementation, which I included in an old question, to a mini-library xagents, housing 7 re-usable tensorflow-based ...
watch-this's user avatar
2 votes
0 answers
55 views

DQN implementation

I just wrote my pong DQN. It seems to work. I'm looking for a performance based review on anything that might slow down the training in complex models. main.py: ...
Machine Learning Diary's user avatar
2 votes
0 answers
49 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 ...
Sam.H's user avatar
  • 143
2 votes
0 answers
46 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 ...
mikolaj semeniuk's user avatar
2 votes
0 answers
24 views

Transfer learning CNNs for image classification in TensorFlow

This code works, and I'm pretty sure it's mathematically/algorithmically correct: ...
A T's user avatar
  • 485
2 votes
0 answers
22 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 ...
seed's user avatar
  • 121
2 votes
0 answers
1k 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 ...
watch-this's user avatar
2 votes
0 answers
38 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: ...
stuckstat's user avatar
  • 129
2 votes
0 answers
56 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 ...
andy's user avatar
  • 61
2 votes
0 answers
112 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. ...
neel g's user avatar
  • 151
2 votes
0 answers
39 views

One Class SVM algorithm taking too long

The data bellow shows part of my dataset, that is used to detect anomalies ...
ebe's user avatar
  • 241
2 votes
0 answers
50 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 ...
masotann's user avatar
  • 121
2 votes
0 answers
64 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. ...
Revolucion for Monica's user avatar
2 votes
0 answers
112 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 ...
watch-this's user avatar
2 votes
0 answers
139 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? ...
Marzi Heidari's user avatar
2 votes
0 answers
113 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 ...
Rafiul Nakib's user avatar
2 votes
0 answers
276 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 ...
Milan's user avatar
  • 121
2 votes
0 answers
200 views

Simple Neural Network from scratch using NumPy (Python)

I added learning rate and momentum to a neural network implementation from scratch I found at: https://towardsdatascience.com/how-to-build-your-own-neural-network-from-scratch-in-python-68998a08e4f6 ...
Seb Squire's user avatar
2 votes
0 answers
578 views

Principal Component Analysis in Tensorflow

To learn the low-level API of Tensorflow I am trying to implement some traditional machine learning algorithms. The following Python script implements Principal Component Analysis using gradient ...
MB-F's user avatar
  • 173
2 votes
0 answers
71 views

Simple linear regression of two variables

This is the code I built to implement a simple linear regression to check the impact of variable A on B. I am not interested in predicting that's why the statistical approach is important for me to ...
AhmAch's user avatar
  • 21