Forecasting The Price of Untradeable SBC Players Had They Been Tradeable Using Machine Learning

FIFA19 3 - Forecasting The Price of Untradeable SBC Players Had They Been Tradeable Using Machine Learning

Ok so I was curious to know what the price of 2 POTM would be had he been a tradeable card on the market on PS4. Fair warning: for this analysis only I took into account the player goal/assist contributions from Futbin data and other variables such as nationality, league, links, etc. were ignored. I'm going to add those in when I have more time for later SBCs. Btw, this same method can be used to evaluate the real price of a player on the market too to know if you are overpaying and if there would be equivalent players available for better prices.

I used Python3 with pandas, sklearn, and requests library. To install all the dependancies run:

pip3 install pandas requests sklearn

Then import all the libraries

“` import requests import pandas import io

from bs4 import BeautifulSoup from sklearn.neighbors import KNeighborsRegressor “`

Then we can implement parsers to scrape futbin for the player goal contribution data:

“` def normalize_price(price_row): new_price_row = <> for price in price_row: price_str = str(price) if price_str<-1> == 'M': new_price_row.append(float(price_str<:-1>) * 1000000) elif price_str<-1> == 'K': new_price_row.append(float(price_str<:-1>) * 1000) else: try: new_price_row.append(float(price_str)) except: new_price_row.append(0) return new_price_row

def load_pgp_data( sort: str='goals', count: int=100, min_games: int=10000, order: str='desc', version: str='all_nif' ): # construct the filter url default_count_per_page = 30 # this is what futbin shows by default on each page number_of_pages_to_load = int(count / default_count_per_page) + 1

dataframes = <> for page in range(number_of_pages_to_load): request_url = f'{page}' request_url += f'&sort={sort}&games={min_games}&order={order}&version={version}' res = requests.get(request_url) # find the players table soup = BeautifulSoup(res.content, 'html.parser') players_table = soup.findAll("table", {"class": "table-hover"})<0> players_table = f'<html><body>{players_table}</body></html>' # turn the table into a pandas dataframe df = pandas.read_html(io.StringIO(players_table))<0> # clean up and normalize the price variables df<'PS4'> = normalize_price(df<'PS4'>) df<'XB1'> = normalize_price(df<'XB1'>) dataframes.append(df) return pandas.concat(dataframes) 


For this model, I loaded the top 1000 players based on goals scored per game and trained a knn model on them.

“` gpg_top_1000 = load_pgp_data(count=1000, version='gold') model_labels = <'Goals', 'Assists', 'Rating'> model_targets = <'PS4'>

neigh = KNeighborsRegressor(n_neighbors=2), gpg_top_1000) “`

I used the model to forecast the price of the 2 POTM Reus card:


predict the price of Reus if he was not a an untradeable card

neigh.predict(<<0.72, 0.37, 90>>) “`


array(<<822500.>>) “`

So if he was a tradeable card on the market, he would go for about 822k on PS4.

If people are interested, for later SBCs I can pull the card stats, reviews on futbin (with sentiment analysis) and goal contributions data to make better forcasts for player SBCs.

Original link

© Post "Forecasting The Price of Untradeable SBC Players Had They Been Tradeable Using Machine Learning" for game FIFA 19.

Top-10 Best Video Games of 2018 So Far

2018 has been a stellar year for video game fans, and there's still more to come. The list for the Best Games of So Far!

Top-10 Most Anticipated Video Games of 2019

With 2018 bringing such incredible titles to gaming, it's no wonder everyone's already looking forward to 2019's offerings. All the best new games slated for a 2019 release, fans all over the world want to dive into these anticipated games!

You Might Also Like