Blog KaryaVirtual

Gudang Pengetahuan Digital

Start the Machine Learning with Scikit-Learn

October 6, 2018 Machine Learning 0

A programming language that is widely used to develop machine learning is Python. Python is becoming very popular because of the many libraries that make it easier to develop machine learning so that less code is needed. One of the library's reply makes it easy to make machine learning is scikit. Use the library makes it easy to programmatically because fewer lines of code than other libraries such as tensorflow or numpy.   Scikit-Learn can be used to:

  • Classification
  • Regression
  • Clustering
  • Dimensionality Reduction
  • Model Selection
  • Preprocessing

  Here is an example line of code using scikit > > > from sklearn import neural_network. MLPClassifier > > > X = [[0, 0], [1, 1]] > > > y = [0, 1] > > > clf = MLPClassifier (solver = ' lbfgs ', alpha = 1e-5, hidden_layer_sizes = (5, 2), random_state = 1) > > > clf. fit (X, y) MLPClassifier (activation = ' relu ', alpha = 1e-05, batch_size = ' auto ', beta_1 = 0.9, beta_2 = 0.999, early_stopping = False, epsilon = 1e-08, hidden_layer_sizes = (5, 2), learning_rate = ' constant ', learning_rate_init = 0.001, max_iter = 200, momentum = 0.9, n_iter_no_change = 10, nesterovs_momentum = True, power_t = 0.5, random_state = 1, shuffle = True, solver = ' lbfgs ', toll = 0.0001, validation_fraction = 0.1, verbose = False, warm_start = False) will produce output sbb to do predictions :

> > > clf. predict ([[2., 2.]])
array ([1])
 

Leave a Reply

Your email address will not be published. Required fields are marked *