<jupyter_start><jupyter_text><jupyter_code>!pip install mindsdb
import mindsdb
from mindsdb import *

# First we initiate MindsDB
mdb = MindsDB(name="home_rentals")

# We tell mindsDB what we want to learn and from what data
mdb.learn(
    from_data="https://raw.githubusercontent.com/mindsdb/main/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
)
# use the model to make predictions
mdb_predict = mindsdb.Predictor(name='home_rentals')
result = mdb_predict.predict(when={'number_of_rooms': 2,'number_of_bathrooms':1, 'sqft': 1190})

# you can now print the results
print('The predicted price is ${price} with {conf} confidence'.format(price=result[0]['rental_price'], conf=result[0]['rental_price_confidence']))<jupyter_output>[33mWARNING:mindsdb-logger-core-logger:libs/phases/base_module.py:57 - 'Target phase is different than PHASE_END, Only change this for debug purposes'[0m
[32mINFO:mindsdb-logger-core-logger:libs/phases/base_module.py:63 - '[START] DataExtractor'[0m
[32mINFO:mindsdb-logger-core-logger:libs/phases/base_module.py:76 - '[END] DataExtractor, execution time: 0.072 seconds'[0m
[33mWARNING:mindsdb-logger-core-logger:libs/helpers/general_helpers.py:134 - 'could not check for MindsDB updates'[0m
{'fraction_non_alphanumeric': 0.12419239052404882, 'fraction_numerical': 0.023689877961234746, 'mean_word_length': 6.494623655913978, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '440856', 'license': 'MIT', 'n_tokens_mistral': 501, 'n_tokens_neox': 470, 'n_words': 115, 'path': 'mindsDB.ipynb', 'repo_name': 'Seankudg/Hands-on-Python-for-Finance', 'size': '1393'}