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
24 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 ...
-1
votes
0answers
38 views

Machine learning python MNIST dataset [closed]

I'm a noob to machine learning and i've been struggling with this for a few days now and I can't understand why my neural net is having trouble classifying the mnist dataset. I checked my math and ...
7
votes
0answers
132 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
58 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 ...
1
vote
0answers
33 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. ...
0
votes
0answers
53 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 ...
6
votes
1answer
101 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
42 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
30 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
47 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
48 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
39 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
64 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
43 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
46 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
58 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
335 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
1k 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
35 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 ...
0
votes
0answers
164 views

Reinforcement learning for Acrobot

I am interesting in reinforcement learning and trying to learn to solve issues with this approach. I chose Acrobot issue from OpenAI gym toolkit for my learning project. Here you can find description ...
2
votes
1answer
54 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
75 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
88 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
231 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
54 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
53 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 (...
1
vote
0answers
114 views

Chess Agent using reinforcement learning with monte carlo tree search

I wanted to ask if this project is valid to state on a resume for entry-level python developer and if the code is presentable to say a job interviewer. github link: full project (If this is not the ...
2
votes
1answer
55 views

User-Interactive Data Cleaning Program in Python

I'm trying to develop a program in Python that allows the user to import datasets and perform operations on them using pandas and numpy so she/he can skip writing all the preprocessing code her/...
0
votes
1answer
44 views

A simple clusterness measure of data in one dimension using Java

Problem definition Given \$X = (x_1, \dots, x_n)\$ such that \$x_1 \leq x_2 \leq \dots \leq x_n \$. Let \$x_{\min} = \min X = x_1\$, \$x_{\max} = \max X = x_n\$ and \$r = x_{\max} - x_{\min}\$. Also, ...
0
votes
1answer
427 views

Predicting credit card default

I have this code for predicting credit card default and it works perfectly, but I am checking here to see if anybody could make it more efficient or compact. It is pretty long though, but please bear ...
3
votes
0answers
400 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 ...
1
vote
0answers
82 views

Posterior collapses in an RNN variational auto-encoder - PyTorch

I am trying to implement and train an RNN variational auto-encoder as the one explained in "Generating Sentences from a Continuous Space". Although I apply their proposed techniques to mitigate ...
4
votes
1answer
58 views

Set of one-hot encoders in Python

In the absence of feature-complete and easy-to-use one-hot encoders in the Python ecosystem I've made a set of my own. This is intended to be a small library, so I want to make sure it's as clear and ...
1
vote
0answers
38 views

Custom Vector and Matrix classes in python for machine learning

I am creating a machine learning tool set from scratch in python. I have never done something of this kind and I don't usually use python but I thought it would be good to expand my horizons. I am ...
1
vote
0answers
182 views

Tensorflow model for predicting dice game decisions

For my first ML project I have modeled a dice game called Ten Thousand, or Farkle, depending on who you ask, as a vastly over-engineered solution to a computer player. You can find the complete game, ...
1
vote
0answers
56 views

Get stacked game state in NHWC format

After reading this, I decided to transition my DQN code from the keras library to tf.keras library (code is located in this repo) and my original code used NCHW format, as it was faster with GPUs. As ...
3
votes
0answers
808 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. ...
5
votes
1answer
281 views

Reinforcement Learning for Flappy Bird in JavaScript

To give a bit of a background, I'm organizing a small session about reinforcement-learning, specifically Q-learning, to a group of high school students in the ...
2
votes
0answers
125 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 ...
2
votes
0answers
349 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 ...
4
votes
1answer
2k views

k-means using numpy

This is k-means implementation using Python (numpy). I believe there is room for improvement when it comes to computing distances (given I'm using a list comprehension, maybe I could also pack it in a ...
2
votes
0answers
60 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 ...
3
votes
1answer
300 views

BipedalWalker-v2 one-step actor-critic agent trains slow

I'm trying to solve the OpenAI BipedalWalker-v2 by using a one-step actor-critic agent. I'm implementing the solution using python and tensorflow. My question is whether the code is slow because of ...
7
votes
1answer
81 views

Random Weighted Classifier in R

I am computing a random weighted classifier based on the rates at which 3 labels appear in a "train" set. I want to use this RWC as a baseline for other classifiers. I'm doing this over 1000 ...
6
votes
1answer
71 views

Simple neural network implementation in Python

A simple neural network I wrote in Python without libraries. I avoided implementing it in matrix form because I sought to get a basic understanding of the way NN's work first. For that reason I'm ...
3
votes
2answers
105 views

How to make my neural network train faster

I'm trying to train my neural network and for the most part it's going well. However, I'd like it if it could train faster and was wondering if anyone could give some advice. I'm trying mostly to ...
6
votes
1answer
152 views

Python class for organizing images for machine learning

I built a class to help me handle image data to use in machine learning. I thought that there would be a pre-existing package that did what I wanted but I couldn't find it so I wrote this. I am not ...
2
votes
1answer
46 views

Basic Single Header statistics and ml libray for C++ - Scikit-Learn like implementation

I am developing scikit-learn like implementation for C++ it is in the initial stage while developing I've started doubt myself that is this the correct implementation, since here accuracy is more ...
1
vote
0answers
108 views

Neural Network Backpropagation

My neural network is buggy somewhere. However, the reason I am posting here and not Stack Overflow is because a buggy neural network can still be trained to some degree and will compile/perform better ...