Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test():
from mindsdb.libs.controllers.predictor import Predictor
mdb = Predictor(name='home_rentals')
mdb.learn(
from_data="https://raw.githubusercontent.com/mindsdb/mindsdb/master/docs/examples/basic/home_rentals.csv",
# the path to the file where we can learn from, (note: can be url)
to_predict='rental_price', # the column we want to learn to predict given all the data in the file
sample_margin_of_error=0.02
)
mdb = Predictor(name='home_rentals')
a = mdb.predict(when={'number_of_rooms': 10})
print('-------Preidiction output------------')
print(a.predicted_values)
def test():
from mindsdb.libs.controllers.predictor import Predictor
from mindsdb import CONFIG
CONFIG.DEBUG_BREAK_POINT = PHASE_DATA_EXTRACTOR
mdb = Predictor(name='home_rentals')
mdb.learn(
from_data="https://s3.eu-west-2.amazonaws.com/mindsdb-example-data/home_rentals.csv",
# the path to the file where we can learn from, (note: can be url)
to_predict='rental_price', # the column we want to learn to predict given all the data in the file
sample_margin_of_error=0.02
)
def test():
from mindsdb.libs.controllers.predictor import Predictor
from mindsdb import CONFIG
mdb = Predictor(name='home_rentals')
mdb.learn(
from_data="https://s3.eu-west-2.amazonaws.com/mindsdb-example-data/home_rentals.csv",
# the path to the file where we can learn from, (note: can be url)
to_predict='rental_price', # the column we want to learn to predict given all the data in the file
#sample_margin_of_error=0.02,
stop_training_in_x_seconds=6
)
#use the model to make predictions
result = mdb.predict(
when={"number_of_rooms": 2, "sqft": 1384})
result[0].explain()
when = {"number_of_rooms": 1,"sqft": 384}
def test():
from mindsdb.libs.controllers.predictor import Predictor
from mindsdb import CONFIG
CONFIG.DEBUG_BREAK_POINT = PHASE_STATS_GENERATOR
mdb = Predictor(name='home_rentals')
mdb.learn(
from_data="https://s3.eu-west-2.amazonaws.com/mindsdb-example-data/home_rentals.csv",
# the path to the file where we can learn from, (note: can be url)
to_predict='rental_price', # the column we want to learn to predict given all the data in the file
sample_margin_of_error=0.02
)
def test():
from mindsdb.libs.controllers.predictor import Predictor
from mindsdb import CONFIG
CONFIG.DEBUG_BREAK_POINT = PHASE_MODEL_TRAINER
mdb = Predictor(name='home_rentals')
mdb.learn(
from_data="https://raw.githubusercontent.com/mindsdb/mindsdb/master/docs/examples/basic/home_rentals.csv",
# the path to the file where we can learn from, (note: can be url)
to_predict='rental_price', # the column we want to learn to predict given all the data in the file
sample_margin_of_error=0.02,
stop_training_in_x_seconds=10
)
def test():
from mindsdb.libs.controllers.predictor import Predictor
mdb = Predictor(name='home_rentals')
mdb.learn(
from_data="https://raw.githubusercontent.com/mindsdb/mindsdb/master/docs/examples/basic/home_rentals.csv",
# the path to the file where we can learn from, (note: can be url)
to_predict='rental_price', # the column we want to learn to predict given all the data in the file
sample_margin_of_error=0.02
)
mdb = Predictor(name='home_rentals')
a = mdb.predict(when={'number_of_rooms': 10})
print('-------Preidiction output------------')
print(a.predicted_values)