Machine learning style of work.

 As we will see in this chapter, starting from the machine learning algorithm choice, how to build a predictive model can be revealed through a simple recipe.


The three parts of scikit-learn:


Model

The most common task when using the scikit-learn library is to create an object (model) of the classifier to use. For example, in the case of previous home size and bargaining issues,

from sklearn import LinearRegression



#Creating the regression model

linear_regression_model = LinearRegression ()

Our job will be to train this linear regression model with data.

Fit (train)

#Let, house_sizes = Contains all size of house

#house_price = Contains all price of house


#Training the model

linear_regression_model.fit (house_sizes, house_prices)

In general, each model often has these two functions of fit and predict.

Predict

#predicted value

"" "

Here, test_house_size is a variable that is not a member of training data, rather a unique one

"" "

predicted_price = linear_regression_model.predict (test_house_size)

In this predicted_price variable, the size of the house I want to know will be assigned.

What is meant by machine learning workflow?

By definition,

An orchestrated and repeatable pattern that systematically transforms and processes information to create prediction solutions.

An orchestrated and repeatable pattern:

This means that with the same workflow we will define the problem, and with that workflow, we will build the solution.

Transforms and processes information:

Before creating a model with data, it has to be made usable for training.

Suppose we want to create a predictive model that answers yes or no. If the input data is numerical then the output is numerical. For this reason, we can replace the yes / no labels in the training data with 1 and 0. This is called information preprocessing.

Create prediction solutions:

The ultimate goal of any machine learning is to be predictable. However, the prediction should meet the needs of the customer.

For example, a new data model of my model takes 2 days to train, it takes 1 more day to predict. Now if more new data comes in those 1 days, I need more time to train them. Until then, the time limit for predicting data will increase further. Will any healthy normal person adopt this model? Of course not, so the closer a model is able to predict the answer in less training time, the better the algorithm and machine learning system.

Comments