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

learn more… | top users | synonyms

5
votes
1answer
75 views

Random forest and machine learning

I am quite new to using python for machine learning. I come from a background of programming in Fortran, so as you may imagine, python is quite a leap. I work in chemistry and have become involved in ...
7
votes
1answer
57 views

A CNN in Python WITHOUT frameworks

Here's some code that I've written for implementing a Convolutional Neural Network for recognising handwritten digits from the MNIST dataset over the last two days (after a lot of research into ...
1
vote
1answer
162 views

Pattern recognition and machine learning - Bernoulli mixture model

I have been reading the book Pattern Recognition and Machine Learning (Bishop) for a while, and recently I came across this figure, which was created using Bernoulli mixture model on the MNIST dataset:...
3
votes
1answer
51 views

Different neural network activation functions and gradient descent

I've implemented a bunch of activation functions for neural networks, and I just want have validation that they work correctly mathematically. I implemented sigmoid, tanh, relu, arctan, step function, ...
1
vote
0answers
31 views

Self organizing maps

I have already asked similar question here, but I figured this place might be better on getting some actual implementation feedback. I tried to implement a simple SOM. You can see the training ...
5
votes
1answer
120 views

k-means clustering algorithm implementation

Here is my personal implementation of the clustering k-means algorithm. ...
4
votes
1answer
56 views

Classification tree in Swift

As an effort to teach myself Swift as well as to get familiar with machine learning algorithms, I've been trying to implement common algorithms, starting with a Random Forest. This is, for the moment ...
11
votes
1answer
245 views

Make a summary from a larger text-file

This code makes summaries from larger texts. I have searched around for an algorithm and found the following: Associate words with their grammatical counterparts. (e.g. "city" and "cities") ...
2
votes
1answer
53 views

Nested loops - Random Forest, multiple parameters

I'm writing a code which task is to grow Random Forest trees based on multiple parameters. In short: Firstly, I declare a data frame in which model parameters and some stats will be saved. Secondly, ...
0
votes
1answer
94 views

csv loader and kNN algorithm in Java

I have applied the KNN algorithm for classifying handwritten digits. the digits are in vector format initially 8*8, and stretched to form a vector 1*64.. As it stands my code applies the kNN ...
1
vote
1answer
52 views

SKlearn automate data pre treatment

I want to make a simple wrapper for sklearn models. The idea is that the wrapper automatically takes care of factors (columns of type "object") replacing them with ...
1
vote
1answer
56 views

ImprSimple chat bot written in python

I'd like to know if I can improve the performance of my recent bot, and maybe some design patterns too. So far, it's warning a user if it's using some bad words (which are parsed from ...
0
votes
0answers
37 views

Naive-Bayes classifier, to be packaged in a function

I need to create a Naive-Bayes classifier. I have eight labels (S) stored in tumors object, and 20531 attributes (A), I have stored the P(S,A) in objects of name <...
4
votes
2answers
194 views

Tic-Tac-Toe machine learning

I recently started getting into machine learning and I wanted to write a "beginner program" which would learn to play Tic Tac Toe. This code was inspired by a different program I saw, meaning some ...
1
vote
0answers
79 views

Increase performance of Spark-job Collaborative Recommendation.

This is my first Spark Application. I am using "ALS.train" for training the model - Model Factorization. The total time that the Application takes is approx 45 mins. Note: I think takeOrdered is the ...
1
vote
0answers
67 views

Predicting a win/loss given prior game stats

The project: create a model that can (somewhat) accurately predict a win/loss given prior game stats. Wanted a review of code in general, in particular my use of the ...
4
votes
0answers
110 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 ...
3
votes
0answers
79 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. ...
0
votes
0answers
46 views

Perceptron with 2 output neurons and binary input

To the best of my knowledge I've implemented a functional version of the perceptron algorithm, but as my knowledge is not so developed as of yet I'm wondering if I've done it correctly or not. What ...
2
votes
1answer
232 views

Cross validation of gradient boosting machines

I am fairly new to Python. I implemented a short cross-validation tool for gradient boosting methods. ...
6
votes
1answer
320 views

Calculate conditional probabilities and perform naive Bayes classification on a given data set

I wrote a class that I'm using to calculate conditional probabilities of a given distribution as well as perform naive Bayes classification. I'd like to get a code review done to tell me if there is ...
3
votes
1answer
145 views

File-write operations

Below is the code for user recommendations using mahout. ...
1
vote
1answer
101 views

Latent Dirichlet Allocation in Python

I've recently finished writing a "simple-as-possible" LDA code in Python. The theory from which I've developed my code can be found in the book Computer Vision by Simon Prince, free (courtesy of ...
3
votes
1answer
3k views

ID3 Decision Tree in python

I've been working my way through Pedro Domingos' machine learning course videos (although the course is not currently active). His first homework assignment starts with coding up a decision tree (ID3)....
3
votes
2answers
42 views

Asynchronous model fitting that allows termination in Python

The problem When you work with Python interactively (e.g. in an IPython shell or notebook) and run a computationally intensive operation like fitting a machine-learning model that is implemented in a ...
4
votes
1answer
77 views

Random Forest Code Optimization

I am new to Python. I have built a model with randomforest in python. But I think my code is not optimized. Please look into my code and suggest if I have deviated from best practices. Overview about ...
2
votes
2answers
48 views

ML Retraining project

Tear me to shreds. The class RandomForestRetrainer will be used to retrain a machine learning algorithm. It has functionality for taking in a directory containing malware or benignware files and ...
2
votes
1answer
51 views

Randomly learning a neuron to act as a signal counter

I have this small program for learning an artificial neuron to act as a simple signal counter: my cell has four input wires (also called dendrites) and a single output wire (also called axon). If at ...
3
votes
1answer
64 views

Batch Gradient Descent running too slowly

Following Data Science from Scratch by Joel Grus, I wrote a simple batch gradient descent solver in Python 2.7. I know this isn't the most efficient way to solve this problem, but this code should be ...
11
votes
3answers
2k views

Simple chat bot

I made a chat bot, that, as you talk to it, it learns to respond. But the way it speaks is strange, so if you have any ideas on how to make its response any more human, then please say so. Anyway, ...
6
votes
2answers
352 views

Simple Java Neural Network

I've written a toy neural network in Java. I ran it several million times with the same outputs with only the randomized weights changing from run to run. The average of all of the outputs is not 0.5, ...
5
votes
1answer
71 views

Designing a circuit of gates in Clojure and doing forward and backpropagation

I am reading Hacker's guide to Neural Networks. Since I am also learning Clojure, I tried to implement them in Clojure. I would like the feedback about what could be more idiomatic and better in the ...
2
votes
0answers
400 views

Discretization of continuous attributes for automatic classification [closed]

Background In machine learning, it's common to encounter the problem of making a decision as to which discrete category an object belongs to based on a set of continuous attributes. For example, we ...
11
votes
1answer
469 views

Modified Taylor diagrams

There is a type of diagram summarizing how well predictions from numerical models fit expectations; one obvious use case is comparing machine-learning regression models. Modified Taylor diagrams are ...
3
votes
2answers
41 views

loopification of highly procedureal, though fully functional, multiclass perceptron

I've implemented the multiclass perceptron in the one vs. all style. I just thought about it and tried to implement it in the most basic way. I think it's correct though my f_measure is a bit low. ...
3
votes
1answer
365 views

Perceptron algorithm

This is the Perceptron algorithm, I wrote this implementation with my friend. It gets the job done, but it's quite dirty, perhaps one of you stylish hackers might help me beautify this beast. This ...
4
votes
1answer
73 views

Implementation of Logistic Regression

Is this kind of vectorized operations the most efficient way to do this in matlab? Any critics about my code? Am I doing something wrong (i tested several times, I think it works). Notice that I use J ...
5
votes
1answer
383 views

ANFIS network based on Sugeno model I

I've been learning Common Lisp lately and I've implemented ANFIS network based on Sugeno model I. Network layout and details can be read in these slides by Adriano Oliveira Cruz. I use sigmoid as the ...
4
votes
1answer
281 views

Generate and store hypernyms for all words in a hashmap

I have a system which reads in a clause in the form of a prolog "fact", i.e. 'is'('a sentence', 'this').. I want to generalize this up into higher-order classes and ...
4
votes
2answers
838 views

Inefficient hash map operation provokes OutOfMemory: Java heap space error

I know I can increase the size of the heap but that seems like a poor solution. This program runs correctly on small files but when run on large data sets it crashes with the OutOfMemory: Java heap ...
0
votes
1answer
357 views

Simple k-means implemention using Python3 and Pandas

Is there anything I can improve? The distance function is Pearson correlation. ...
0
votes
1answer
126 views

Linear regression with visualization

I have created a small script that: Creates a lot of random points. Runs a small brute force search to find a rect that has a low error, that is a good fit for the data. Runs a linear regression on ...
2
votes
3answers
257 views

Refactor jaccard similarity the “Scala way”

I'm trying to pick Scala up. This is a simple heuristic that checks a similarity value between two sets. I've done this a million times in Java or Python. The function works, but I'm certain I am not ...
6
votes
1answer
547 views

K-nearest neighbours in C# for large number of dimensions

I'm implementing the K-nearest neighbours classification algorithm in C# for a training and testing set of about 20,000 samples and 25 dimensions. There are only two classes, represented by ...
4
votes
0answers
159 views

Implementation of a new algorithm for sklearn

In the Python library, sklearn is implemented the algorithm for SparsePCA. I have written the code for a another version of this algorithm that is much faster in some situations. I have not enough ...
-1
votes
1answer
551 views

Stochastic gradient descent squared loss

I have implemented stochastic gradient descent in matlab and I would like to compare my results with another source but the error I am getting is higher (I am using squared error). I am worried I am ...
1
vote
1answer
84 views

Compute logistic regression on tweet objects

Is my approach good to naming variables and exception handling? I would like to make this code more robust and maintainable. I need advice on exception handling, var naming and comments. ...
5
votes
2answers
244 views

Defensive programming type-checking

I have issues with dynamically typed languages, and I tend to worry about type a lot. Numpy has different behaviour depending on if something is a matrix or a plain ndarray, or a list. I didn't ...
11
votes
1answer
2k views

Clojure Neural Network

After reading this article about Neural Networks I was inspired to write my own implementation that allows for more than one hidden layer. I am interested in how to make this code more idiomatic - ...
5
votes
1answer
1k views

Why does the LR on spark run so slowly?

Because the MLlib does not support the sparse input, I ran the following code, which supports the sparse input format, on spark clusters. The settings are: 5 nodes, each node with 8 cores (all the ...